function DenseMatrix (data, datatype) {
    if (!(this instanceof DenseMatrix)) { throw new SyntaxError('Constructor must be called with the new operator') }
    if (datatype && !isString(datatype)) { throw new Error('Invalid datatype: ' + datatype) }

    if (isMatrix(data)) {
      // check data is a DenseMatrix
      if (data.type === 'DenseMatrix') {
        // clone data & size
        this._data = clone(data._data)
        this._size = clone(data._size)
        this._datatype = datatype || data._datatype
      } else {
        // build data from existing matrix
        this._data = data.toArray()
        this._size = data.size()
        this._datatype = datatype || data._datatype
      }
    } else if (data && isArray(data.data) && isArray(data.size)) {
      // initialize fields from JSON representation
      this._data = data.data
      this._size = data.size
      // verify the dimensions of the array
      validate(this._data, this._size)
      this._datatype = datatype || data.datatype
    } else if (isArray(data)) {
      // replace nested Matrices with Arrays
      this._data = preprocess(data)
      // get the dimensions of the array
      this._size = arraySize(this._data)
      // verify the dimensions of the array, TODO: compute size while processing array
      validate(this._data, this._size)
      // data type unknown
      this._datatype = datatype
    } else if (data) {
      // unsupported type
      throw new TypeError('Unsupported type of data (' + typeOf(data) + ')')
    } else {
      // nothing provided
      this._data = []
      this._size = [0]
      this._datatype = datatype
    }
  }
Dense Matrix implementation. A regular, dense matrix, supporting multi-dimensional matrices. This is the default matrix type.
@class DenseMatrix
@enum {{ value, index: number[] }}