MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / main

Function main

applications/test/Matrix/Test-Matrix.C:39–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37// Main program:
38
39int main(int argc, char *argv[])
40{
41 SquareMatrix<scalar> hmm(3);
42
43 hmm(0, 0) = -3.0;
44 hmm(0, 1) = 10.0;
45 hmm(0, 2) = -4.0;
46 hmm(1, 0) = 2.0;
47 hmm(1, 1) = 3.0;
48 hmm(1, 2) = 10.0;
49 hmm(2, 0) = 2.0;
50 hmm(2, 1) = 6.0;
51 hmm(2, 2) = 1.0;
52
53 //Info<< hmm << endl << hmm - 2.0*(-hmm) << endl;
54 Info<< max(hmm) << endl;
55 Info<< min(hmm) << endl;
56
57 SquareMatrix<scalar> hmm2(3, I);
58
59 hmm = hmm2;
60
61 Info<< hmm << endl;
62
63 //SquareMatrix<scalar> hmm3(Sin);
64
65 //Info<< hmm3 << endl;
66
67 SquareMatrix<scalar> hmm4;
68
69 hmm4 = hmm2;
70
71 Info<< hmm4 << endl;
72
73 SquareMatrix<scalar> hmm5;
74
75 hmm4 = hmm5;
76 Info<< hmm5 << endl;
77
78 {
79 RectangularMatrix<scalar> rm1(5, 6, 3.1);
80 rm1(0, 1) = 4.5;
81 RectangularMatrix<scalar> rm1b(rm1.block(2, 2, 0, 0));
82 Info<< "rm1b = " << rm1b << endl;
83 }
84
85 {
86 scalarSymmetricSquareMatrix symmMatrix(3, Zero);
87
88 symmMatrix(0, 0) = 4;
89 symmMatrix(1, 0) = 12;
90 symmMatrix(1, 1) = 37;
91 symmMatrix(2, 0) = -16;
92 symmMatrix(2, 1) = -43;
93 symmMatrix(2, 2) = 98;
94
95 Info<< "Symmetric Square Matrix = " << symmMatrix << endl;
96

Callers

nothing calls this directly

Calls 7

maxFunction · 0.85
minFunction · 0.85
LUDecomposeFunction · 0.85
invFunction · 0.50
detFunction · 0.50
blockMethod · 0.45
invMethod · 0.45

Tested by

no test coverage detected