Esempio n. 1
0
 /// <summary>
 /// Constructs a copy of A
 /// </summary>
 /// <param name="A"></param>
 public Matrix(Matrix <TVal> A)
 {
     _math   = A._math;
     Rows    = A.Rows;
     Cols    = A.Cols;
     _matrix = new TVal[Rows, Cols];
     Array.Copy(A._matrix, _matrix, _matrix.Length);
 }
Esempio n. 2
0
 /// <summary>
 /// Constructs an N*M matrix
 /// </summary>
 /// <param name="rows">N</param>
 /// <param name="cols">M</param>
 public Matrix(int rows, int cols)
 {
     if (rows < 0 || cols < 0)
     {
         throw new ArgumentOutOfRangeException("rows/cols must be positive");
     }
     _math   = MathLib.Get <TVal>();
     Rows    = rows;
     Cols    = cols;
     _matrix = new TVal[rows, cols];
 }
Esempio n. 3
0
 public MathLib(IMathLib mathLib)
 {
     _mathLib = mathLib;
 }
Esempio n. 4
0
 public MathService(IMathLib mathLib) => _mathLib = mathLib;
Esempio n. 5
0
 public AbstractMathLibTests(IMathLib mathLib)
 {
     MathLib = mathLib;
 }