public static DMatrix operator *(DMatrix a, DMatrix b)//matrix multiplication { if (a.DimNumber != b.DimNumber) { throw new ArgumentException(); } DMatrix res = new DMatrix(a.DimNumber); for (int row = 0; row < a.DimNumber; row++) { for (int col = 0; col < a.DimNumber; col++) { double sum = 0; for (int i = 0; i < a.DimNumber; i++) { sum += a[row, i] * b[i, col]; } res[row, col] = sum; } } return(res); }
public TransformScale(int dimnum, double coef) : base(DMatrix.Get1Matrix(dimnum) * coef) { }
public TransformScale(int dimnum, int dim, double coef) : base(DMatrix.GetScaleMatrix(dimnum, dim, coef)) { }
public TransformScale(double[] coefs) : base(DMatrix.GetDiagMatrix(coefs)) { }
public static TransformDouble GetIdentityTransform(int dimnum) { return(new TransformDouble(DMatrix.Get1Matrix(dimnum), new DVector(dimnum))); }
public TransformDouble(DMatrix transmatr, DVector transvect) { this.transmatr = transmatr; this.transvect = transvect; }
public TransformMatrix(DMatrix matr) { transmatr = matr * 1; }
public override TransformDouble ToTrDouble() { return(new TransformDouble(DMatrix.Get1Matrix(transvect.DimNumber), transvect)); }