#include <Basemat.hh>
Inheritance diagram for RazorBack::Basemat_:
Public Methods | |
Basemat_ () | |
default ctor: proper setup is done in derived classes. | |
virtual | ~Basemat_ () |
destructor. | |
virtual size_t | rno () const=0 |
rno(), cno(): return the number of rows and columns. More... | |
virtual size_t | cno () const=0 |
virtual vector<T_>::const_iterator | operator[] (size_t Idx) const=0 |
The C-style [] operator provides unchecked access. More... | |
virtual vector<T_>::iterator | operator[] (size_t Idx)=0 |
virtual const T_& | operator() (size_t Ridx, size_t Cidx) const=0 |
virtual T_& | operator() (size_t Ridx, size_t Cidx)=0 |
virtual Vector_<T_> | row (size_t Idx) const=0 |
row(), col(): read or write the Idx:th row or column as a Vector_<T_> object. More... | |
virtual void | row (const Vector_< T_ > &Vec, size_t Idx)=0 |
virtual Vector_<T_> | col (size_t Idx) const=0 |
virtual void | col (const Vector_< T_ > &Vec, size_t Idx)=0 |
Basemat_<T_>& | set_values (const T_ &X=T_(0)) |
set_values(): sets all elements to X (0 by default). | |
bool | ftn_idx () const |
ftn_idx(): returns true if FORTRAN indexing is used, false otherwise. More... | |
bool | ftn_idx (bool Fi) |
bool | range_check () const |
range_check(): returns true if range checking is enabled in operator(). More... | |
bool | range_check (bool Ci) |
Basemat_<T_>& | operator *= (const T_ &Factor) |
simple arithmetics Multiplication and division by a "scalar" (*=, /=). More... | |
Basemat_<T_>& | operator/= (const T_ &Div) |
virtual Vector_<T_> | diag () const=0 |
diag(): copies the diagonal into a Vector_ object. More... | |
virtual void | diag (const Vector_< T_ > &Vec)=0 |
virtual void | diag_matrix (const T_ &Dval)=0 |
diag_matrix(Dval): turns the calling object into a diagonal matrix with the value Dval in all diagonal positions. | |
virtual T_ | trace () const=0 |
trace(): returns the sum of the diagonal elements. | |
void | transform (unary_function< T_, T_ > Unaryfunc) |
transform(): this method allows the modification of each element of the calling matrix object "in place" using the STL function object Unaryfunc. More... | |
virtual void | read_matrix (istream &In)=0 |
read_matrix(In): reads a matrix from the stream In. More... | |
virtual void | list_matrix (ostream &Out, unsigned int Prec=6, unsigned int Width=13, unsigned int Linewidth=80) const |
Lists the calling object to the stream Out. More... | |
Protected Methods | |
const vector<T_>& | elems () const |
vector<T_>& | elems () |
const T_& | elems (size_t Idx) const |
T_& | elems (size_t Idx) |
size_t | eno () const |
size_t | eno (size_t E) |
virtual void | print_rows (ostream &Out, size_t Rw, size_t Jbeg, size_t Items, size_t Width, size_t Prec) const=0 |
Private Attributes | |
bool | Ftnidx |
bool | Check |
Static Private Methods | |
size_t | prt_width (int N) |
Serves as an abstract base class for other matrix classes. Copy-on-write is inherited from the Refstorage_ template.
Definition at line 102 of file Basemat.hh.
|
default ctor: proper setup is done in derived classes.
Definition at line 113 of file Basemat.hh. |
|
destructor.
Definition at line 116 of file Basemat.hh. |
|
rno(), cno(): return the number of rows and columns. Pure virtual at this stage (layout-dependent). Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
The C-style [] operator provides unchecked access. The two-argument function call operator provides optional checked access when Check is true, and FORTRAN-style indexing when Ftnidx is true. These are pure virtual as they depend on the matrix layout. Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
row(), col(): read or write the Idx:th row or column as a Vector_<T_> object. Pure virtual: depends on layout. Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
set_values(): sets all elements to X (0 by default).
Definition at line 149 of file Basemat.hh. |
|
ftn_idx(): returns true if FORTRAN indexing is used, false otherwise. ftn_idx(Fi): sets the FORTRAN indexing to Fi, returns old value. The Ftnidx status is ignored when [] indexing is used. Definition at line 161 of file Basemat.hh. |
|
Definition at line 162 of file Basemat.hh. |
|
range_check(): returns true if range checking is enabled in operator(). range_check(Ci): sets the range_check status, returns old value. Range checking is ignored when [] indexing is used. Definition at line 169 of file Basemat.hh. |
|
Definition at line 170 of file Basemat.hh. |
|
simple arithmetics Multiplication and division by a "scalar" (*=, /=). Consider Mat*=(1.0/X) instead of Mat/=X if X is floating-point. |
|
|
|
diag(): copies the diagonal into a Vector_ object. diag(Vec): sets the diagonal to the values in the Vector_ object Vec. Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
diag_matrix(Dval): turns the calling object into a diagonal matrix with the value Dval in all diagonal positions.
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
trace(): returns the sum of the diagonal elements.
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
transform(): this method allows the modification of each element of the calling matrix object "in place" using the STL function object Unaryfunc. Could be used for things like taking the square root of each matrix element. Definition at line 204 of file Basemat.hh. |
|
read_matrix(In): reads a matrix from the stream In. The appropriate version will be invoked by the overloaded >> method in each derived class. Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Lists the calling object to the stream Out. The parameters provide formatting facilities, normally you would just use the overloaded << method that invokes list_matrix() with the default parameters. |
|
Definition at line 235 of file Basemat.hh. Referenced by RazorBack::Rectmat_::Rectmat_(), RazorBack::Symmat_::at(), RazorBack::Symmat_::operator[](), RazorBack::Rectmat_::operator[](), set_values(), and transform(). |
|
Definition at line 236 of file Basemat.hh. |
|
Definition at line 237 of file Basemat.hh. |
|
Definition at line 238 of file Basemat.hh. |
|
Definition at line 239 of file Basemat.hh. |
|
Definition at line 240 of file Basemat.hh. |
|
Reimplemented in RazorBack::Rectmat_, and RazorBack::Symmat_. |
|
Definition at line 246 of file Basemat.hh. |
|
Definition at line 106 of file Basemat.hh. |
|
Definition at line 107 of file Basemat.hh. |