Ejemplo n.º 1
0
 public Matrix(double[] vector)
 {
     _matrix = new DoubleMatrixElement[vector.Length, 1];
     for (int i = 0; i < vector.Length; i++)
         _matrix[i, 0] = new DoubleMatrixElement(vector[i]);
     this._matrixChanged = true;
 }
Ejemplo n.º 2
0
 public Matrix(double[,] matrix)
 {
     _matrix = new DoubleMatrixElement[matrix.GetLength(0),matrix.GetLength(1)];
     for (int i = 0; i < matrix.GetLength(1); i++)
         for (int j = 0; j < matrix.GetLength(0); j++)
             _matrix[j,i] = new DoubleMatrixElement(matrix[j, i]);
     this._matrixChanged = true;
 }
Ejemplo n.º 3
0
 public static Matrix IdentityMatrix(int size)
 {
     Matrix m = new Matrix(size, size, new DoubleMatrixElement(0));
     for (int i = 0; i < size; i++)
         m[i, i] = new DoubleMatrixElement(1);
     return m;
 }