#include <Symmat.hh>
Inheritance diagram for RazorBack::Symmat_:
Public Methods | |
Symmat_ (size_t S=3) | |
default ctor: 3x3 is the default size. | |
Symmat_ (const Symmat_< T_ > &Sm) | |
copy ctor. | |
Symmat_ (const T_ *Arr, size_t S) | |
init Symmat_ with a conventional array. More... | |
virtual | ~Symmat_ () |
destructor. | |
operator Rectmat_ () const | |
Symmat->Rectmat conversion. | |
Symmat_<T_>& | triangle (const Rectmat_< T_ > &Rect, bool Low=true) |
triangle(Rect, Low): copies the lower triangle of Rect to the calling object if Low is true (default) or the upper triangle if Low is false. More... | |
virtual size_t | rno () const |
rno(), cno(): return the number of rows and columns. | |
virtual size_t | cno () const |
virtual vector<T_>::const_iterator | operator[] (size_t Idx) const |
The C-style [] operator provides unchecked access. More... | |
virtual vector<T_>::iterator | operator[] (size_t Idx) |
const T_& | at (size_t Ridx, size_t Cidx) const |
at(Ridx, Cidx): does unchecked C indexing but Ridx and Cidx are swapped if Ridx<Cidx. | |
T_& | at (size_t Ridx, size_t Cidx) |
virtual const T_& | operator() (size_t Ridx, size_t Cidx) const |
The two-argument function call operator provides optional checked access when Check is true, and FORTRAN-style indexing when Ftnidx is true. More... | |
virtual T_& | operator() (size_t Ridx, size_t Cidx) |
void | size (size_t S) |
size(S): changes the size of the calling object to S x S. More... | |
virtual Vector_<T_> | row (size_t Idx) const |
row(Idx): returns the Idx-th row as a Vector_ object safely. More... | |
virtual void | row (const Vector_< T_ > &Vec, size_t Idx) |
virtual Vector_<T_> | col (size_t Idx) const |
virtual void | col (const Vector_< T_ > &Vec, size_t Idx) |
Symmat_<T_> | operator * (const T_ &Factor) const |
Simple scalar operations. | |
Symmat_<T_> | operator/ (const T_ &Div) const |
Symmat_<T_>& | operator+= (const Symmat_< T_ > &Mat) |
Matrix addition and subtraction. More... | |
Symmat_<T_> | operator+ (const Symmat_< T_ > &Mat) const |
Rectmat_<T_> | operator+ (const Rectmat_< T_ > &Mat) const |
Symmat_<T_>& | operator-= (const Symmat_< T_ > &Mat) |
Symmat_<T_> | operator- (const Symmat_< T_ > &Mat) const |
Rectmat_<T_> | operator * (const Symmat_< T_ > &Mat) const |
Matrix*matrix and matrix*vector multiplication. More... | |
Rectmat_<T_> | operator * (const Rectmat_< T_ > &Mat) const |
Vector_<T_> | operator * (const Vector_< T_ > &Vec) const |
virtual Vector_<T_> | diag () const |
diag(): copies the diagonal into a Vector_ object. More... | |
virtual void | diag (const Vector_< T_ > &Vec) |
virtual void | diag_matrix (const T_ &Dval) |
diag_matrix(Dval): turns the calling object into a diagonal matrix with the value Dval in all diagonal positions. | |
virtual T_ | trace () const |
trace(): returns the sum of the diagonal elements. | |
virtual void | read_matrix (istream &In) |
I/O. | |
Protected Methods | |
void | print_rows (ostream &Out, size_t Rw, size_t Jbeg, size_t Items, size_t Width, size_t Prec) const |
hidden methods. | |
Static Protected Methods | |
unsigned int | tri_size (unsigned int X) |
Private Attributes | |
size_t | Size |
Derived from Basemat_.
Definition at line 39 of file Symmat.hh.
|
default ctor: 3x3 is the default size.
|
|
copy ctor.
|
|
init Symmat_ with a conventional array. It is supposed to have the "triangular" row-major layout. No checks |
|
destructor.
|
|
Symmat->Rectmat conversion.
|
|
triangle(Rect, Low): copies the lower triangle of Rect to the calling object if Low is true (default) or the upper triangle if Low is false. Rectmat must be square, otherwise Squarexc_ is thrown. The calling object is resized silently. Returns reference to calling object. |
|
rno(), cno(): return the number of rows and columns.
Reimplemented from RazorBack::Basemat_. |
|
Reimplemented from RazorBack::Basemat_. |
|
The C-style [] operator provides unchecked access. It is assumed (but NOT TESTED) that when writing Sym[i][j], the condition i>=j is true. You have been warned. Reimplemented from RazorBack::Basemat_. |
|
Reimplemented from RazorBack::Basemat_. |
|
at(Ridx, Cidx): does unchecked C indexing but Ridx and Cidx are swapped if Ridx<Cidx.
|
|
|
|
The two-argument function call operator provides optional checked access when Check is true, and FORTRAN-style indexing when Ftnidx is true. Indices are always swapped silently so that Sym(i,j) is Sym[j][i] when i<j. Throws Indexrangexc_ on error. Reimplemented from RazorBack::Basemat_. |
|
Reimplemented from RazorBack::Basemat_. |
|
size(S): changes the size of the calling object to S x S. Nothing is done if the size parameter is the same as the current size or if it is 0. When the matrix "shrinks", then the upper left corner is preserved, when it grows, then the new rows and columns are padded with "zeroes" T_(0). |
|
row(Idx): returns the Idx-th row as a Vector_ object safely. row(Vec,Idx): sets the elements in the Idx-th row to the elements of the vector Vec, provided Idx is legal and Vec has the right number of elements. col(Idx) and col(Vec,Idx) do exactly the same (symmetry!). Reimplemented from RazorBack::Basemat_. Referenced by col(). |
|
Reimplemented from RazorBack::Basemat_. |
|
Reimplemented from RazorBack::Basemat_. |
|
Reimplemented from RazorBack::Basemat_. |
|
Simple scalar operations.
|
|
|
|
Matrix addition and subtraction. Dimexc_ is thrown on dimension mismatches. |
|
|
|
|
|
|
|
|
|
Matrix*matrix and matrix*vector multiplication. Mixed Symmat/Rectmat operators are provided to avoid conversions. Dimexc_ is thrown on dimension mismatches. |
|
|
|
|
|
diag(): copies the diagonal into a Vector_ object. diag(Vec): sets the diagonal to the values in the Vector_ object Vec. If the dimensions don't match, a Dimexc_ exception is thrown. Reimplemented from RazorBack::Basemat_. |
|
Reimplemented from RazorBack::Basemat_. |
|
diag_matrix(Dval): turns the calling object into a diagonal matrix with the value Dval in all diagonal positions.
Reimplemented from RazorBack::Basemat_. |
|
trace(): returns the sum of the diagonal elements.
Reimplemented from RazorBack::Basemat_. |
|
I/O.
Reimplemented from RazorBack::Basemat_. |
|
hidden methods.
Reimplemented from RazorBack::Basemat_. |
|
Definition at line 217 of file Symmat.hh. Referenced by Symmat_(), at(), and operator[](). |
|
|