Returns a array representation of the matrix
181214
function() {
                	var matrix_rows = [];
                	var n = this.elements.length;
                	for (var i = 0; i < n; i++) {
                    matrix_rows.push(this.elements[i]);
                	}
                  return matrix_rows;
                }
1214964
def _array_2d_repr(self):
        """"""

        sc_array = np.zeros((self.nmax + 1, 2 * self.mmax + 1),
                            dtype=np.complex128)

        lst = self._reshape_n_vecs()
        sc_array[0:self.nmax + 1, self.mmax] = lst[0]
        for m in xrange(1, self.mmax + 1):
            sc_array[m:self.nmax + 1, self.mmax - m] = lst[2 * m - 1]
            sc_array[m:self.nmax + 1, self.mmax + m] = lst[2 * m]

        return sc_array
325179
function makeMatrix(n, m, x) {
  var matrix = [];
  for (var i = 0; i < n; i++) {
    matrix[i] = new Array(m);
    for (var j = 0; j < m; j++) {
      matrix[i][j] = x;
    }
  }

  return matrix;
}
1229940
def lengths( self ):
        
        return( np.array( [ math.sqrt( sum( row**2 ) ) for row in self.matrix ] ) )
1343439
def _dcm_array_to_matrix3(self, dcm):
        
        assert(dcm.shape == (3, 3))
        a = Vector3(dcm[0][0], dcm[0][1], dcm[0][2])
        b = Vector3(dcm[1][0], dcm[1][1], dcm[1][2])
        c = Vector3(dcm[2][0], dcm[2][1], dcm[2][2])
        return Matrix3(a, b, c)
571723
def to_gsl
      numerics_as_arrays = numeric_vectors.map { |n| self[n].to_a }

      GSL::Matrix.alloc(*numerics_as_arrays.transpose)
    end
1075958
function printMatrix3 (m) {
  const tStr = m.elements.map(formatPrintNumber);
  const matrixString = `
  +-                         -+
  | ${tStr[0]}  ${tStr[3]}  ${tStr[6]} |
  | ${tStr[1]}  ${tStr[4]}  ${tStr[7]} |
  | ${tStr[2]}  ${tStr[5]}  ${tStr[8]} |
  +-                         -+`;
  return matrixString;
}
655298
def matrix(self) -> np.ndarray:
        
        num_qubits = self.num_qubits()
        if num_qubits is None:
            raise ValueError('Unknown number of qubits')
        num_dim = 2 ** num_qubits
        result = np.zeros((num_dim, num_dim), dtype=np.complex128)
        for gate, coefficient in self.items():
            result += protocols.unitary(gate) * coefficient
        return result
937124
function arrayToMatrix (a) {
  return { a: a[0], b: a[1], c: a[2], d: a[3], e: a[4], f: a[5] }
}
363956
def get_matrix(self):
        
        data = []
        with open(self.path, encoding=self.encoding) as csv_file:
            csv_reader = csv.reader(csv_file, delimiter=",", quotechar="\"")
            for row in csv_reader:
                data.append(row)

        return data
892670
function () {
            var matrixs = Array.prototype.slice.call(arguments);
            var result = matrixs[0];
            for (var i = 1, matrix; matrix = matrixs[i]; i++) {
                result = this.mul(result, matrix);
            }

            return result;
        }
1257270
public function displayMatrix()
    {
        $this->setupMatrix();

        $oneSize = mb_strlen($this->compOne, 'UTF-8');
        $twoSize = mb_strlen($this->compTwo, 'UTF-8');

        $out = '  ' . $this->compOne . PHP_EOL;
        for ($y = 0; $y <= $twoSize; $y += 1) {
            if ($y - 1 < 0) {
                $out .= ' ';
            } else {
                $out .= mb_substr($this->compTwo, $y - 1, 1, 'UTF-8');
            }

            for ($x = 0; $x <= $oneSize; $x += 1) {
                $out .= $this->matrix[$x][$y];
            }

            $out .= PHP_EOL;
        }

        return $out;
    }
412239
function _Matrix(numRows, numColumns, data) {
  if(!Number.isInteger(numRows))
    throw new TypeError("/numRows/ must be an integer.");
  if(!Number.isInteger(numColumns))
      throw new TypeError("/numColumns/ must be an integer.");

  var _values;
  var _numValues = numRows * numColumns;
  if (!data || data === undefined)
    _values = [];
  else if (!util.isNumberArray(data))
    throw new TypeError('Invalid values for vector.');
  else
    _values = data;

  // Make sure the matrix has numRows * numColumns values
  if (_values.length < _numValues) {
    var zeros = Array(_numValues - _values.length).fill(0);
    _values = _values.concat(zeros);
  } else if (_values.length > _numValues) {
    _values = _values.slice(0, _numValues);
  }

  var size = {"rows": numRows, "columns": numColumns};
  readonly(this, "size", size);
  readonly(this, "values", _values);
  readonly(this, "rows", _getRows(this));
  readonly(this, "columns", _getColumns(this));
}
115679
function Matrix(m) {
  m = m || [1, 0, 0, 1, 0, 0];
  this.m = [m[0], m[1], m[2], m[3], m[4], m[5]];
}
778870
function() {
    var rows = this.elements.length, cols = this.elements[0].length;
    var elements = [], ni = cols, i, nj, j;
    do { i = cols - ni;
      elements[i] = [];
      nj = rows;
      do { j = rows - nj;
        elements[i][j] = this.elements[j][i];
      } while (--nj);
    } while (--ni);
    return Matrix.create(elements);
  }
1223035
def inv_matrix(self) -> np.ndarray:
        
        if self._inv_matrix is None:
            self._inv_matrix = inv(self._matrix)
            self._inv_matrix.setflags(write=False)
        return self._inv_matrix
550777
function _getRows(matrix) {
  var rows = [];
  for (var i=0; i<matrix.size.rows; i++) {
    rows.push([]);
    for (var j=0; j<matrix.size.columns; j++)
      rows[i].push(matrix.values[matrix.size.columns * i + j]);
  }
  return rows;
}