LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
PBQP::Matrix Class Reference

PBQP Matrix class. More...

#include <Math.h>

Public Member Functions

 Matrix (unsigned rows, unsigned cols)
 Construct a PBQP Matrix with the given dimensions. More...
 
 Matrix (unsigned rows, unsigned cols, PBQPNum initVal)
 Construct a PBQP Matrix with the given dimensions and initial value. More...
 
 Matrix (const Matrix &m)
 Copy construct a PBQP matrix. More...
 
 ~Matrix ()
 Destroy this matrix, return its memory. More...
 
Matrixoperator= (const Matrix &m)
 Assignment operator. More...
 
unsigned getRows () const
 Return the number of rows in this matrix. More...
 
unsigned getCols () const
 Return the number of cols in this matrix. More...
 
PBQPNumoperator[] (unsigned r)
 Matrix element access. More...
 
const PBQPNumoperator[] (unsigned r) const
 Matrix element access. More...
 
Vector getRowAsVector (unsigned r) const
 Returns the given row as a vector. More...
 
Vector getColAsVector (unsigned c) const
 Returns the given column as a vector. More...
 
Matrixreset (PBQPNum val=0)
 Reset the matrix to the given value. More...
 
MatrixsetRow (unsigned r, PBQPNum val)
 Set a single row of this matrix to the given value. More...
 
MatrixsetCol (unsigned c, PBQPNum val)
 Set a single column of this matrix to the given value. More...
 
Matrix transpose () const
 Matrix transpose. More...
 
Vector diagonalize () const
 Returns the diagonal of the matrix as a vector. More...
 
Matrixoperator+= (const Matrix &m)
 Add the given matrix to this one. More...
 
PBQPNum getRowMin (unsigned r) const
 Returns the minimum of the given row. More...
 
PBQPNum getColMin (unsigned c) const
 Returns the minimum of the given column. More...
 
MatrixsubFromRow (unsigned r, PBQPNum val)
 Subtracts the given scalar from the elements of the given row. More...
 
MatrixsubFromCol (unsigned c, PBQPNum val)
 Subtracts the given scalar from the elements of the given column. More...
 
bool isZero () const
 Returns true if this is a zero matrix. More...
 

Detailed Description

PBQP Matrix class.

Definition at line 112 of file Math.h.

Constructor & Destructor Documentation

PBQP::Matrix::Matrix ( unsigned  rows,
unsigned  cols 
)
inline

Construct a PBQP Matrix with the given dimensions.

Definition at line 116 of file Math.h.

PBQP::Matrix::Matrix ( unsigned  rows,
unsigned  cols,
PBQPNum  initVal 
)
inline

Construct a PBQP Matrix with the given dimensions and initial value.

Definition at line 122 of file Math.h.

PBQP::Matrix::Matrix ( const Matrix m)
inline

Copy construct a PBQP matrix.

Definition at line 128 of file Math.h.

PBQP::Matrix::~Matrix ( )
inline

Destroy this matrix, return its memory.

Definition at line 134 of file Math.h.

Member Function Documentation

Vector PBQP::Matrix::diagonalize ( ) const
inline

Returns the diagonal of the matrix as a vector.

Matrix must be square.

Definition at line 212 of file Math.h.

Vector PBQP::Matrix::getColAsVector ( unsigned  c) const
inline

Returns the given column as a vector.

Definition at line 172 of file Math.h.

PBQPNum PBQP::Matrix::getColMin ( unsigned  c) const
inline

Returns the minimum of the given column.

Definition at line 237 of file Math.h.

unsigned PBQP::Matrix::getCols ( ) const
inline

Return the number of cols in this matrix.

Definition at line 149 of file Math.h.

Referenced by PBQP::Graph::addEdge(), and PBQP::Graph::dump().

Vector PBQP::Matrix::getRowAsVector ( unsigned  r) const
inline

Returns the given row as a vector.

Definition at line 164 of file Math.h.

Referenced by PBQP::operator<<(), and PBQP::Graph::printDot().

PBQPNum PBQP::Matrix::getRowMin ( unsigned  r) const
inline

Returns the minimum of the given row.

Definition at line 231 of file Math.h.

unsigned PBQP::Matrix::getRows ( ) const
inline
bool PBQP::Matrix::isZero ( ) const
inline

Returns true if this is a zero matrix.

Definition at line 261 of file Math.h.

Matrix& PBQP::Matrix::operator+= ( const Matrix m)
inline

Add the given matrix to this one.

Definition at line 222 of file Math.h.

Matrix& PBQP::Matrix::operator= ( const Matrix m)
inline

Assignment operator.

Definition at line 137 of file Math.h.

PBQPNum* PBQP::Matrix::operator[] ( unsigned  r)
inline

Matrix element access.

Definition at line 152 of file Math.h.

const PBQPNum* PBQP::Matrix::operator[] ( unsigned  r) const
inline

Matrix element access.

Definition at line 158 of file Math.h.

Matrix& PBQP::Matrix::reset ( PBQPNum  val = 0)
inline

Reset the matrix to the given value.

Definition at line 180 of file Math.h.

Matrix& PBQP::Matrix::setCol ( unsigned  c,
PBQPNum  val 
)
inline

Set a single column of this matrix to the given value.

Definition at line 193 of file Math.h.

Matrix& PBQP::Matrix::setRow ( unsigned  r,
PBQPNum  val 
)
inline

Set a single row of this matrix to the given value.

Definition at line 186 of file Math.h.

Matrix& PBQP::Matrix::subFromCol ( unsigned  c,
PBQPNum  val 
)
inline

Subtracts the given scalar from the elements of the given column.

Definition at line 254 of file Math.h.

Matrix& PBQP::Matrix::subFromRow ( unsigned  r,
PBQPNum  val 
)
inline

Subtracts the given scalar from the elements of the given row.

Definition at line 245 of file Math.h.

Matrix PBQP::Matrix::transpose ( ) const
inline

Matrix transpose.

Definition at line 201 of file Math.h.

Referenced by PBQP::HeuristicSolverImpl< PBQP::Heuristics::Briggs >::applyR2().


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