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