LLVM  3.7.0
Public Member Functions | Friends | List of all members
llvm::PBQP::Matrix Class Reference

PBQP Matrix class. More...

#include <Math.h>

Inheritance diagram for llvm::PBQP::Matrix:
[legend]

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 (Matrix &&M)
 Move construct a PBQP matrix. More...
 
 ~Matrix ()
 Destroy this matrix, return its memory. More...
 
Matrixoperator= (const Matrix &M)
 Copy-assignment operator. More...
 
Matrixoperator= (Matrix &&M)
 Move-assignment operator. More...
 
bool operator== (const Matrix &M) const
 Comparison 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...
 
Matrix operator+ (const Matrix &M)
 
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...
 

Friends

hash_code hash_value (const Matrix &)
 Return a hash_code for the given matrix. More...
 

Detailed Description

PBQP Matrix class.

Definition at line 163 of file Math.h.

Constructor & Destructor Documentation

llvm::PBQP::Matrix::Matrix ( unsigned  Rows,
unsigned  Cols 
)
inline

Construct a PBQP Matrix with the given dimensions.

Definition at line 169 of file Math.h.

llvm::PBQP::Matrix::Matrix ( unsigned  Rows,
unsigned  Cols,
PBQPNum  InitVal 
)
inline

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

Definition at line 175 of file Math.h.

llvm::PBQP::Matrix::Matrix ( const Matrix M)
inline

Copy construct a PBQP matrix.

Definition at line 181 of file Math.h.

llvm::PBQP::Matrix::Matrix ( Matrix &&  M)
inline

Move construct a PBQP matrix.

Definition at line 187 of file Math.h.

llvm::PBQP::Matrix::~Matrix ( )
inline

Destroy this matrix, return its memory.

Definition at line 194 of file Math.h.

Member Function Documentation

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

Returns the diagonal of the matrix as a vector.

Matrix must be square.

Definition at line 305 of file Math.h.

Vector llvm::PBQP::Matrix::getColAsVector ( unsigned  C) const
inline

Returns the given column as a vector.

Definition at line 260 of file Math.h.

Referenced by llvm::PBQP::backpropagate().

PBQPNum llvm::PBQP::Matrix::getColMin ( unsigned  C) const
inline

Returns the minimum of the given column.

Definition at line 339 of file Math.h.

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

Return the number of cols in this matrix.

Definition at line 231 of file Math.h.

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

Vector llvm::PBQP::Matrix::getRowAsVector ( unsigned  R) const
inline

Returns the given row as a vector.

Definition at line 251 of file Math.h.

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

PBQPNum llvm::PBQP::Matrix::getRowMin ( unsigned  R) const
inline

Returns the minimum of the given row.

Definition at line 332 of file Math.h.

unsigned llvm::PBQP::Matrix::getRows ( ) const
inline

Return the number of rows in this matrix.

Definition at line 225 of file Math.h.

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

bool llvm::PBQP::Matrix::isZero ( ) const
inline

Returns true if this is a zero matrix.

Definition at line 367 of file Math.h.

Matrix llvm::PBQP::Matrix::operator+ ( const Matrix M)
inline

Definition at line 324 of file Math.h.

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

Add the given matrix to this one.

Definition at line 315 of file Math.h.

Matrix& llvm::PBQP::Matrix::operator= ( const Matrix M)
inline

Copy-assignment operator.

Definition at line 197 of file Math.h.

Matrix& llvm::PBQP::Matrix::operator= ( Matrix &&  M)
inline

Move-assignment operator.

Definition at line 206 of file Math.h.

bool llvm::PBQP::Matrix::operator== ( const Matrix M) const
inline

Comparison operator.

Definition at line 217 of file Math.h.

References llvm::lltok::equal.

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

Matrix element access.

Definition at line 237 of file Math.h.

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

Matrix element access.

Definition at line 244 of file Math.h.

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

Reset the matrix to the given value.

Definition at line 269 of file Math.h.

Matrix& llvm::PBQP::Matrix::setCol ( unsigned  C,
PBQPNum  Val 
)
inline

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

Definition at line 284 of file Math.h.

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

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

Definition at line 276 of file Math.h.

Matrix& llvm::PBQP::Matrix::subFromCol ( unsigned  C,
PBQPNum  Val 
)
inline

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

Definition at line 359 of file Math.h.

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

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

Definition at line 349 of file Math.h.

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

Matrix transpose.

Definition at line 293 of file Math.h.

Friends And Related Function Documentation

hash_code hash_value ( const Matrix M)
friend

Return a hash_code for the given matrix.

Definition at line 380 of file Math.h.


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