Download QCMatPack Matrix and Numerical Analysis Software - Quinn
Transcript
40 Matrix Classes
DDMat C = DDMat.divide(A, B);
Scalar Division
static DDMat divide(DDMat a, double b)
(matrix / scalar)
static DXMat divide(DXMat a, DComplex b)
(matrix / scalar)
static DXMat divide(DXMat a, double b)
(matrix / scalar
Given a matrix A, and a scalar c, the division of A / c is calculated by dividing every
element of the matrix A by the scalar c.
double [][] aData = {{1,2,3,4},{4,5,6,7},{7,8,9, 10}}; // (3 x 4)
DDMat A = new DDMat(aData);
double c = 3.1415;
DDMat B = DDMat.divide(A, c);
Mix all of the operators in complex math expressions
[C#]
double [,] aData = {{1,2,3,4},{4,5,6,7},{7,8,9, 10}}; // (3 x 4)
double [,] bData = {{5,6,7,8,9},{9,7,8,6,4},{3,2,1,0,9},{3,7,0,4,7}}; // (4 x 5)
double [,] cData = {{5,6,7,8,9},{9,7,8,6,4},{3,2,1,0,9}}; // (3 x 5)
DDMat A = new DDMat(aData);
DDMat B = new DDMat(bData);
DDMat C = new DDMat(cData);
DDMat D = A * B + C * 3.1415; // (3 x 5)
[VB]
Dim aData As Double(,) = {{1, 2, 3, 4}, {4, 5, 6, 7}, {7, 8, 9, 10}}
' (3 x 4)
Dim bData As Double(,) = {{5, 6, 7, 8, 9}, {9, 7, 8, 6, 4}, {3, 2, 1, 0, 9}, {3,
7, 0, 4, 7}} ' (4 x 5)
Dim cData As Double(,) = {{5, 6, 7, 8, 9}, {9, 7, 8, 6, 4}, {3, 2, 1, 0, 9}}
5
Dim A As New DDMat(aData)
Dim B As New DDMat(bData)
Dim C As New DDMat(cData)
'3 x