lib_ex_pour_HZpp/Partie_2/algebre_lineaire/sparselib++/sp1_5c/mv/include/mvmtp.h

1 line
12 KiB
C
Raw Normal View History

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ /* */ /* */ /* 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. */ /* */ /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ // // mvmtp.h : basic templated numerical matrix class, storage // by columns (Fortran oriented.) // // // #ifndef _MV_MATRIX_H_ #define _MV_MATRIX_H_ #include "mvvtp.h" struct Matrix_ { enum ref_type { ref = 1 }; }; #include <iostream.h> // for formatted printing of matrices #ifdef MV_MATRIX_BOUNDS_CHECK # include <assert.h> #endif template <class TYPE> class MV_ColMat { private: MV_Vector<TYPE> v_; int dim0_; // perferred to using dim_[2]. some compilers int dim1_; // refuse to initalize these in the constructor. int lda_; int ref_; // true if this is declared as a reference vector, // i.e. it does not own the memory space, but // rather it is a view to another vector or array. public: /*::::::::::::::::::::::::::*/ /* Constructors/Destructors */ /*::::::::::::::::::::::::::*/ MV_ColMat(); MV_ColMat(unsigned int, unsigned int); // some compilers have difficulty with inlined 'for' statements. MV_ColMat(unsigned int, unsigned int, const TYPE&); // usual copy by value // (can't use default parameter lda=m, because m is not a constant...) // MV_ColMat(TYPE*, unsigned int m, unsigned int n); MV_ColMat(TYPE*, unsigned int m, unsigned int n, unsigned int lda); // the "reference" versions // // MV_ColMat(TYPE*, unsigned int m, unsigned int n, Matrix_::ref_type i); MV_ColMat(TYPE*, unsigned int m, unsigned int n, unsigned int lda, Matrix_::ref_type i); MV_ColMat(const MV_ColMat<TYPE>&); ~MV_ColMat(); /*::::::::::::::::::::::::::::::::*/