SparseMatrix2 Class Reference

#include <usermatrix.h>

Inheritance diagram for SparseMatrix2:
Inheritance graph
[legend]
Collaboration diagram for SparseMatrix2:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SparseMatrix2 (int n)
 Constructor for a given dimension.
 SparseMatrix2 (const SparseMatrix &A_)
 Copy-Constructor for a SparseMatrix.
 SparseMatrix2 (const UserMatrix &A_, bool no_finish=false)
 Copy-Constructor for a UserMatrix.
 SparseMatrix2 (const ExtUserMatrix &A_, bool no_finish=false)
 Copy-Constructor for an ExtUserMatrix.
double operator() (int row, int col) const
 Operator to read one element of the matrix.
SparseMatrix2operator+= (const UserMatrix &A_)
 Adds a UserMatrix to this SparseMatrix.
SparseMatrix2operator+= (const ExtUserMatrix &A_)
 Adds a ExtUserMatrix to this SparseMatrix2.
SparseMatrix2operator= (const double v)
SparseMatrix2operator*= (const double v)
void set_block (const SparseMatrix &A, const ivector &indices)
void MultV (double *y, const double *x) const
 Multiplication with a double*.
void MultV (dvector &y, const dvector &x) const
 Multiplication with a dvector.
void MultV (UserVector< double > &y, const UserVector< double > &x) const
 Multiplication with a UserVector<double>.
void MultV (IntervalVector &y, const IntervalVector &x) const
void MultV (SparseVector< double > &y, const SparseVector< double > &x) const
 Multiplication with a SparseVector<double>.
double yAx (const UserVector< double > &y, const UserVector< double > &x) const
double yAx (const dvector &y, const dvector &x) const
double xAx (const UserVector< double > &x) const
interval< double > xAx (const IntervalVector &x) const
interval< double > xAx_2bx (const IntervalVector &x, const UserVector< double > &b) const
 Computes sum of xAx and 2b*x for a vector b.
virtual void AddMult (UserVector< double > &y, const UserVector< double > &x, const double alpha) const
 Adds to a UserVector<double> the product of a double value and this matrix, multiplied with a UserVector<double>.
void make_symmetric ()
void set_random (int num_el, double max=1.)
 Clears the matrix and sets the elements to random elements.
virtual void print (ostream &out) const
 Prints the matrix.

Static Public Member Functions

static SparseMatrix2random (int n, int num_el, double max=1.)
 Gives a symmetric random SparseMatrix2.

Detailed Description

Definition at line 1416 of file usermatrix.h.


Constructor & Destructor Documentation

SparseMatrix2::SparseMatrix2 ( int  n  )  [inline]

Constructor for a given dimension.

Parameters:
n The dimension.

Definition at line 1421 of file usermatrix.h.

SparseMatrix2::SparseMatrix2 ( const SparseMatrix A_  )  [inline]

Copy-Constructor for a SparseMatrix.

Parameters:
A_ The quadratic(!) SparseMatrix to copy.

Definition at line 1428 of file usermatrix.h.

SparseMatrix2::SparseMatrix2 ( const UserMatrix A_,
bool  no_finish = false 
) [inline]

Copy-Constructor for a UserMatrix.

Parameters:
A_ The UserMatrix to copy.
no_finish Indicates, whether this SparseMatrix shouldn't be finished after copying A_.

Definition at line 1437 of file usermatrix.h.

SparseMatrix2::SparseMatrix2 ( const ExtUserMatrix A_,
bool  no_finish = false 
) [inline]

Copy-Constructor for an ExtUserMatrix.

Parameters:
A_ The UserMatrix to copy.
no_finish Indicates, whether this SparseMatrix shouldn't be finished after copying A_.

Definition at line 1445 of file usermatrix.h.


Member Function Documentation

double SparseMatrix2::operator() ( int  row,
int  col 
) const [inline, virtual]

Operator to read one element of the matrix.

Abstract.

Parameters:
row The row of the element to read.
col The col of the element to read.
Returns:
The element at index (row, col).

Implements ExtUserMatrix.

Definition at line 1449 of file usermatrix.h.

SparseMatrix2& SparseMatrix2::operator+= ( const UserMatrix A_  )  [inline]

Adds a UserMatrix to this SparseMatrix.

Computes the elements by multiplication with unit vectors. This matrix needs to be unfinished to do this.

Parameters:
A_ The UserMatrix to add.
Returns:
This matrix.

Reimplemented from SparseMatrix.

Definition at line 1451 of file usermatrix.h.

SparseMatrix2& SparseMatrix2::operator+= ( const ExtUserMatrix A_  )  [inline]

Adds a ExtUserMatrix to this SparseMatrix2.

This matrix needs to be unfinished to do this.

Parameters:
A_ The ExtUserMatrix to add.
Returns:
This matrix.

Reimplemented from SparseMatrix.

Definition at line 1453 of file usermatrix.h.

SparseMatrix2& SparseMatrix2::operator= ( const double  v  )  [inline]

Reimplemented from SparseMatrix.

Definition at line 1455 of file usermatrix.h.

SparseMatrix2& SparseMatrix2::operator*= ( const double  v  )  [inline]

Reimplemented from SparseMatrix.

Definition at line 1457 of file usermatrix.h.

void SparseMatrix2::set_block ( const SparseMatrix A,
const ivector indices 
) [inline]

Definition at line 1459 of file usermatrix.h.

void SparseMatrix2::MultV ( double *  y,
const double *  x 
) const [inline, virtual]

Multiplication with a double*.

Parameters:
y The double* to store the result in.
x The double* to multipliy with.

Reimplemented from SparseMatrix.

Definition at line 1461 of file usermatrix.h.

void SparseMatrix2::MultV ( dvector y,
const dvector x 
) const [inline, virtual]

Multiplication with a dvector.

Parameters:
y The dvector to store the result in.
x The dvector to multipliy with.

Reimplemented from SparseMatrix.

Definition at line 1463 of file usermatrix.h.

void SparseMatrix2::MultV ( UserVector< double > &  y,
const UserVector< double > &  x 
) const [inline, virtual]

Multiplication with a UserVector<double>.

Parameters:
y The UserVector<double> to store the result in.
x The UserVector<double> to multipliy with.

Reimplemented from SparseMatrix.

Definition at line 1465 of file usermatrix.h.

void SparseMatrix2::MultV ( IntervalVector y,
const IntervalVector x 
) const [inline, virtual]

Reimplemented from SparseMatrix.

Definition at line 1468 of file usermatrix.h.

void SparseMatrix2::MultV ( SparseVector< double > &  y,
const SparseVector< double > &  x 
) const [inline, virtual]

Multiplication with a SparseVector<double>.

Parameters:
y The SparseVector<double> to store the result in.
x The SparseVector<double> to multipliy with.

Reimplemented from SparseMatrix.

Definition at line 1471 of file usermatrix.h.

double SparseMatrix2::yAx ( const UserVector< double > &  y,
const UserVector< double > &  x 
) const [inline, virtual]

Reimplemented from SparseMatrix.

Definition at line 1473 of file usermatrix.h.

double SparseMatrix2::yAx ( const dvector y,
const dvector x 
) const [inline, virtual]

Reimplemented from SparseMatrix.

Definition at line 1475 of file usermatrix.h.

double SparseMatrix2::xAx ( const UserVector< double > &  x  )  const [inline, virtual]

Reimplemented from SparseMatrix.

Definition at line 1483 of file usermatrix.h.

interval<double> SparseMatrix2::xAx ( const IntervalVector x  )  const [inline, virtual]

Reimplemented from SparseMatrix.

Definition at line 1486 of file usermatrix.h.

interval<double> SparseMatrix2::xAx_2bx ( const IntervalVector x,
const UserVector< double > &  b 
) const [inline, virtual]

Computes sum of xAx and 2b*x for a vector b.

Reimplemented from ExtUserMatrix.

Definition at line 1488 of file usermatrix.h.

virtual void SparseMatrix2::AddMult ( UserVector< double > &  y,
const UserVector< double > &  x,
const double  alpha 
) const [inline, virtual]

Adds to a UserVector<double> the product of a double value and this matrix, multiplied with a UserVector<double>.

Parameters:
y The UserVector<double> to store the result in: y + alpha * A * x
x The UserVector<double> to multiply this matrix with.
alpha The double to multiply with.

Reimplemented from SparseMatrix.

Definition at line 1491 of file usermatrix.h.

void SparseMatrix2::make_symmetric (  ) 
void SparseMatrix2::set_random ( int  num_el,
double  max = 1. 
)

Clears the matrix and sets the elements to random elements.

First, the diagonal elements are set.

Parameters:
num_el The number of elements in one half of the matrix.
max The maximum absolute value of the elements.
static SparseMatrix2* SparseMatrix2::random ( int  n,
int  num_el,
double  max = 1. 
) [inline, static]

Gives a symmetric random SparseMatrix2.

First, the diagonal elements are set.

Parameters:
n The dimension.
num_el The number of elements in one half of the matrix.
max The maximum absolute value of the elements.
Returns:
A new SparseMatrix2.

Definition at line 1509 of file usermatrix.h.

virtual void SparseMatrix2::print ( ostream &  out  )  const [inline, virtual]

Prints the matrix.

Prints the row, column and value for each non-zero entry in this SparseMatrix2.

Reimplemented from SparseMatrix.

Definition at line 1515 of file usermatrix.h.


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

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1