Category : C++ Source Code
Archive   : NEWMAT07.ZIP
Filename : TMT6.CXX

 
Output of file : TMT6.CXX contained in archive : NEWMAT07.ZIP

//#define WANT_STREAM

#include "include.h"

#include "newmat.h"


/**************************** test program ******************************/

void Print(const Matrix& X);
void Print(const UpperTriangularMatrix& X);
void Print(const DiagonalMatrix& X);
void Print(const SymmetricMatrix& X);
void Print(const LowerTriangularMatrix& X);

void trymat6()
{
// cout << "\nSixth test of Matrix package\n";
Tracer et("Sixth test of Matrix package");
Exception::PrintTrace(TRUE);

int i,j;


DiagonalMatrix D(6);
UpperTriangularMatrix U(6);
for (i=1;i<=6;i++) { for (j=i;j<=6;j++) U(i,j)=i*i*i-50; D(i,i)=i*i+i-10; }
LowerTriangularMatrix L=(U*3.0).t();
SymmetricMatrix S(6);
for (i=1;i<=6;i++) for (j=i;j<=6;j++) S(i,j)=i*i+2.0+j;
Matrix MD=D; Matrix ML=L; Matrix MU=U; Matrix MS=S;
Matrix M(6,6);
for (i=1;i<=6;i++) for (j=1;j<=6;j++) M(i,j)=i*j+i*i-10.0;
{
Tracer et1("Stage 1");
Print(Matrix(MS+(-MS)));
Print(Matrix((S+M)-(MS+M)));
Print(Matrix((M+U)-(M+MU)));
Print(Matrix((M+L)-(M+ML)));
}
{
Tracer et1("Stage 2");
Print(Matrix((M+D)-(M+MD)));
Print(Matrix((U+D)-(MU+MD)));
Print(Matrix((D+L)-(ML+MD)));
Print(Matrix((-U+D)+MU-MD));
Print(Matrix((-L+D)+ML-MD));
}



// cout << "\nEnd of sixth test\n";
}



  3 Responses to “Category : C++ Source Code
Archive   : NEWMAT07.ZIP
Filename : TMT6.CXX

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/