Public Member Functions | Private Attributes | List of all members
gnsstk::MatrixSlice< T > Class Template Reference

Detailed Description

template<class T>
class gnsstk::MatrixSlice< T >

An assignable slice of a matrix.

Definition at line 249 of file Matrix.hpp.

#include <Matrix.hpp>

Inheritance diagram for gnsstk::MatrixSlice< T >:
Inheritance graph
[legend]

Public Member Functions

size_t cols () const
 returns the number of columns in the slice More...
 
size_t colSize () const
 returns the number of columns in this slice More...
 
size_t colStart () const
 returns the starting row in the base matrix of this slice More...
 
size_t colStride () const
 returns the number of elements between the i'th and i+1'th row More...
 
 MatrixSlice ()
 default constructor More...
 
 MatrixSlice (Matrix< T > &mat)
 Makes a slice of the whole matrix. More...
 
 MatrixSlice (Matrix< T > &mat, const std::slice &rowSlice, const std::slice &colSlice)
 Makes a partial slice of a matrix. More...
 
 MatrixSlice (Matrix< T > &mat, size_t topRow, size_t topCol, size_t numRows, size_t numCols)
 Submatrix slice. More...
 
T & operator() (size_t i, size_t j)
 returns the (i,j) element of the slice. More...
 
operator() (size_t i, size_t j) const
 returns the (i,j) element of the slice, const version. More...
 
template<class V >
MatrixSliceoperator= (const ConstMatrixBase< T, V > &x)
 Copies from x to (*this). More...
 
template<class V >
MatrixSliceoperator= (const ConstVectorBase< T, V > &x)
 Copies from x to (*this). More...
 
MatrixSliceoperator= (const std::valarray< T > &x)
 Copies from x to (*this). More...
 
MatrixSliceoperator= (const T *x)
 Copies from x to (*this). More...
 
MatrixSliceoperator= (const T x)
 Copies from x to (*this). More...
 
size_t rows () const
 returns the number of rows in the slice More...
 
size_t rowSize () const
 returns the number of rows in this slice More...
 
size_t rowStart () const
 returns the starting row in the base matrix of this slice More...
 
size_t rowStride () const
 returns the number of elements between the i'th and i+1'th row More...
 
size_t size () const
 returns the size of this slice More...
 
- Public Member Functions inherited from gnsstk::RefMatrixSliceBase< T, MatrixSlice< T > >
 RefMatrixSliceBase ()
 
- Public Member Functions inherited from gnsstk::RefMatrixBase< T, MatrixSlice< T > >
MatrixSlice< T > & assignFrom (const ConstMatrixBase< T, E > &x)
 
MatrixSlice< T > & assignFrom (const ConstVectorBase< T, E > &x)
 
MatrixSlice< T > & assignFrom (const std::valarray< T > &x)
 
MatrixSlice< T > & assignFrom (const T *x)
 
MatrixSlice< T > & assignFrom (T x)
 
size_t cols () const
 returns the number of columns in the matrix More...
 
T & operator() (size_t i, size_t j)
 returns a reference to the (i,j) element of the matrix. More...
 
MatrixSlice< T > & operator*= (const T x)
 multiplies each element in this matrix by x. More...
 
MatrixSlice< T > & operator+= (const ConstMatrixBase< T, E > &x)
 
MatrixSlice< T > & operator+= (const ConstVectorBase< T, E > &x)
 
MatrixSlice< T > & operator+= (const std::valarray< T > &x)
 
MatrixSlice< T > & operator+= (const T *x)
 
MatrixSlice< T > & operator+= (T x)
 
const MatrixSlice< T > operator- ()
 unary minus: multiplies each element in this matrix by -1. More...
 
MatrixSlice< T > & operator-= (const ConstMatrixBase< T, E > &x)
 
MatrixSlice< T > & operator-= (const ConstVectorBase< T, E > &x)
 
MatrixSlice< T > & operator-= (const std::valarray< T > &x)
 
MatrixSlice< T > & operator-= (const T *x)
 
MatrixSlice< T > & operator-= (T x)
 
MatrixSlice< T > & operator/= (const T x)
 divides each element in this matrix by x. More...
 
 RefMatrixBase ()
 default constructor More...
 
size_t rows () const
 returns the number of rows in the matrix More...
 
size_t size () const
 returns the rows()*cols() size of the matrix More...
 
MatrixSlice< T > & swapCols (size_t col1, size_t col2)
 
MatrixSlice< T > & swapRows (size_t row1, size_t row2)
 
MatrixSlice< T > & zeroize ()
 
MatrixSlice< T > & zeroizeCol (size_t c)
 
MatrixSlice< T > & zeroizeRow (size_t r)
 
virtual ~RefMatrixBase ()
 
- Public Member Functions inherited from gnsstk::ConstMatrixBase< T, MatrixSlice< T > >
Vector< T > colCopy (size_t c, size_t r=0) const
 
size_t cols () const
 the number of columns in the matrix More...
 
 ConstMatrixBase ()
 default constructor More...
 
Vector< T > diagCopy (void) const
 
bool isDiagonal () const
 returns true if this is a diagonal matrix More...
 
bool isLT () const
 returns true if this is a lower triangular matrix. More...
 
bool isSquare () const
 returns true if this is a square matrix (false for a null matrix). More...
 
bool isSymmetric () const
 
bool isUT () const
 returns true if this is an upper triangular matrix. More...
 
operator() (size_t i, size_t j) const
 
Vector< T > rowCopy (size_t r, size_t c=0) const
 
size_t rows () const
 the number of rows in the matrix More...
 
size_t size () const
 the rows()*cols() size of the matrix. More...
 
virtual ~ConstMatrixBase ()
 

Private Attributes

std::slice cSlice
 a column slice More...
 
Matrix< T > * m
 The matrix this slice refers to. More...
 
std::slice rSlice
 a row slice More...
 
size_t s
 the overall size More...
 

Additional Inherited Members

- Protected Member Functions inherited from gnsstk::MatrixSliceBase< T, MatrixSlice< T > >
void matSliceCheck (size_t sourceRowSize, size_t sourceColSize) const
 
- Protected Member Functions inherited from gnsstk::ConstMatrixBase< T, MatrixSlice< T > >
constMatrixRef (size_t i, size_t j) const
 

Constructor & Destructor Documentation

◆ MatrixSlice() [1/4]

template<class T >
gnsstk::MatrixSlice< T >::MatrixSlice ( )
inline

default constructor

Definition at line 253 of file Matrix.hpp.

◆ MatrixSlice() [2/4]

template<class T >
gnsstk::MatrixSlice< T >::MatrixSlice ( Matrix< T > &  mat)
inline

Makes a slice of the whole matrix.

Definition at line 258 of file Matrix.hpp.

◆ MatrixSlice() [3/4]

template<class T >
gnsstk::MatrixSlice< T >::MatrixSlice ( Matrix< T > &  mat,
const std::slice &  rowSlice,
const std::slice &  colSlice 
)
inline

Makes a partial slice of a matrix.

Definition at line 266 of file Matrix.hpp.

◆ MatrixSlice() [4/4]

template<class T >
gnsstk::MatrixSlice< T >::MatrixSlice ( Matrix< T > &  mat,
size_t  topRow,
size_t  topCol,
size_t  numRows,
size_t  numCols 
)
inline

Submatrix slice.

Definition at line 275 of file Matrix.hpp.

Member Function Documentation

◆ cols()

template<class T >
size_t gnsstk::MatrixSlice< T >::cols ( ) const
inline

returns the number of columns in the slice

Definition at line 307 of file Matrix.hpp.

◆ colSize()

template<class T >
size_t gnsstk::MatrixSlice< T >::colSize ( ) const
inline

returns the number of columns in this slice

Definition at line 327 of file Matrix.hpp.

◆ colStart()

template<class T >
size_t gnsstk::MatrixSlice< T >::colStart ( ) const
inline

returns the starting row in the base matrix of this slice

Definition at line 329 of file Matrix.hpp.

◆ colStride()

template<class T >
size_t gnsstk::MatrixSlice< T >::colStride ( ) const
inline

returns the number of elements between the i'th and i+1'th row

Definition at line 331 of file Matrix.hpp.

◆ operator()() [1/2]

template<class T >
T& gnsstk::MatrixSlice< T >::operator() ( size_t  i,
size_t  j 
)
inline

returns the (i,j) element of the slice.

Definition at line 311 of file Matrix.hpp.

◆ operator()() [2/2]

template<class T >
T gnsstk::MatrixSlice< T >::operator() ( size_t  i,
size_t  j 
) const
inline

returns the (i,j) element of the slice, const version.

Definition at line 315 of file Matrix.hpp.

◆ operator=() [1/5]

template<class T >
template<class V >
MatrixSlice& gnsstk::MatrixSlice< T >::operator= ( const ConstMatrixBase< T, V > &  x)
inline

Copies from x to (*this).

Definition at line 286 of file Matrix.hpp.

◆ operator=() [2/5]

template<class T >
template<class V >
MatrixSlice& gnsstk::MatrixSlice< T >::operator= ( const ConstVectorBase< T, V > &  x)
inline

Copies from x to (*this).

Definition at line 291 of file Matrix.hpp.

◆ operator=() [3/5]

template<class T >
MatrixSlice& gnsstk::MatrixSlice< T >::operator= ( const std::valarray< T > &  x)
inline

Copies from x to (*this).

Definition at line 295 of file Matrix.hpp.

◆ operator=() [4/5]

template<class T >
MatrixSlice& gnsstk::MatrixSlice< T >::operator= ( const T *  x)
inline

Copies from x to (*this).

Definition at line 301 of file Matrix.hpp.

◆ operator=() [5/5]

template<class T >
MatrixSlice& gnsstk::MatrixSlice< T >::operator= ( const x)
inline

Copies from x to (*this).

Definition at line 298 of file Matrix.hpp.

◆ rows()

template<class T >
size_t gnsstk::MatrixSlice< T >::rows ( ) const
inline

returns the number of rows in the slice

Definition at line 309 of file Matrix.hpp.

◆ rowSize()

template<class T >
size_t gnsstk::MatrixSlice< T >::rowSize ( ) const
inline

returns the number of rows in this slice

Definition at line 321 of file Matrix.hpp.

◆ rowStart()

template<class T >
size_t gnsstk::MatrixSlice< T >::rowStart ( ) const
inline

returns the starting row in the base matrix of this slice

Definition at line 323 of file Matrix.hpp.

◆ rowStride()

template<class T >
size_t gnsstk::MatrixSlice< T >::rowStride ( ) const
inline

returns the number of elements between the i'th and i+1'th row

Definition at line 325 of file Matrix.hpp.

◆ size()

template<class T >
size_t gnsstk::MatrixSlice< T >::size ( ) const
inline

returns the size of this slice

Definition at line 305 of file Matrix.hpp.

Member Data Documentation

◆ cSlice

template<class T >
std::slice gnsstk::MatrixSlice< T >::cSlice
private

a column slice

Definition at line 337 of file Matrix.hpp.

◆ m

template<class T >
Matrix<T>* gnsstk::MatrixSlice< T >::m
private

The matrix this slice refers to.

Definition at line 335 of file Matrix.hpp.

◆ rSlice

template<class T >
std::slice gnsstk::MatrixSlice< T >::rSlice
private

a row slice

Definition at line 336 of file Matrix.hpp.

◆ s

template<class T >
size_t gnsstk::MatrixSlice< T >::s
private

the overall size

Definition at line 338 of file Matrix.hpp.


The documentation for this class was generated from the following file:


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:45