/// <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); }
/// <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]; }
public MathLib(IMathLib mathLib) { _mathLib = mathLib; }
public MathService(IMathLib mathLib) => _mathLib = mathLib;
public AbstractMathLibTests(IMathLib mathLib) { MathLib = mathLib; }