Category : C++ Source Code
Archive   : BLFMATH.ZIP
Filename : SIMPMAT.MTH
// simpmat.mth: Class methods for simple dynamic matrices.
// Copyright(c) 1993 Azarona Software. All rights reserved.
/////////////////////////////////////////////////////////////////
template
SimpleMatrix
// General constructor
{
nrows = nr; ncols = nc;
data = new TYPE[nrows*ncols];
}
template
SimpleMatrix
// Copy constructor
{
nrows = m.nrows; ncols = m.ncols;
data = new TYPE[nrows*ncols];
Copy(m);
}
template
void SimpleMatrix
// Does a two-dimensional copy from m to this matrix,
// truncating if necessary. The logical size of this
// matrix may become smaller, but never larger.
{
// sc, tc = column vector pointers
VecPtr
VecPtr
// sr, tr = row vector pointers
VecPtr
VecPtr
unsigned nr = nrows;
if (nr > m.nrows) nr = m.nrows;
unsigned nc = ncols;
if (nc > m.ncols) nc = m.ncols;
for (unsigned i = 0; i
tr = tc; // Point to current row of t
sr = sc; // Point to current row of s
for (unsigned j = 0; j
tr++; // Next column
sr++; // Ditto
}
tc++; // Next row
sc++; // Ditto
}
nrows = nr; // New logical size of matrix, may be smaller
ncols = nc;
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/