|
STK++ 1.0
|
Derivation of the MatrixSquare class for square arrays of Real. More...
#include <STK_MatrixSquare.h>

Public Member Functions | |
| MatrixSquare (Range const &I=Range()) | |
| Default constructor with rangeHo_=(1:0) and rangeVe_=(1:0). | |
| MatrixSquare (Range const &I, Real const &v) | |
| constructor with rangeHo_and rangeVe_ givens, initialization with a constant. | |
| MatrixSquare (const MatrixSquare &T, bool ref=false) | |
| Copy constructor. | |
| MatrixSquare (const Matrix &T, Range const &I) | |
| constructor by reference, ref_=1 in the range given by I. | |
| virtual | ~MatrixSquare () |
| destructor. | |
| Range const & | range () const |
| get range of the Matrix. | |
| Integer const & | first () const |
| get the first index of the Matrix. | |
| Integer const & | last () const |
| get the last index of the Matrix. | |
| MatrixSquare | get2D (Range const &I) const |
| access to a square sub-array. | |
| void | shift (Integer beg) |
| New beginning index for the object. | |
| void | resize (Range const &I=Range()) |
| New size for the container. | |
| void | insert (Integer const &pos, Integer const &n=1) |
| Insert n rows and column at the given position to the container. | |
| void | erase (Integer const &pos, Integer const &n=1) |
| Delete n rows and columns at the specified position to the container. | |
| void | pushBack (Integer n=1) |
| Add n rows and columns to the container. | |
| void | popBack (Integer const &n=1) |
| Delete n rows and columns at the end of the container. | |
| MatrixSquare & | operator= (const MatrixSquare &T) |
| operator = : overwrite the MatrixSquare with T. | |
| MatrixSquare & | operator= (Real const &v) |
| operator= : set the container to a constant value. | |
| template<class TContainer2D > | |
| MatrixSquare & | operator= (const IArray2D< Real, TContainer2D > &T) |
| operator = overwriting a MatrixSquare with a container. | |
Private Member Functions | |
| void | resize (Range const &I, Range const &J) |
| Resize the container. | |
| void | shift (Integer rbeg, Integer cbeg) |
| overloading of the shift method. | |
Derivation of the MatrixSquare class for square arrays of Real.
A MatrixSquare is a column oriented two dimensional container of Real with the same number of rows and columns.
The range of the rows and the columns is the same.
Definition at line 52 of file STK_MatrixSquare.h.
Default constructor with rangeHo_=(1:0) and rangeVe_=(1:0).
| I | range of the Rows and Cols |
Definition at line 43 of file STK_MatrixSquare.cpp.
Referenced by get2D().
: Matrix(I, I) { ;}
constructor with rangeHo_and rangeVe_ givens, initialization with a constant.
| I | range of the Rows and Cols |
| v | initial value of the container |
Definition at line 52 of file STK_MatrixSquare.cpp.
: Matrix(I, I, v) { ;}
| STK::MatrixSquare::MatrixSquare | ( | const MatrixSquare & | T, |
| bool | ref = false |
||
| ) |
Copy constructor.
| T | the container to copy |
| ref | true if T is wrapped |
Definition at line 60 of file STK_MatrixSquare.cpp.
constructor by reference, ref_=1 in the range given by I.
| T | the Container to wrap |
| I | range of the container to wrap |
Definition at line 65 of file STK_MatrixSquare.cpp.
| STK::MatrixSquare::~MatrixSquare | ( | ) | [virtual] |
| Range const& STK::MatrixSquare::range | ( | ) | const [inline] |
get range of the Matrix.
Definition at line 85 of file STK_MatrixSquare.h.
References STK::IContainer2D::rangeVe().
Referenced by STK::EigenvaluesSymmetric::ginv(), STK::mult(), STK::multLeftTranspose(), STK::EigenvaluesSymmetric::run(), and STK::Law::MultivariateNormal< Container1D >::update().
{ return rangeVe();}
| Integer const& STK::MatrixSquare::first | ( | ) | const [inline] |
get the first index of the Matrix.
Definition at line 91 of file STK_MatrixSquare.h.
References STK::IContainer2D::firstCol().
Referenced by STK::mult(), STK::multLeftTranspose(), and STK::EigenvaluesSymmetric::run().
{ return firstCol();}
| Integer const& STK::MatrixSquare::last | ( | ) | const [inline] |
get the last index of the Matrix.
Definition at line 97 of file STK_MatrixSquare.h.
References STK::IContainer2D::lastCol().
Referenced by STK::mult(), STK::multLeftTranspose(), and STK::EigenvaluesSymmetric::run().
{ return lastCol();}
| MatrixSquare STK::MatrixSquare::get2D | ( | Range const & | I | ) | const [inline] |
access to a square sub-array.
| I | range of the data to wrap |
Definition at line 103 of file STK_MatrixSquare.h.
References MatrixSquare().
{ return MatrixSquare(*this, I);}
| void STK::MatrixSquare::shift | ( | Integer | beg | ) | [inline] |
New beginning index for the object.
| beg | first index of the container |
Definition at line 109 of file STK_MatrixSquare.h.
Referenced by shift().
{ Matrix::shift(beg, beg);}
New size for the container.
| I | range of the columns and rows of the container |
Definition at line 115 of file STK_MatrixSquare.h.
Referenced by STK::GaussianStatModel::compCovariance(), STK::Svd::compSvd(), STK::GaussianStatModel::compWeightedCovariance(), STK::EigenvaluesSymmetric::ginv(), resize(), and STK::Law::MultivariateNormal< Container1D >::update().
{ Matrix::resize(I, I);}
Insert n rows and column at the given position to the container.
| pos | position to insert the Rows and Cols |
| n | number of Rows and Cols insert |
Definition at line 122 of file STK_MatrixSquare.h.
References STK::IArray2D< Real, Array2D< Real > >::insertCols(), and STK::IArray2D< Real, Array2D< Real > >::insertRows().
{
Matrix::insertRows(pos, n);
Matrix::insertCols(pos, n);
}
Delete n rows and columns at the specified position to the container.
| pos | position to erase the Rows and Cols |
| n | number of Rows and Cols erase |
Definition at line 133 of file STK_MatrixSquare.h.
References STK::IArray2D< Real, Array2D< Real > >::eraseCols(), and STK::IArray2D< Real, Array2D< Real > >::eraseRows().
{
Matrix::eraseCols(pos, n);
Matrix::eraseRows(pos, n);
}
| void STK::MatrixSquare::pushBack | ( | Integer | n = 1 | ) | [inline] |
Add n rows and columns to the container.
| n | number of Rows and Cols to add |
Definition at line 142 of file STK_MatrixSquare.h.
References STK::IArray2D< Real, Array2D< Real > >::pushBackCols(), and STK::IArray2D< Real, Array2D< Real > >::pushBackRows().
{
Matrix::pushBackRows(n);
Matrix::pushBackCols(n);
}
| void STK::MatrixSquare::popBack | ( | Integer const & | n = 1 | ) | [inline] |
Delete n rows and columns at the end of the container.
| n | number of Rows and Cols to delete |
Definition at line 151 of file STK_MatrixSquare.h.
References STK::IArray2D< Real, Array2D< Real > >::popBackCols(), and STK::IArray2D< Real, Array2D< Real > >::popBackRows().
{
Matrix::popBackCols(n);
Matrix::popBackRows(n);
}
| MatrixSquare& STK::MatrixSquare::operator= | ( | const MatrixSquare & | T | ) | [inline] |
operator = : overwrite the MatrixSquare with T.
We resize the object if this and T does not have the same size but if they have the same size, we don't modify the range of the object.
| T | the container to copy |
Definition at line 163 of file STK_MatrixSquare.h.
| MatrixSquare& STK::MatrixSquare::operator= | ( | Real const & | v | ) | [inline] |
operator= : set the container to a constant value.
| v | the value to set |
Reimplemented from STK::Array2D< Real >.
Definition at line 175 of file STK_MatrixSquare.h.
{
Matrix *p1(this); // convert this to Array2D
(*p1) = v; // use = of Array2D class
return *this;
}
| MatrixSquare& STK::MatrixSquare::operator= | ( | const IArray2D< Real, TContainer2D > & | T | ) | [inline] |
operator = overwriting a MatrixSquare with a container.
We resize the object if this and T does not have the same size but if they have the same size, we don't modify the range of the object.
| T | the container to copy |
Definition at line 190 of file STK_MatrixSquare.h.
References STK::IContainer2D::rangeHo(), STK::IContainer2D::rangeVe(), and STK::Funct::T.
Resize the container.
The range of the rows and of the columns have to be the same.
| I | range of the Rows |
| J | range of the Cols |
Reimplemented from STK::IContainer2D.
Definition at line 208 of file STK_MatrixSquare.h.
References resize().
{
if (I != J)
{ throw std::runtime_error("MatrixSquare::resize(I, J) "
"I != J");
}
Matrix::resize(I, J);
}
overloading of the shift method.
The first index of the row must be the first index of the columns.
| rbeg | first index of the rows |
| cbeg | first index of the columns |
Definition at line 222 of file STK_MatrixSquare.h.
References shift().
{
if (rbeg != cbeg)
{ throw std::runtime_error("MatrixSquare::shift(rbeg, cbeg) "
"rbeg != cbeg");
}
Matrix::shift(rbeg, cbeg);
}