#include <Matrix.h>
Collaboration diagram for mathglpp::Matrix2< T >:
Definition at line 35 of file Matrix.h.
Public Types | |
typedef size_t | dim_type |
Use size_t to conform with STL. | |
typedef T | value_type |
typedef std::valarray< value_type > | vector_type |
typedef std::slice_array< value_type > | sliced_vector_type |
Public Member Functions | |
Matrix2 (const dim_type &m, const dim_type &n) | |
Create a square Matrix. | |
Matrix2 (const Matrix2 &mat) | |
Copy constructor. | |
~Matrix2 () | |
Default destructor. | |
Matrix2 & | operator= (const Matrix2 &rhs) |
Default assignment. | |
Matrix2 & | identity () |
Matrix2 | filter (T(*filter_func)(const Matrix2 &, const dim_type, const dim_type)) |
value_type & | operator() (const dim_type i, const dim_type j) |
Fortran style element access. | |
const value_type & | operator() (const dim_type i, const dim_type j) const |
Fortran style element access. | |
value_type & | operator[] (const dim_type ind) |
C/C++ style element access. | |
const value_type & | operator[] (const dim_type ind) const |
C/C++ style element access. | |
const sliced_vector_type & | operator[] (const std::slice &sl) |
C/C++ style element slice access. | |
const sliced_vector_type & | row (dim_type rn, dim_type cstart=0) |
const sliced_vector_type & | row (dim_type rn, dim_type cstart, dim_type cend) |
const sliced_vector_type & | col (dim_type cn, dim_type rstart=0) |
const sliced_vector_type & | col (dim_type cn, dim_type rstart, dim_type rend) |
const std::slice | row_slice (dim_type rn, dim_type cstart=0) const |
Row slice. | |
const std::slice | row_slice (dim_type rn, dim_type cstart, dim_type cend) const |
Row slice, bounded. | |
const std::slice | col_slice (dim_type cn, dim_type rstart=0) const |
Column slice. | |
const std::slice | col_slice (dim_type cn, dim_type rstart, dim_type rend) const |
Column slice, bounded. | |
const dim_type & | getM () const |
Get the dimensions. | |
const dim_type & | getN () const |
const dim_type & | size () const |
operator vector_type & () | |
Return the vector. | |
operator const vector_type & () const | |
operator const value_type * () const | |
Protected Attributes | |
dim_type | rows |
dimensions | |
dim_type | cols |
vector_type | vec |
The actual row major vector of values. |
typedef size_t mathglpp::Matrix2< T >::dim_type |
mathglpp::Matrix2< T >::Matrix2 | ( | const dim_type & | m, | |
const dim_type & | n | |||
) | [inline] |
mathglpp::Matrix2< T >::Matrix2 | ( | const Matrix2< T > & | mat | ) | [inline] |
mathglpp::Matrix2< T >::~Matrix2 | ( | ) | [inline] |
Matrix2& mathglpp::Matrix2< T >::operator= | ( | const Matrix2< T > & | rhs | ) | [inline] |
Default assignment.
Definition at line 60 of file Matrix.h.
References mathglpp::Matrix2< T >::cols, mathglpp::Matrix2< T >::rows, and mathglpp::Matrix2< T >::vec.
00061 { 00062 if(&rhs != this) 00063 { rows = rhs.rows; cols = rhs.cols; vec = rhs.vec; } 00064 return *this; 00065 }
value_type& mathglpp::Matrix2< T >::operator() | ( | const dim_type | i, | |
const dim_type | j | |||
) | [inline] |
Fortran style element access.
Definition at line 83 of file Matrix.h.
References mathglpp::Matrix2< T >::cols, and mathglpp::Matrix2< T >::vec.
const value_type& mathglpp::Matrix2< T >::operator() | ( | const dim_type | i, | |
const dim_type | j | |||
) | const [inline] |
Fortran style element access.
Definition at line 85 of file Matrix.h.
References mathglpp::Matrix2< T >::cols, and mathglpp::Matrix2< T >::vec.
value_type& mathglpp::Matrix2< T >::operator[] | ( | const dim_type | ind | ) | [inline] |
C/C++ style element access.
Definition at line 87 of file Matrix.h.
References mathglpp::Matrix2< T >::vec.
00087 { return vec[ind]; }
const value_type& mathglpp::Matrix2< T >::operator[] | ( | const dim_type | ind | ) | const [inline] |
C/C++ style element access.
Definition at line 89 of file Matrix.h.
References mathglpp::Matrix2< T >::vec.
00089 { return vec[ind]; }
const sliced_vector_type& mathglpp::Matrix2< T >::operator[] | ( | const std::slice & | sl | ) | [inline] |
C/C++ style element slice access.
Definition at line 91 of file Matrix.h.
References mathglpp::Matrix2< T >::vec.
00091 { return vec[sl]; }
const std::slice mathglpp::Matrix2< T >::row_slice | ( | dim_type | rn, | |
dim_type | cstart = 0 | |||
) | const [inline] |
Row slice.
Definition at line 103 of file Matrix.h.
References mathglpp::Matrix2< T >::cols.
Referenced by mathglpp::Matrix2< T >::row().
00104 { return std::slice(cstart+rn*cols,cols-cstart,1); }
const std::slice mathglpp::Matrix2< T >::row_slice | ( | dim_type | rn, | |
dim_type | cstart, | |||
dim_type | cend | |||
) | const [inline] |
Row slice, bounded.
Definition at line 106 of file Matrix.h.
References mathglpp::Matrix2< T >::cols.
00107 { return std::slice(cstart+rn*cols,cend-cstart,1); }
const std::slice mathglpp::Matrix2< T >::col_slice | ( | dim_type | cn, | |
dim_type | rstart = 0 | |||
) | const [inline] |
Column slice.
Definition at line 110 of file Matrix.h.
References mathglpp::Matrix2< T >::cols, and mathglpp::Matrix2< T >::rows.
Referenced by mathglpp::Matrix2< T >::col().
const std::slice mathglpp::Matrix2< T >::col_slice | ( | dim_type | cn, | |
dim_type | rstart, | |||
dim_type | rend | |||
) | const [inline] |
Column slice, bounded.
Definition at line 113 of file Matrix.h.
References mathglpp::Matrix2< T >::cols.
00114 { return std::slice(cn+rstart*cols,rend-rstart,cols); }
const dim_type& mathglpp::Matrix2< T >::getM | ( | ) | const [inline] |
Get the dimensions.
Definition at line 117 of file Matrix.h.
References mathglpp::Matrix2< T >::rows.
00117 { return rows; }
mathglpp::Matrix2< T >::operator vector_type & | ( | ) | [inline] |
Return the vector.
Definition at line 122 of file Matrix.h.
References mathglpp::Matrix2< T >::vec.
00122 { return vec; }
dim_type mathglpp::Matrix2< T >::rows [protected] |
dimensions
Definition at line 156 of file Matrix.h.
Referenced by mathglpp::Matrix2< T >::col_slice(), mathglpp::Matrix2< T >::filter(), mathglpp::Matrix2< T >::getM(), mathglpp::Matrix2< T >::identity(), and mathglpp::Matrix2< T >::operator=().
vector_type mathglpp::Matrix2< T >::vec [protected] |
The actual row major vector of values.
Definition at line 158 of file Matrix.h.
Referenced by mathglpp::Matrix2< T >::col(), mathglpp::Matrix2< T >::identity(), mathglpp::Matrix2< T >::operator const value_type *(), mathglpp::Matrix2< T >::operator const vector_type &(), mathglpp::Matrix2< T >::operator vector_type &(), mathglpp::Matrix2< T >::operator()(), mathglpp::Matrix2< T >::operator=(), mathglpp::Matrix2< T >::operator[](), mathglpp::Matrix2< T >::row(), and mathglpp::Matrix2< T >::size().