44 template<typename P_numtype, typename P_structure>
47 template<typename P_expr>
75 Matrix(
int rows,
int cols, T_structure structure = T_structure())
76 : structure_(structure)
78 structure_.resize(rows, cols);
105 unsigned cols()
const
106 {
return structure_.columns(); }
108 unsigned columns()
const
109 {
return structure_.columns(); }
111 void makeUnique()
const;
113 unsigned numElements()
const
114 {
return structure_.numElements(); }
116 void reference(T_matrix&);
118 void resize(
unsigned rows,
unsigned cols)
120 structure_.resize(rows, cols);
126 unsigned rows()
const
127 {
return structure_.rows(); }
129 _bz_MatrixRef<T_numtype, T_structure> _bz_getRef()
const
130 {
return _bz_MatrixRef<T_numtype, T_structure>(*this); }
136 T_numtype operator()(
unsigned i,
unsigned j)
const
138 return structure_.get(data_, i, j);
143 return structure_.get(data_, i, j);
157 T_matrix& operator=(T_numtype);
158 T_matrix& operator+=(T_numtype);
159 T_matrix& operator-=(T_numtype);
160 T_matrix& operator*=(T_numtype);
161 T_matrix& operator/=(T_numtype);
165 template<
typename P_numtype2,
typename P_structure2>
167 template<
typename P_numtype2,
typename P_structure2>
169 template<
typename P_numtype2,
typename P_structure2>
171 template<
typename P_numtype2,
typename P_structure2>
173 template<
typename P_numtype2,
typename P_structure2>
177 template<
typename P_expr>
178 T_matrix& operator=(_bz_MatExpr<P_expr>);
187 T_matrix& operator++();
188 void operator++(
int);
189 T_matrix& operator--();
190 void operator--(
int);
196 template<
typename P_numtype,
typename P_structure>
197 ostream& operator<<(ostream& os, const Matrix<P_numtype, P_structure>& matrix);
210 #include <blitz/matrix.cc>
211 #include <blitz/matexpr.h>
213 #endif // BZ_MATRIX_H