yat  0.21pre
Public Types | Public Member Functions | Related Functions | List of all members
theplu::yat::utility::MatrixWeighted Class Reference

Weighted Matrix. More...

#include <yat/utility/MatrixWeighted.h>

Public Types

typedef DataWeight value_type
 
typedef DataWeightreference
 
typedef const DataWeightconst_reference
 
typedef std::vector< DataWeight >::iterator iterator
 
typedef std::vector< DataWeight >::const_iterator const_iterator
 
typedef StrideIterator< std::vector< DataWeight >::iteratorcolumn_iterator
 
typedef StrideIterator< std::vector< DataWeight >::const_iteratorconst_column_iterator
 
typedef column_iterator row_iterator
 
typedef const_column_iterator const_row_iterator
 

Public Member Functions

 MatrixWeighted (void)
 The default constructor. More...
 
 MatrixWeighted (size_t r, size_t c, double init_value=0, double init_weight=1.0)
 Create a r times c MatrixWeighted. More...
 
 MatrixWeighted (const MatrixWeighted &)
 The copy constructor.
 
 MatrixWeighted (MatrixWeighted &&)
 The move copy constructor. More...
 
 MatrixWeighted (const MatrixBase &other)
 Constructor. More...
 
 MatrixWeighted (std::istream &, char sep='\0')
 The istream constructor. More...
 
iterator begin (void)
 
const_iterator begin (void) const
 
column_iterator begin_column (size_t i)
 
const_column_iterator begin_column (size_t i) const
 
row_iterator begin_row (size_t i)
 
const_row_iterator begin_row (size_t i) const
 
size_t columns (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
column_iterator end_column (size_t i)
 
const_column_iterator end_column (size_t i) const
 
row_iterator end_row (size_t i)
 
const_row_iterator end_row (size_t i) const
 
void resize (size_t rows, size_t columns)
 Resize MatrixWeighted. More...
 
size_t rows (void) const
 
void swap (MatrixWeighted &other)
 swap objects More...
 
DataWeightoperator() (size_t row, size_t column)
 Element access operator. More...
 
const DataWeightoperator() (size_t row, size_t column) const
 Element access operator. More...
 
MatrixWeightedoperator= (MatrixWeighted &&other)
 The move assignment operator. More...
 

Related Functions

(Note that these are not member functions.)

void swap (MatrixWeighted &, MatrixWeighted &)
 Exchange all elements. More...
 

Detailed Description

Weighted Matrix.

Since
New in yat 0.5

Member Typedef Documentation

◆ column_iterator

Mutable iterator that iterates over one column

◆ const_column_iterator

Read-only iterator that iterates over one column

◆ const_iterator

Read-only iterator that iterates over all elements

◆ const_reference

const_reference type is const DataWeight&

◆ const_row_iterator

Read-only iterator that iterates over one row

◆ iterator

Mutable iterator that iterates over all elements

◆ reference

reference type is DataWeight&

◆ row_iterator

Mutable iterator that iterates over one row

◆ value_type

value_type is DataWeight

Constructor & Destructor Documentation

◆ MatrixWeighted() [1/5]

theplu::yat::utility::MatrixWeighted::MatrixWeighted ( void  )

The default constructor.

Creates a zero size MatrixWeighted

◆ MatrixWeighted() [2/5]

theplu::yat::utility::MatrixWeighted::MatrixWeighted ( size_t  r,
size_t  c,
double  init_value = 0,
double  init_weight = 1.0 
)

Create a r times c MatrixWeighted.

If r is zero c must be zero and vice versa.

Constructor allocating memory space for r times c elements, and sets all elements to DataWeight(init_value, init_weight)

◆ MatrixWeighted() [3/5]

theplu::yat::utility::MatrixWeighted::MatrixWeighted ( MatrixWeighted &&  )

The move copy constructor.

Since
new in yat 0.15

◆ MatrixWeighted() [4/5]

theplu::yat::utility::MatrixWeighted::MatrixWeighted ( const MatrixBase other)
explicit

Constructor.

Data is copied from other and weights are calculated using the binary_weight function, i.e., a NaN gets a zero weight (0.0) and other data values results in a unity weight (1.0).

◆ MatrixWeighted() [5/5]

theplu::yat::utility::MatrixWeighted::MatrixWeighted ( std::istream &  ,
char  sep = '\0' 
)
explicit

The istream constructor.

This constructor first creates a Matrix using the Matrix istream constructor, and then constructs MatrixWeighted using MatrixWeighted(const MatrixBase&).

Note
Weights cannot be set from the streams. Weights are set as outlined in the MatrixWeighted(const MatrixBase&) documentation.
See also
Matrix(std::istream &, char) and MatrixWeighted(const MatrixBase&)

Member Function Documentation

◆ begin() [1/2]

iterator theplu::yat::utility::MatrixWeighted::begin ( void  )

Iterator iterates along a row. When end of row is reached it jumps to beginning of next row.

Returns
iterator pointing to upper-left element.

◆ begin() [2/2]

const_iterator theplu::yat::utility::MatrixWeighted::begin ( void  ) const

Iterator iterates along a row. When end of row is reached it jumps to beginning of next row.

Returns
const_iterator pointing to upper-left element.

◆ begin_column() [1/2]

column_iterator theplu::yat::utility::MatrixWeighted::begin_column ( size_t  i)

Iterator iterates along a column.

Returns
iterator pointing to first element of column i.

◆ begin_column() [2/2]

const_column_iterator theplu::yat::utility::MatrixWeighted::begin_column ( size_t  i) const

Iterator iterates along a column.

Returns
const_iterator pointing to first element of column i.

◆ begin_row() [1/2]

row_iterator theplu::yat::utility::MatrixWeighted::begin_row ( size_t  i)

Iterator iterates along a row.

Returns
iterator pointing to first element of row i.

◆ begin_row() [2/2]

const_row_iterator theplu::yat::utility::MatrixWeighted::begin_row ( size_t  i) const

Iterator iterates along a row.

Returns
const_iterator pointing to first element of row i.

◆ columns()

size_t theplu::yat::utility::MatrixWeighted::columns ( void  ) const
Returns
The number of columns in the matrix.

◆ end() [1/2]

iterator theplu::yat::utility::MatrixWeighted::end ( void  )
Returns
iterator pointing to end of matrix

◆ end() [2/2]

const_iterator theplu::yat::utility::MatrixWeighted::end ( void  ) const
Returns
const_iterator pointing to end of matrix

◆ end_column() [1/2]

column_iterator theplu::yat::utility::MatrixWeighted::end_column ( size_t  i)
Returns
iterator pointing to end of column i

◆ end_column() [2/2]

const_column_iterator theplu::yat::utility::MatrixWeighted::end_column ( size_t  i) const
Returns
const_iterator pointing to end of column i

◆ end_row() [1/2]

row_iterator theplu::yat::utility::MatrixWeighted::end_row ( size_t  i)
Returns
iterator pointing to end of row i

◆ end_row() [2/2]

const_row_iterator theplu::yat::utility::MatrixWeighted::end_row ( size_t  i) const
Returns
const_iterator pointing to end of row i

◆ operator()() [1/2]

DataWeight& theplu::yat::utility::MatrixWeighted::operator() ( size_t  row,
size_t  column 
)

Element access operator.

Returns
Reference to the element position (row, column).

◆ operator()() [2/2]

const DataWeight& theplu::yat::utility::MatrixWeighted::operator() ( size_t  row,
size_t  column 
) const

Element access operator.

Returns
Const reference to the element position (row, column).

◆ operator=()

MatrixWeighted& theplu::yat::utility::MatrixWeighted::operator= ( MatrixWeighted &&  other)

The move assignment operator.

Returns
A reference to the resulting Matrix.
Since
new in yat 0.15

◆ resize()

void theplu::yat::utility::MatrixWeighted::resize ( size_t  rows,
size_t  columns 
)

Resize MatrixWeighted.

Elements in MatrixWeighted are undefined after a resize.

If rows is zero columns must be zero and vice versa.

Note
this function may invalidate iterators.

◆ rows()

size_t theplu::yat::utility::MatrixWeighted::rows ( void  ) const
Returns
The number of rows in the matrix.

◆ swap()

void theplu::yat::utility::MatrixWeighted::swap ( MatrixWeighted other)

swap objects

Takes constant time. Invalidates iterators. There is no requirement on the size of other.

Friends And Related Function Documentation

◆ swap()

void swap ( MatrixWeighted ,
MatrixWeighted  
)
related

Exchange all elements.

Takes constant time.

See also
MatrixWeighted::swap(MatrixWeighted&)

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

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14