LLVM API Documentation

PBQP::Matrix Class Reference

PBQP Matrix class. More...

#include <PBQPMath.h>

Collaboration diagram for PBQP::Matrix:
[legend]

List of all members.

Public Member Functions

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


Detailed Description

PBQP Matrix class.

Definition at line 112 of file PBQPMath.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 PBQPMath.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 PBQPMath.h.

PBQP::Matrix::Matrix ( const Matrix &  m  )  [inline]

Copy construct a PBQP matrix.

Definition at line 128 of file PBQPMath.h.

References data.

PBQP::Matrix::~Matrix (  )  [inline]

Destroy this matrix, return its memory.

Definition at line 134 of file PBQPMath.h.


Member Function Documentation

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

Assignment operator.

Definition at line 137 of file PBQPMath.h.

References cols, data, and rows.

unsigned PBQP::Matrix::getRows (  )  const [inline]

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

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

Matrix element access.

Definition at line 152 of file PBQPMath.h.

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

Matrix element access.

Definition at line 158 of file PBQPMath.h.

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

Returns the given row as a vector.

Definition at line 164 of file PBQPMath.h.

References c.

Referenced by PBQP::operator<<(), and PBQP::GraphBase< PBQP::AnnotatedNode< NodeData, EdgeData >, PBQP::AnnotatedEdge< NodeData, EdgeData > >::printDot().

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

Returns the given column as a vector.

Definition at line 172 of file PBQPMath.h.

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

Reset the matrix to the given value.

Definition at line 180 of file PBQPMath.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 PBQPMath.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 PBQPMath.h.

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

Matrix transpose.

Definition at line 201 of file PBQPMath.h.

References c.

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 PBQPMath.h.

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

Add the given matrix to this one.

Definition at line 222 of file PBQPMath.h.

References cols, data, and rows.

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

Returns the minimum of the given row.

Definition at line 231 of file PBQPMath.h.

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

Returns the minimum of the given column.

Definition at line 237 of file PBQPMath.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 PBQPMath.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 PBQPMath.h.

bool PBQP::Matrix::isZero (  )  const [inline]

Returns true if this is a zero matrix.

Definition at line 261 of file PBQPMath.h.


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