Modigliani  2.0
A stochastic simulator for axons, neurons, and networks
Public Member Functions | Friends | List of all members
modigliani_base::DMatrix Class Reference

A straight-forward double matrix class. More...

Public Member Functions

 DMatrix (int r, int c)
 Construct a matrix. More...
 
 DMatrix (int r)
 Construct a vector. More...
 
 DMatrix (DMatrix &copy)
 Duplicate from existent DMatrix object. More...
 
 ~DMatrix ()
 Destructor.
 
DMatrix operator+ (DMatrix &right)
 Adds two matrices. More...
 
DMatrix operator- (DMatrix &right)
 Substracts two matrices. More...
 
DMatrix operator* (DMatrix &right)
 Multiplies two matrices. More...
 
DMatrix operator* (double factor)
 Scales a matric with a scalar factor. More...
 
DMatrixoperator= (DMatrix &)
 Copies the content of one matrix into another. More...
 
double & operator() (int size_x, int size_y)
 Access matrix components. More...
 
double & operator() (int size)
 Access vector components. More...
 
void print ()
 Writes the matrix to stdout.
 
double sum ()
 Returns the sum of all elements in the matrix. More...
 
double quadSum ()
 Returns the quadratic sum of all elements in the matrix. More...
 
DMatrix operator~ ()
 Compute inverse with Gauss-elimination including Pivotizing. More...
 

Friends

std::istream & operator>> (std::istream &, DMatrix &)
 Prints the matrix. More...
 

Detailed Description

A straight-forward double matrix class.

Warning
INDICES in Matrix START with (1,1) and end with (row,col) !
DESTRUCTIVE methods used! Be carefull because currently methods and operators might modify the (*this) object and some generate a new one

Constructor & Destructor Documentation

modigliani_base::DMatrix::DMatrix ( int  r,
int  c 
)

Construct a matrix.

Parameters
rNumber of rows
cNumber of columns
modigliani_base::DMatrix::DMatrix ( int  r)
explicit

Construct a vector.

Parameters
rNumber of elements
modigliani_base::DMatrix::DMatrix ( DMatrix copy)

Duplicate from existent DMatrix object.

Parameters
copyOriginal matrix

Member Function Documentation

double & modigliani_base::DMatrix::operator() ( int  size_x,
int  size_y 
)

Access matrix components.

Parameters
size_xRow
size_yColumn
Returns
Element
double & modigliani_base::DMatrix::operator() ( int  size)

Access vector components.

Parameters
sizeIndex
Returns
Element
modigliani_base::DMatrix modigliani_base::DMatrix::operator* ( modigliani_base::DMatrix right)

Multiplies two matrices.

Parameters
rightMatrix to multiply
Returns
Result
modigliani_base::DMatrix modigliani_base::DMatrix::operator* ( double  factor)

Scales a matric with a scalar factor.

Parameters
factorScale factor
Returns
Result
modigliani_base::DMatrix modigliani_base::DMatrix::operator+ ( modigliani_base::DMatrix right)

Adds two matrices.

Parameters
rightMatrix to add
Returns
Result
modigliani_base::DMatrix modigliani_base::DMatrix::operator- ( modigliani_base::DMatrix right)

Substracts two matrices.

Parameters
rightMatrix to substract
Returns
Result
modigliani_base::DMatrix & modigliani_base::DMatrix::operator= ( modigliani_base::DMatrix right)

Copies the content of one matrix into another.

Parameters
rightMatrix to copy data from
Returns
Result
modigliani_base::DMatrix modigliani_base::DMatrix::operator~ ( )

Compute inverse with Gauss-elimination including Pivotizing.

Returns
Inverse matrix
double modigliani_base::DMatrix::quadSum ( )

Returns the quadratic sum of all elements in the matrix.

Returns
The quadratic sum of elements
double modigliani_base::DMatrix::sum ( )

Returns the sum of all elements in the matrix.

Returns
The sum of elements

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  is,
modigliani_base::DMatrix m 
)
friend

Prints the matrix.

Parameters
isostream to output into
mThe matrix
Returns
ostream

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