18 using namespace NEWMAT;
28 Tracer et(
"Fourth test of Matrix package");
37 for (i=1;i<=10;i++)
for (j=1;j<=10;j++) M(i,j) = 100*i+j;
65 for (i=1;i<=5;i++)
for (j=1;j<=8;j++) M(i,j) = 100*i+j;
81 for (i=1;i<=5;i++)
for (j=1;j<=8;j++) X(i,9-j) = 100*i+j;
89 for (i=1; i<=4; i++)
for (j=1; j<=5; j++)
100 BM(1,1) = 1; BM(1,2) = 2; BM(1,3) = 3;
101 BM(2,1) = 4; BM(2,2) = 5; BM(2,3) = 6; BM(2,4) = 7;
102 BM(3,1) = 8; BM(3,2) = 9; BM(3,3) =10; BM(3,4) =11; BM(3,5) =12;
103 BM(4,1) =13; BM(4,2) =14; BM(4,3) =15; BM(4,4) =16; BM(4,5) =17;
104 BM(5,2) =18; BM(5,3) =19; BM(5,4) =20; BM(5,5) =21;
110 C = A * C - BM;
Clean(C, 0.000000001);
Print(C);
112 C = A * C - M;
Clean(C, 0.000000001);
Print(C);
116 BM1.
Row(1) << 1 << 2 << 3;
117 BM1.
Row(2) << 4 << 5 << 6 << 7;
118 BM1.
Row(3) << 8 << 9 << 10 << 11 << 12;
119 BM1.
Row(4) << 13 << 14 << 15 << 16 << 17;
120 BM1.
Row(5) << 18 << 19 << 20 << 21;
126 X << 1 << 2 << 3 << 4
136 D(1) -= 23;
Print(D);
142 h << 1.0 << 2.0 << 0.0 << 1.0 ;
153 D << 18 << 23 << 31 << 17;
155 D1.
Row(1) << 18; D1.
Row(2) << 23; D1.
Row(3) << 31; D1.
Row(4) << 17;
157 D1(1) = 18; D1(2) = 23; D1(3) = 31; D1(4) = 17;
171 D = B - A1;
Print(D);
173 D = A - B1;
Print(D);
209 swap(LBB, LBA); D = LBA;
Print(D); LBB -= LBA1; D = LBB;
Print(D);
213 swap(UBA, UBB); D = UBA;
Print(D); UBB -= UBA1; D = UBB;
Print(D);
220 SBB -= SBA1; D = SBB;
Print(D);
227 D = CA.
i() * B - IA;
Clean(D,0.00000001);
Print(D);
228 D = CB.
i() * A - IB;
Clean(D,0.00000001);
Print(D);
233 D = BLUA.
i() * BB - IA;
Clean(D,0.00000001);
Print(D);
234 D = BLUB.
i() * BA - IB;
Clean(D,0.00000001);
Print(D);
240 D = SBLUA.
i() * SBB - IA;
Clean(D,0.00000001);
Print(D);
241 D = SBLUB.
i() * SBA - IB;
Clean(D,0.00000001);
Print(D);
GetSubMatrix Columns(int f, int l) const
void swap(Matrix &A, Matrix &B)
virtual void ReSize(int m, int n)
void Inject(const GeneralMatrix &GM)
virtual void ReSize(int m, int n, int b)
ReversedMatrix Reverse() const
Upper triangular band matrix.
void Clean(Matrix &A, Real c)
GetSubMatrix Column(int f) const
TransposedMatrix t() const
void ReSize(int m, int b)
The usual rectangular matrix.
GetSubMatrix SymSubMatrix(int f, int l) const
FloatVector FloatVector * a
LU decomposition of a band matrix.
GetSubMatrix Row(int f) const
GetSubMatrix SubMatrix(int fr, int lr, int fc, int lc) const
Lower triangular band matrix.
void Print(const Matrix &X)
A matrix which can be of any GeneralMatrix type.
GetSubMatrix Rows(int f, int l) const
void FillWithValues(MultWithCarry &MWC, Matrix &M)