/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ /* */ /* */ /* MV++ Numerical Matrix/Vector C++ Library */ /* MV++ Version 1.5 */ /* */ /* R. Pozo */ /* National Institute of Standards and Technology */ /* */ /* NOTICE */ /* */ /* Permission to use, copy, modify, and distribute this software and */ /* its documentation for any purpose and without fee is hereby granted */ /* provided that this permission notice appear in all copies and */ /* supporting documentation. */ /* */ /* Neither the Institution (National Institute of Standards and Technology) */ /* nor the author makes any representations about the suitability of this */ /* software for any purpose. This software is provided ``as is''without */ /* expressed or implied warranty. */ /* */ /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ // // tmat.cc Testing routine for MV++ matrix class // // Usage: // // (Suggest these to be relatively small positive numbers, as // output is proportional to "length".) // // This test program is self-explanatory (there are diagnostics // output message of what each step is performing)and excercise // most of the MV_ColMat methods, thus providing examples of how // these are used. // #include #include #include "vecdefs.h" #include MATRIX_H // #include "systime.c" // example function to zero-out a matrix: illustrates how to pass // matrixes by "reference" (modifiable), as opposed to by "value" // void foo(MATRIX_int *Aptr) { MATRIX_int &A = *Aptr; A = (int) 0; // equivalent to "Aptr->operator=(0);" } // example funciton to return MV_ColMats: (returns matrix + scalar) // MATRIX_int fexample(const MATRIX_int A, int s) { int M = A.size(0); int N = A.size(1); MATRIX_int B(M,N); for (int j=0; j