LatNet Builder Manual
2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
|
This class implements a generating matrix of a digital net in base 2. More...
#include <GeneratingMatrix.h>
Public Types | |
typedef boost::dynamic_bitset | Row |
Type for the rows of the matrices. | |
typedef Row::reference | reference |
Type for references to rows. | |
typedef unsigned long | uInteger |
Type for unsigned long. | |
Public Member Functions | |
GeneratingMatrix (unsigned int nRows=0, unsigned int nCols=0) | |
Constructs a generating matrix with all entries set to zero. More... | |
GeneratingMatrix (unsigned int nRows, unsigned int nCols, std::vector< uInteger > init) | |
Constructs a generating matrix with rows initialized using the given integers. More... | |
unsigned int | nCols () const |
Returns the number of columns of the matrix. More... | |
unsigned int | nRows () const |
Returns the number of rows of the matrix. More... | |
void | resize (unsigned int nRows, unsigned int nCols) |
Resizes the matrix to the given shape. More... | |
bool | operator() (unsigned int i, unsigned j) const |
Returns the element at position i , j of the matrix. More... | |
reference | operator() (unsigned int i, unsigned int j) |
Returns a reference to the element at position i , j of the matrix. More... | |
void | flip (unsigned int i, unsigned int j) |
Flip the element at at position i , j of the matrix. More... | |
Row | operator[] (unsigned int i) const |
Returns the row at position i of the matrix. More... | |
Row & | operator[] (unsigned int i) |
Returns a reference to the row at position i of the matrix. More... | |
GeneratingMatrix | upperLeftSubMatrix (unsigned int nRows, unsigned int nCols) const |
Returns the upper-left submatrix with nRows rows and nCols columns. More... | |
GeneratingMatrix | subMatrix (unsigned int startingRow, unsigned int startingCol, unsigned nRows, unsigned nCols) const |
Returns the submatrix with upper-left corner at position startingRow , startingCol with nRows rows and nCols columns. More... | |
GeneratingMatrix | operator* (const GeneratingMatrix &m) const |
Computes the product of the matrix by matrix m . More... | |
void | swapRows (unsigned int i1, unsigned int i2) |
Swap the rows at position i1 and i2 of the matrix. More... | |
void | stackRight (const GeneratingMatrix &block) |
Extends the matrix by stacking on the right the matrix block . More... | |
void | stackBelow (GeneratingMatrix block) |
Extends the matrix by stacking below the matrix block . More... | |
std::vector< unsigned long > | getColsReverse () const |
Returns an integer representation of the columns of the matrix. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const GeneratingMatrix &mat) |
Overloads of << operator to print matrices. More... | |
This class implements a generating matrix of a digital net in base 2.
A matrix is represented as a std::vector
of rows implemented by boost::dynamic_bitset
.
NetBuilder::GeneratingMatrix::GeneratingMatrix | ( | unsigned int | nRows = 0 , |
unsigned int | nCols = 0 |
||
) |
Constructs a generating matrix with all entries set to zero.
nRows | Number of rows. |
nCols | Number of columns. |
NetBuilder::GeneratingMatrix::GeneratingMatrix | ( | unsigned int | nRows, |
unsigned int | nCols, | ||
std::vector< uInteger > | init | ||
) |
Constructs a generating matrix with rows initialized using the given integers.
The elements of a row are the binary digits of the corresponding integer, with the least significant bit on the left.
nRows | Number of rows. |
nCols | Number of columns. |
init | Vector of uInteger of length nRows |
void NetBuilder::GeneratingMatrix::flip | ( | unsigned int | i, |
unsigned int | j | ||
) |
Flip the element at at position i
, j
of the matrix.
i | Row index. |
j | Column index. |
std::vector<unsigned long> NetBuilder::GeneratingMatrix::getColsReverse | ( | ) | const |
Returns an integer representation of the columns of the matrix.
A column is read as a bit string with highest bit in first position.
unsigned int NetBuilder::GeneratingMatrix::nCols | ( | ) | const |
Returns the number of columns of the matrix.
unsigned int NetBuilder::GeneratingMatrix::nRows | ( | ) | const |
Returns the number of rows of the matrix.
bool NetBuilder::GeneratingMatrix::operator() | ( | unsigned int | i, |
unsigned | j | ||
) | const |
Returns the element at position i
, j
of the matrix.
i | Row index. |
j | Column index. |
reference NetBuilder::GeneratingMatrix::operator() | ( | unsigned int | i, |
unsigned int | j | ||
) |
Returns a reference to the element at position i
, j
of the matrix.
i | Row index. |
j | Column index. |
GeneratingMatrix NetBuilder::GeneratingMatrix::operator* | ( | const GeneratingMatrix & | m | ) | const |
Computes the product of the matrix by matrix m
.
m | Right multiplier. |
Row NetBuilder::GeneratingMatrix::operator[] | ( | unsigned int | i | ) | const |
Returns the row at position i
of the matrix.
i | Position of the row. |
Row& NetBuilder::GeneratingMatrix::operator[] | ( | unsigned int | i | ) |
Returns a reference to the row at position i
of the matrix.
i | Position of the row. |
void NetBuilder::GeneratingMatrix::resize | ( | unsigned int | nRows, |
unsigned int | nCols | ||
) |
Resizes the matrix to the given shape.
Potential new elements are set to zero.
nRows | is the new number of rows of the matrix |
nCols | is the new number of columns of the matrix |
void NetBuilder::GeneratingMatrix::stackBelow | ( | GeneratingMatrix | block | ) |
Extends the matrix by stacking below the matrix block
.
block | The matrix to stack. Should have the same number of columns as the base matrix. |
void NetBuilder::GeneratingMatrix::stackRight | ( | const GeneratingMatrix & | block | ) |
Extends the matrix by stacking on the right the matrix block
.
block | The matrix to stack. Should have the same number of rows as the base matrix. |
GeneratingMatrix NetBuilder::GeneratingMatrix::subMatrix | ( | unsigned int | startingRow, |
unsigned int | startingCol, | ||
unsigned | nRows, | ||
unsigned | nCols | ||
) | const |
Returns the submatrix with upper-left corner at position startingRow
, startingCol
with nRows
rows and nCols
columns.
startingRow | Row position of the upper-left corner. |
startingCol | Column position of the upper-left corner. |
nRows | Number of rows. |
nCols | Number of columns. |
Referenced by NetBuilder::FigureOfMerit::ResolutionGapProjMerit< EmbeddingType::UNILEVEL >::operator()(), and NetBuilder::FigureOfMerit::ResolutionGapProjMerit< EmbeddingType::MULTILEVEL >::operator()().
void NetBuilder::GeneratingMatrix::swapRows | ( | unsigned int | i1, |
unsigned int | i2 | ||
) |
Swap the rows at position i1 and i2 of the matrix.
i1 | Position of the first row. |
i2 | Position of the second row. |
GeneratingMatrix NetBuilder::GeneratingMatrix::upperLeftSubMatrix | ( | unsigned int | nRows, |
unsigned int | nCols | ||
) | const |
Returns the upper-left submatrix with nRows
rows and nCols
columns.
nRows | Number of rows. |
nCols | Number of columns. |
|
friend |
Overloads of << operator to print matrices.