21 #ifndef GSLPP_MATRIX_HH
22 #define GSLPP_MATRIX_HH
26 #include <gsl/gsl_matrix.h>
38 m_current(begin ? m->data : m->data + m->size1 * m->tda),
40 m_row_jump(m->tda - m->size2)
66 if (m_current_column == m_matrix->size2) {
67 m_current += m_row_jump;
87 size_t m_current_column;
100 m_current(begin ? m->data : m->data + m->size1 * m->tda),
102 m_row_jump(m->tda - m->size2)
107 m_matrix(other.m_matrix),
108 m_current(other.m_current),
109 m_current_column(other.m_current_column),
110 m_row_jump(other.m_row_jump)
136 if (m_current_column == m_matrix->size2) {
137 m_current += m_row_jump;
138 m_current_column = 0;
154 const gsl_matrix *m_matrix;
155 const double *m_current;
156 size_t m_current_column;
185 Matrix(
size_t rows,
size_t columns,
bool clean);
193 Matrix(
size_t rows,
size_t columns,
double init);
202 Matrix(
size_t rows,
size_t columns,
const double *init);
226 Matrix(
const gsl_matrix *m);
232 Matrix transposed()
const;
252 void reset(
size_t rows,
size_t columns,
bool clean);
260 void reset(
size_t rows,
size_t columns,
double init);
281 void set(
size_t i,
size_t j,
double x);
290 double operator ()(
size_t i,
size_t j)
const;
295 operator gsl_matrix *();
300 operator const gsl_matrix *()
const;
306 Matrix column_covariance()
const;
312 Matrix row_covariance()
const;
348 void set_row(
int r,
const Vector& row);
370 void set_column(
int c,
const Vector& col);
393 double dot_row(
int r,
const Vector& v)
const;
403 double dot_column(
int c,
const Vector& col)
const;
409 void print(std::ostream& os)
const;
418 gsl_matrix_sub(*
this, rhs);
429 gsl_matrix_add(*
this, rhs);
440 gsl_matrix_scale(*
this, rhs);
444 bool is_valid()
const;
446 bool is_writable()
const;
449 gsl_matrix *m_matrix;
450 const gsl_matrix *m_const_matrix;
488 class iterator_traits<
gsl::const_matrix_iterator >
499 class iterator_traits<
gsl::matrix_iterator >