HubbardGPU
Hubbard diagonalisation on the GPU (and CPU)
 All Classes Files Functions Variables Typedefs Friends Macros
matrix Class Reference

#include <helpers.h>

Public Member Functions

 matrix ()
 
 matrix (int n_, int m_)
 
 matrix (const matrix &orig)
 
 matrix (matrix &&orig)
 
virtual ~matrix ()
 
matrixoperator= (const matrix &orig)
 
matrixoperator= (double val)
 
int getn () const
 
int getm () const
 
double operator() (int x, int y) const
 
double & operator() (int x, int y)
 
double & operator[] (int x)
 
double operator[] (int x) const
 
double * getpointer () const
 
matrixprod (matrix const &A, matrix const &B)
 
std::unique_ptr< double[]> svd ()
 
void Print () const
 

Private Attributes

std::unique_ptr< double[]> mat
 n by m array of double More...
 
int n
 number of rows More...
 
int m
 number of columns More...
 

Detailed Description

Helper class, wrapper around a double array. Has methods to get the number of rows and columns. A simple matrix class.

Definition at line 34 of file helpers.h.

Constructor & Destructor Documentation

matrix::matrix ( )

Empty matrix constructor. Don't use it unless you know what you're doing

Definition at line 41 of file helpers.cpp.

matrix::matrix ( int  n_,
int  m_ 
)
Parameters
n_number of rows
m_number of columns

Definition at line 51 of file helpers.cpp.

matrix::matrix ( const matrix orig)
Parameters
origmatrix to copy

Definition at line 62 of file helpers.cpp.

+ Here is the call graph for this function:

matrix::matrix ( matrix &&  orig)

move constructor

Parameters
origmatrix to copy (descrutive)

Definition at line 74 of file helpers.cpp.

virtual matrix::~matrix ( )
inlinevirtual

Definition at line 45 of file helpers.h.

Member Function Documentation

int matrix::getm ( ) const
Returns
number of columns

Definition at line 113 of file helpers.cpp.

+ Here is the caller graph for this function:

int matrix::getn ( ) const
Returns
number of rows

Definition at line 105 of file helpers.cpp.

+ Here is the caller graph for this function:

double * matrix::getpointer ( ) const

Definition at line 142 of file helpers.cpp.

+ Here is the caller graph for this function:

double matrix::operator() ( int  x,
int  y 
) const

Definition at line 118 of file helpers.cpp.

double & matrix::operator() ( int  x,
int  y 
)

Definition at line 124 of file helpers.cpp.

matrix & matrix::operator= ( const matrix orig)

Definition at line 81 of file helpers.cpp.

+ Here is the call graph for this function:

matrix & matrix::operator= ( double  val)

Set all matrix elements equal to a value

Parameters
valthe value to use

Definition at line 94 of file helpers.cpp.

double & matrix::operator[] ( int  x)

Definition at line 130 of file helpers.cpp.

double matrix::operator[] ( int  x) const

Definition at line 136 of file helpers.cpp.

void matrix::Print ( ) const

Definition at line 200 of file helpers.cpp.

matrix & matrix::prod ( matrix const &  A,
matrix const &  B 
)

Matrix-Matrix product of A and B. Store result in this

Parameters
Afirst matrix
Bsecond matrix

Definition at line 152 of file helpers.cpp.

+ Here is the call graph for this function:

std::unique_ptr< double[]> matrix::svd ( )

Do a SVD on this matrix and store left singular values in this. Changes the size of the matrix!

Returns
list of singular values

Definition at line 171 of file helpers.cpp.

+ Here is the call graph for this function:

Member Data Documentation

int matrix::m
private

number of columns

Definition at line 77 of file helpers.h.

std::unique_ptr<double []> matrix::mat
private

n by m array of double

Definition at line 73 of file helpers.h.

int matrix::n
private

number of rows

Definition at line 75 of file helpers.h.


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