yat
0.14.5pre
|
#include <yat/utility/MatrixWeighted.h>
Public Types | |
typedef DataWeight | value_type |
typedef DataWeight & | reference |
typedef const DataWeight & | const_reference |
typedef std::vector < DataWeight >::iterator | iterator |
typedef std::vector < DataWeight >::const_iterator | const_iterator |
typedef StrideIterator < std::vector< DataWeight > ::iterator > | column_iterator |
typedef StrideIterator < std::vector< DataWeight > ::const_iterator > | const_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 (const Matrix &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... | |
DataWeight & | operator() (size_t row, size_t column) |
Element access operator. More... | |
const DataWeight & | operator() (size_t row, size_t column) const |
Element access operator. More... | |
const MatrixWeighted & | operator= (const MatrixWeighted &other) |
The assignment operator. More... | |
Related Functions | |
(Note that these are not member functions.) | |
void | swap (MatrixWeighted &, MatrixWeighted &) |
Exchange all elements. More... | |
Weighted Matrix.
typedef StrideIterator<std::vector<DataWeight>::iterator> theplu::yat::utility::MatrixWeighted::column_iterator |
Mutable iterator that iterates over one column
typedef StrideIterator<std::vector<DataWeight>::const_iterator> theplu::yat::utility::MatrixWeighted::const_column_iterator |
Read-only iterator that iterates over one column
typedef std::vector<DataWeight>::const_iterator theplu::yat::utility::MatrixWeighted::const_iterator |
Read-only iterator that iterates over all elements
typedef const DataWeight& theplu::yat::utility::MatrixWeighted::const_reference |
const_reference type is const DataWeight&
Read-only iterator that iterates over one row
typedef std::vector<DataWeight>::iterator theplu::yat::utility::MatrixWeighted::iterator |
Mutable iterator that iterates over all elements
reference type is DataWeight&
Mutable iterator that iterates over one row
value_type is DataWeight
theplu::yat::utility::MatrixWeighted::MatrixWeighted | ( | void | ) |
The default constructor.
Creates a zero size MatrixWeighted
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)
|
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).
|
explicit |
The istream constructor.
This constructor first creates a Matrix using the Matrix istream constructor, and then constructs MatrixWeighted using MatrixWeighted(const Matrix&).
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.
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.
column_iterator theplu::yat::utility::MatrixWeighted::begin_column | ( | size_t | i | ) |
Iterator iterates along a column.
const_column_iterator theplu::yat::utility::MatrixWeighted::begin_column | ( | size_t | i | ) | const |
Iterator iterates along a column.
row_iterator theplu::yat::utility::MatrixWeighted::begin_row | ( | size_t | i | ) |
Iterator iterates along a row.
const_row_iterator theplu::yat::utility::MatrixWeighted::begin_row | ( | size_t | i | ) | const |
Iterator iterates along a row.
size_t theplu::yat::utility::MatrixWeighted::columns | ( | void | ) | const |
iterator theplu::yat::utility::MatrixWeighted::end | ( | void | ) |
const_iterator theplu::yat::utility::MatrixWeighted::end | ( | void | ) | const |
column_iterator theplu::yat::utility::MatrixWeighted::end_column | ( | size_t | i | ) |
const_column_iterator theplu::yat::utility::MatrixWeighted::end_column | ( | size_t | i | ) | const |
row_iterator theplu::yat::utility::MatrixWeighted::end_row | ( | size_t | i | ) |
const_row_iterator theplu::yat::utility::MatrixWeighted::end_row | ( | size_t | i | ) | const |
DataWeight& theplu::yat::utility::MatrixWeighted::operator() | ( | size_t | row, |
size_t | column | ||
) |
Element access operator.
const DataWeight& theplu::yat::utility::MatrixWeighted::operator() | ( | size_t | row, |
size_t | column | ||
) | const |
Element access operator.
const MatrixWeighted& theplu::yat::utility::MatrixWeighted::operator= | ( | const MatrixWeighted & | other | ) |
The assignment operator.
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.
size_t theplu::yat::utility::MatrixWeighted::rows | ( | void | ) | const |
void theplu::yat::utility::MatrixWeighted::swap | ( | MatrixWeighted & | other | ) |
swap objects
Takes constant time. Invalidates iterators. There is no requirement on the size of other.
|
related |