Changeset 914 in Sophya for trunk/SophyaLib/TArray/triangmtx.h
- Timestamp:
- Apr 13, 2000, 6:04:50 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/triangmtx.h
r862 r914 1 1 // This may look like C code, but it is really -*- C++ -*- 2 /*! Class for inferior triangular matrix (base class for the class Alm) */3 2 4 3 #ifndef TRIANGMTX_H_SEEN … … 10 9 namespace SOPHYA { 11 10 11 //! Class for inferior triangular matrix (base class for the class Alm) 12 12 template <class T> 13 class TriangularMatrix 14 { 15 16 public : 13 class TriangularMatrix { 14 public : 17 15 16 //! Default constructor 18 17 TriangularMatrix() {}; 19 /* instanciate a triangular matrix from the number of rows */ 18 //! instanciate a triangular matrix from the number of rows 20 19 TriangularMatrix(int rowSize) : long_diag_((uint_4)rowSize) {elem_.ReSize((uint_4) (rowSize*(rowSize+1)/2) ); }; 20 //! Copy constructor (possibility of sharing datas) 21 21 TriangularMatrix(const TriangularMatrix<T>& a, bool share=false) : elem_(a.elem_, share), long_diag_(a.long_diag_) {;} 22 /*! resize the matrix with a new number of rows */ 22 23 //! resize the matrix with a new number of rows 23 24 inline void ReSizeRow(int rowSize) 24 25 { … … 28 29 inline void SetTemp(bool temp=false) const {elem_.SetTemp(temp);} 29 30 31 //! Equal operator 30 32 inline TriangularMatrix<T>& operator = (const TriangularMatrix<T>& a) 31 33 { … … 34 36 return *this; 35 37 } 38 39 //! () operator : access to elements row \b l and column \b m 36 40 inline T& operator()(int l, int m) 37 41 { 38 42 return elem_(adr_ij(l,m)); 39 43 } 44 //! () operator : access to elements row \b l and column \b m 40 45 inline T const& operator()(int l, int m) const 41 46 { 42 47 return *(elem_.Begin()+ adr_ij(l,m)); 43 48 } 44 inline int_4 rowNumber() const {return (int_4)long_diag_;} 45 private: 46 /*! compute the address of an element in the single array representing the matrix */ 49 50 //! Return number of rows 51 inline int_4 rowNumber() const {return (int_4)long_diag_;} 52 53 private: 54 //! compute the address of an element in the single array representing the matrix 47 55 inline uint_4 adr_ij(int i,int j) const 48 56 { … … 56 64 } 57 65 58 uint_4 long_diag_; 59 NDataBlock<T> elem_; 66 uint_4 long_diag_; //!< size of the square matrix 67 NDataBlock<T> elem_; //!< Data block 60 68 61 69 };
Note:
See TracChangeset
for help on using the changeset viewer.