LatNet Builder Manual  2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
NetBuilder::GeneratingMatrix Class Reference

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...
 
Rowoperator[] (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GeneratingMatrix() [1/2]

NetBuilder::GeneratingMatrix::GeneratingMatrix ( unsigned int  nRows = 0,
unsigned int  nCols = 0 
)

Constructs a generating matrix with all entries set to zero.

Parameters
nRowsNumber of rows.
nColsNumber of columns.

◆ GeneratingMatrix() [2/2]

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.

Parameters
nRowsNumber of rows.
nColsNumber of columns.
initVector of uInteger of length nRows

Member Function Documentation

◆ flip()

void NetBuilder::GeneratingMatrix::flip ( unsigned int  i,
unsigned int  j 
)

Flip the element at at position i, j of the matrix.

Parameters
iRow index.
jColumn index.

◆ getColsReverse()

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.

◆ nCols()

unsigned int NetBuilder::GeneratingMatrix::nCols ( ) const

Returns the number of columns of the matrix.

◆ nRows()

unsigned int NetBuilder::GeneratingMatrix::nRows ( ) const

Returns the number of rows of the matrix.

◆ operator()() [1/2]

bool NetBuilder::GeneratingMatrix::operator() ( unsigned int  i,
unsigned  j 
) const

Returns the element at position i, j of the matrix.

Parameters
iRow index.
jColumn index.

◆ operator()() [2/2]

reference NetBuilder::GeneratingMatrix::operator() ( unsigned int  i,
unsigned int  j 
)

Returns a reference to the element at position i, j of the matrix.

Parameters
iRow index.
jColumn index.

◆ operator*()

GeneratingMatrix NetBuilder::GeneratingMatrix::operator* ( const GeneratingMatrix m) const

Computes the product of the matrix by matrix m.

Parameters
mRight multiplier.

◆ operator[]() [1/2]

Row NetBuilder::GeneratingMatrix::operator[] ( unsigned int  i) const

Returns the row at position i of the matrix.

Parameters
iPosition of the row.

◆ operator[]() [2/2]

Row& NetBuilder::GeneratingMatrix::operator[] ( unsigned int  i)

Returns a reference to the row at position i of the matrix.

Parameters
iPosition of the row.

◆ resize()

void NetBuilder::GeneratingMatrix::resize ( unsigned int  nRows,
unsigned int  nCols 
)

Resizes the matrix to the given shape.

Potential new elements are set to zero.

Parameters
nRowsis the new number of rows of the matrix
nColsis the new number of columns of the matrix

◆ stackBelow()

void NetBuilder::GeneratingMatrix::stackBelow ( GeneratingMatrix  block)

Extends the matrix by stacking below the matrix block.

Parameters
blockThe matrix to stack. Should have the same number of columns as the base matrix.

◆ stackRight()

void NetBuilder::GeneratingMatrix::stackRight ( const GeneratingMatrix block)

Extends the matrix by stacking on the right the matrix block.

Parameters
blockThe matrix to stack. Should have the same number of rows as the base matrix.

◆ subMatrix()

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.

Parameters
startingRowRow position of the upper-left corner.
startingColColumn position of the upper-left corner.
nRowsNumber of rows.
nColsNumber of columns.
Returns
A copy of the submatrix.

Referenced by NetBuilder::FigureOfMerit::ResolutionGapProjMerit< EmbeddingType::UNILEVEL >::operator()(), and NetBuilder::FigureOfMerit::ResolutionGapProjMerit< EmbeddingType::MULTILEVEL >::operator()().

◆ swapRows()

void NetBuilder::GeneratingMatrix::swapRows ( unsigned int  i1,
unsigned int  i2 
)

Swap the rows at position i1 and i2 of the matrix.

Parameters
i1Position of the first row.
i2Position of the second row.

◆ upperLeftSubMatrix()

GeneratingMatrix NetBuilder::GeneratingMatrix::upperLeftSubMatrix ( unsigned int  nRows,
unsigned int  nCols 
) const

Returns the upper-left submatrix with nRows rows and nCols columns.

Parameters
nRowsNumber of rows.
nColsNumber of columns.
Returns
A copy of the submatrix.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const GeneratingMatrix mat 
)
friend

Overloads of << operator to print matrices.


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