LLVM API Documentation

Public Member Functions | Friends
PBQP::Matrix Class Reference

PBQP Matrix class. More...

#include <Math.h>

Inheritance diagram for PBQP::Matrix:
Inheritance graph
[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 (Matrix &&M)
 Move construct a PBQP matrix.
 ~Matrix ()
 Destroy this matrix, return its memory.
Matrixoperator= (const Matrix &M)
 Copy-assignment operator.
Matrixoperator= (Matrix &&M)
 Move-assignment operator.
bool operator== (const Matrix &M) const
 Comparison operator.
unsigned getRows () const
 Return the number of rows in this matrix.
unsigned getCols () const
 Return the number of cols in this matrix.
PBQPNumoperator[] (unsigned R)
 Matrix element access.
const PBQPNumoperator[] (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.
Matrixreset (PBQPNum Val=0)
 Reset the matrix to the given value.
MatrixsetRow (unsigned R, PBQPNum Val)
 Set a single row of this matrix to the given value.
MatrixsetCol (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.
Matrixoperator+= (const Matrix &M)
 Add the given matrix to this one.
Matrix operator+ (const Matrix &M)
PBQPNum getRowMin (unsigned R) const
 Returns the minimum of the given row.
PBQPNum getColMin (unsigned C) const
 Returns the minimum of the given column.
MatrixsubFromRow (unsigned R, PBQPNum Val)
 Subtracts the given scalar from the elements of the given row.
MatrixsubFromCol (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.

Friends

class MatrixComparator

Detailed Description

PBQP Matrix class.

Definition at line 171 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 177 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 183 of file Math.h.

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

Copy construct a PBQP matrix.

Definition at line 189 of file Math.h.

PBQP::Matrix::Matrix ( Matrix &&  M) [inline]

Move construct a PBQP matrix.

Definition at line 195 of file Math.h.

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

Destroy this matrix, return its memory.

Definition at line 202 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 313 of file Math.h.

Returns the given column as a vector.

Definition at line 268 of file Math.h.

References llvm::CallingConv::C.

Referenced by PBQP::backpropagate().

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

Returns the minimum of the given column.

Definition at line 347 of file Math.h.

References llvm::CallingConv::C.

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

Return the number of cols in this matrix.

Definition at line 239 of file Math.h.

Referenced by PBQP::RegAlloc::MatrixMetadata::MatrixMetadata().

Returns the given row as a vector.

Definition at line 259 of file Math.h.

References llvm::CallingConv::C.

Referenced by PBQP::backpropagate(), and PBQP::operator<<().

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

Returns the minimum of the given row.

Definition at line 340 of file Math.h.

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

Return the number of rows in this matrix.

Definition at line 233 of file Math.h.

Referenced by PBQP::applyR2(), PBQP::RegAlloc::MatrixMetadata::MatrixMetadata(), and PBQP::operator<<().

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

Returns true if this is a zero matrix.

Definition at line 375 of file Math.h.

Matrix PBQP::Matrix::operator+ ( const Matrix M) [inline]

Definition at line 332 of file Math.h.

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

Add the given matrix to this one.

Definition at line 323 of file Math.h.

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

Copy-assignment operator.

Definition at line 205 of file Math.h.

Matrix& PBQP::Matrix::operator= ( Matrix &&  M) [inline]

Move-assignment operator.

Definition at line 214 of file Math.h.

bool PBQP::Matrix::operator== ( const Matrix M) const [inline]

Comparison operator.

Definition at line 225 of file Math.h.

References llvm::lltok::equal.

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

Matrix element access.

Definition at line 245 of file Math.h.

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

Matrix element access.

Definition at line 252 of file Math.h.

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

Reset the matrix to the given value.

Definition at line 277 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 292 of file Math.h.

References llvm::CallingConv::C.

Matrix& PBQP::Matrix::setRow ( unsigned  R,
PBQPNum  Val 
) [inline]

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

Definition at line 284 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 367 of file Math.h.

References llvm::CallingConv::C.

Matrix& PBQP::Matrix::subFromRow ( unsigned  R,
PBQPNum  Val 
) [inline]

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

Definition at line 357 of file Math.h.

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

Matrix transpose.

Definition at line 301 of file Math.h.


Friends And Related Function Documentation

friend class MatrixComparator [friend]

Definition at line 173 of file Math.h.


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