2 full-storage.hh -- declare Full_storage
4 source file of the Flower Library
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #ifndef FULL_STORAGE_HH
11 #define FULL_STORAGE_HH
16 /// simplest matrix storage. refer to its baseclass for the doco.
31 bool valid (int i, int j) const ;
33 void resize_rows (int);
34 void resize_cols (int);
51 /** set the size. contents lost.
55 void set_size (int rows, int cols) ;
58 /**set the size to square dimen. contents lost
62 void set_size (int i) ;
65 keep contents. If enlarged contents unspecified
71 void resize (int rows, int cols);
74 set the size to square dimen. contents kept
75 Keep contents. If enlarged contents are unspecified
86 Generate an errormessage, if this happens
87 in the 0-part of a sparse matrix.
90 Real& elem (int i,int j);
92 /// access a element, no modify
93 Real elem (int i, int j) const;
95 Array<Real> row (int i) const ;
96 Array<Real> column (int j) const;
100 add a row to the matrix before row k. Contents
101 of added row are unspecified
105 void insert_row (int k);
109 delete a row from this matrix.
114 void delete_row (int k);
115 void delete_column (int k);
120 at end of matrix?. when doing loop
127 bool mult_ok (int i, int j) const;
130 walk through matrix (regular multiply).
131 get next j for row i, or get next row i and reset j.
132 this will make sparse matrix implementation easy.
137 void mult_next (int &i, int &j) const;
140 valid matrix entry. return false if at end of row
142 bool trans_ok (int i, int j) const;
145 walk through matrix (transposed multiply).
146 Get next i (for column j)
152 void trans_next (int &i, int &j) const;
155 Full_storage (int i, int j);
156 Full_storage (Full_storage const&);
157 Full_storage (int i);
158 void operator=(Full_storage const &);
165 #define INLINE inline
168 #include "full-storage.icc"
171 #endif // FULL_STORAGE_HH