17 using namespace NEWMAT;
26 Tracer et(
"Twelfth test of Matrix package");
31 for (i=1;i<=15;i++)
for (j=1;j<=15;j++) A(i,j)=i*i+j-150;
34 for (i=1;i<=15;i++) B(i)=i+i*i-150.0;
42 for (i=1; i<=3; i++)
for (j=1; j<=5; j++) A(i,j) = i+100*j;
52 Matrix XR = (A+10000).AsMatrix(15,1).
t();
59 Matrix MR = (A+10000).AsColumn().
t();
90 for (i=1; i<=3; i++)
for (j=1; j<=5; j++) B(5*(i-1)+j) -= i+100*j;
97 for (i=1; i<=7; i++)
for (j=1; j<=7; j++) A(i,j) = i*j*j;
98 for (i=1; i<=7; i++) D(i,i) = i;
100 Matrix X = A;
for (i=1; i<=7; i++) X(i,i) = i;
102 X = U; U.
Inject(D); A = U;
for (i=1; i<=7; i++) X(i,i) = i;
109 for (i=1; i<=7; i++)
for (j=1; j<=5; j++) A(i,j) = i+100*j;
112 Y = A; Y = ((
const Matrix&)X) - A;
Print(Y); Y = 0.0;
120 for (i=1; i<=20; i++)
for (j=i; j<=20; j++) U(i,j)=100 * i + j;
130 U1 -= (777*V);
Print(U1);
133 U1 -= U; U2 = U1; U1 << U1.
SubMatrix(4,8,5,9);
153 L1 -= (777*M);
Print(L1);
156 L1 -= L; L2 =L1; L1 << L1.
SubMatrix(5,9,4,8);
171 for (i=1; i<=20; i++)
for (j=1; j<=30; j++) M(i,j)=100 * i + j;
174 for (j=1; j<=30; j++)
176 for (i=1; i<=20; i++)
187 for (i=1; i<=20; i++)
for (j=1; j<=30; j++) M(i,j)=100 * i + j;
192 X = M1 - M2;
Print(X);
200 Y = N1 - N2;
Print(Y);
202 N = M1 / 2; N1 = N * 2; N.
Release(); N2 = N * 2; Y = N;
Print(N);
203 Y = (N1 - M1) | (N2 - M1);
Print(Y);
292 X = A1.
t() * A1 - IdentityMatrix(20);
294 X = A1 * A1.
t() - IdentityMatrix(20);
303 X = A2.
t() * A2 - IdentityMatrix(15);
309 X = A2.
t() * A2 - IdentityMatrix(100);
311 X = A2 * A2.
t() - IdentityMatrix(100);
322 Matrix VE(40,40); VE.columns(1,15) = V;
342 X = CV - CVX;
Clean(X, 0.000000001);
Print(X);
343 Ones.resize(20); Ones = 1;
GetSubMatrix Columns(int f, int l) const
GetSubMatrix columns(int, int) const
virtual void ReSize(int m, int n)
void Inject(const GeneralMatrix &GM)
ReturnMatrix sum_rows() const
ReturnMatrix sum_columns() const
void Clean(Matrix &A, Real c)
GetSubMatrix Column(int f) const
RowedMatrix AsRow() const
TransposedMatrix t() const
void extend_orthonormal(Matrix &A, int n)
void SVD(const Matrix &, DiagonalMatrix &, Matrix &, Matrix &, bool=true, bool=true)
ReturnMatrix sum_square_rows() const
The usual rectangular matrix.
GetSubMatrix SymSubMatrix(int f, int l) const
Rectangular matrix for use with Numerical Recipes in C.
void QRZ(Matrix &X, UpperTriangularMatrix &U)
MatedMatrix AsMatrix(int m, int n) const
GetSubMatrix Row(int f) const
GetSubMatrix SubMatrix(int fr, int lr, int fc, int lc) const
ReturnMatrix sum_square_columns() const
ColedMatrix AsColumn() const
void Print(const Matrix &X)
void FillWithValues(MultWithCarry &MWC, Matrix &M)