19 using namespace NEWMAT;
35 while (j--)
if (x < *(++f)) { g = f; x = *g; }
36 *g = *first; *first++ = x;
45 for (i = 1; i <= n; i++)
46 X(i) = sin((
Real)i) + 0.3 * cos(i/5.0) - 0.6 * sin(i/7.0) + 0.2 * sin(2.0 * i);
68 Tracer et(
"Sixth test of Matrix package");
76 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; }
79 for (i=1;i<=6;i++)
for (j=i;j<=6;j++) S(i,j)=i*i+2.0+j;
82 for (i=1;i<=6;i++)
for (j=1;j<=6;j++) M(i,j)=i*j+i*i-10.0;
99 Tracer et1(
"Stage 3 - concatenate");
101 A << 1 << 2 << 3 << 4 << 5;
103 B << 3 << 1 << 4 << 1 << 5;
105 C << 2 << 3 << 5 << 7 << 11
106 << 13 << 17 << 19 << 23 << 29
107 << 31 << 37 << 41 << 43 << 47;
130 M1 = UT2 | LT1; M2 = LT2 & UT1;
132 M1 = (LT1 | UT2) & (UT2 | LT1);
133 M2 = (UT1 & LT2) | (LT2 & UT1);
149 M3 = M3.
t() - SM;
Print(M3);
152 Tracer et1(
"Stage 4 - sort");
virtual void ReSize(int m, int n)
void SortAscending(GeneralMatrix &gm)
ReversedMatrix Reverse() const
static void TestSort(int n)
TransposedMatrix t() const
The usual rectangular matrix.
void SortDescending(GeneralMatrix &gm)
GetSubMatrix SymSubMatrix(int f, int l) const
GetSubMatrix Row(int f) const
GetSubMatrix SubMatrix(int fr, int lr, int fc, int lc) const
void Print(const Matrix &X)
static void SimpleSortDescending(Real *first, const int length)
GetSubMatrix Rows(int f, int l) const