23 #ifndef MATRIX_BY_BOXES_H 24 #define MATRIX_BY_BOXES_H 41 typedef typename box_matrix::size_type size_type;
42 typedef typename TBOX::value_type value_type;
43 typedef typename box_matrix::iterator iterator;
44 typedef typename box_matrix::const_iterator const_iterator;
48 MatrixByBoxes(size_type n_rows,size_type n_columns,
const TBOX &val);
50 MatrixByBoxes(
const std::vector<size_t> &,
const std::vector<size_t> &);
56 void Con(
const value_type &d);
87 for(
size_t i=1;i<=this->n_rows;i++)
88 for(
size_t j=1;j<=this->n_columns;j++)
89 (*
this)(i,j)=
m_double(dim[i-1],dim[j-1]);
98 :
box_matrix(dim_rows.size(),dim_columns.size())
100 for(
size_t i=1;i<=this->n_rows;i++)
101 for(
size_t j=1;j<=this->n_columns;j++)
102 (*
this)(i,j)=
m_double(dim_rows[i-1],dim_columns[j-1]);
106 template <
class TBOX>
111 template <
class TBOX>
114 box_matrix::operator=(m);
120 template <
class TBOX>
124 const size_t ncls= this->getNumberOfColumns();
125 for(
size_t j=1;j<=ncls;j++)
127 const size_t nrows_j= (*this)(iRow,j).getNumberOfRows();
128 if(nrows_j>retval) retval= nrows_j;
134 template <
class TBOX>
138 const size_t nrows= this->getNumberOfRows();
139 for(
size_t i=1;i<=nrows;i++)
141 const size_t ncls_i= (*this)(i,c).getNumberOfRows();
142 if(ncls_i>retval) retval= ncls_i;
148 template <
class TBOX>
151 const size_t nrows= this->getNumberOfRows();
152 std::vector<size_t> retval(nrows,0);
153 for(
size_t i=1;i<=nrows;i++)
158 template <
class TBOX>
161 const size_t ncls= this->getNumberOfColumns();
162 std::vector<size_t> retval(ncls,0);
163 for(
size_t j=1;j<=ncls;j++)
168 template <
class TBOX>
172 size_t tot_rows= dim_rows[0];
173 for(
size_t i=1;i<this->n_rows;i++)
174 tot_rows+= dim_rows[i];
178 template <
class TBOX>
182 size_t tot_n_columns= dim_columns[0];
183 for(
size_t j=1;j<=this->n_columns;j++)
184 tot_n_columns+= dim_columns[j];
185 return tot_n_columns;
189 template <
class TBOX>
192 for(iterator i= this->begin();i!=this->end();i++)
196 template <
class TBOX>
200 for(iterator i= this->begin();i!=this->end();i++)
205 template <
class TBOX>
216 template <
class TBOX>
222 for(
size_t i= 1;i<=this->getNumberOfRows();i++)
224 for(
size_t j= 1;j<=this->getNumberOfColumns();j++)
227 retval.putBox(f,c,box);
228 c+= box.getNumberOfColumns();
230 f+= box.getNumberOfRows();
236 template <
class TBOX>
243 template <
class TBOX>
246 size_type i,sz= this->size();
252 template <
class TBOX>
255 box_matrix::operator*=(m);
MatrixByBoxes(void)
Constructor.
Definition: matrix_by_boxes.h:67
MatrixByBoxes< TBOX > GetTrn(void) const
Return transposed.
Definition: matrix_by_boxes.h:206
Matrix which element type has estructura de anillo respecto a las operaciones + y *...
Definition: ZMatrix.h:37
std::vector< size_t > get_dim_columns(void) const
Return el number of rows of each column.
Definition: matrix_by_boxes.h:159
size_t getTotalNumberOfColumns(void) const
Return the sum of the columns of boxes.
Definition: matrix_by_boxes.h:179
Matrix made of boxes.
Definition: matrix_by_boxes.h:31
TBOX QuitaBloques(void)
Return the matrix that has the same number of boxes that this has blocks.
Definition: matrix_by_boxes.h:217
MatrixByBoxes & operator=(const MatrixByBoxes &m)
Assignment operator.
Definition: matrix_by_boxes.h:112
size_t get_rows_row(const size_t &f) const
Return el number of rows of the iRow-th row matrices.
Definition: matrix_by_boxes.h:121
size_t getTotalNumberOfRows(void) const
Return the sum of the rows of boxes.
Definition: matrix_by_boxes.h:169
void Con(const value_type &d)
Assigns the argument to all the boxes.
Definition: matrix_by_boxes.h:190
MatrixByBoxes< TBOX > & Trn(void)
Transpose the matrix.
Definition: matrix_by_boxes.h:197
size_t get_columns_column(const size_t f) const
Return el number of columns de las matrices de the column c.
Definition: matrix_by_boxes.h:135
std::vector< size_t > get_dim_rows(void) const
Return el number of rows of each row.
Definition: matrix_by_boxes.h:149
MatrixByBoxes< TBOX > & operator*=(const TBOX &m)
Operador *=.
Definition: matrix_by_boxes.h:237