Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public TransformScale(int dimnum, double coef) : base(DMatrix.Get1Matrix(dimnum) * coef)
 {
 }
Ejemplo n.º 3
0
 public TransformScale(int dimnum, int dim, double coef)
     : base(DMatrix.GetScaleMatrix(dimnum, dim, coef))
 {
 }
Ejemplo n.º 4
0
 public TransformScale(double[] coefs) : base(DMatrix.GetDiagMatrix(coefs))
 {
 }
Ejemplo n.º 5
0
 public static TransformDouble GetIdentityTransform(int dimnum)
 {
     return(new TransformDouble(DMatrix.Get1Matrix(dimnum), new DVector(dimnum)));
 }
Ejemplo n.º 6
0
 public TransformDouble(DMatrix transmatr, DVector transvect)
 {
     this.transmatr = transmatr;
     this.transvect = transvect;
 }
Ejemplo n.º 7
0
 public TransformMatrix(DMatrix matr)
 {
     transmatr = matr * 1;
 }
Ejemplo n.º 8
0
 public override TransformDouble ToTrDouble()
 {
     return(new TransformDouble(DMatrix.Get1Matrix(transvect.DimNumber), transvect));
 }