2 full-storage.hh -- declare Full_storage
4 source file of the Flower Library
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
10 #ifndef FULL_STORAGE_HH
11 #define FULL_STORAGE_HH
20 /// simplest matrix storage. refer to its baseclass for the doco.
35 INLINE bool valid (int i, int j) const ;
37 void resize_rows (int);
38 void resize_cols (int);
47 INLINE int rows() const;
50 INLINE int cols() const;
53 INLINE int dim() const;
55 /** set the size. contents lost.
59 void set_size (int rows, int cols) ;
62 /**set the size to square dimen. contents lost
66 void set_size (int i) ;
69 keep contents. If enlarged contents unspecified
75 void resize (int rows, int cols);
78 set the size to square dimen. contents kept
79 Keep contents. If enlarged contents are unspecified
90 Generate an errormessage, if this happens
91 in the 0-part of a sparse matrix.
94 INLINE Real& elem (int i,int j);
96 /// access a element, no modify
97 INLINE Real elem (int i, int j) const;
99 Array<Real> row (int i) const ;
100 Array<Real> column (int j) const;
104 add a row to the matrix before row k. Contents
105 of added row are unspecified
109 void insert_row (int k);
113 delete a row from this matrix.
118 void delete_row (int k);
119 void delete_column (int k);
124 at end of matrix?. when doing loop
131 INLINE bool mult_ok (int i, int j) const;
134 walk through matrix (regular multiply).
135 get next j for row i, or get next row i and reset j.
136 this will make sparse matrix implementation easy.
141 INLINE void mult_next (int &i, int &j) const;
144 valid matrix entry. return false if at end of row
146 INLINE bool trans_ok (int i, int j) const;
149 walk through matrix (transposed multiply).
150 Get next i (for column j)
156 INLINE void trans_next (int &i, int &j) const;
158 INLINE Full_storage();
159 INLINE Full_storage (int i, int j);
160 INLINE Full_storage (Full_storage const&);
161 INLINE Full_storage (int i);
162 void operator=(Full_storage const &);
168 #include "full-storage.icc"
171 #endif // FULL_STORAGE_HH