Clipper
Public Member Functions | Friends | List of all members
clipper::Matrix< T > Class Template Reference

General matrix class: like Array2d but with numerical methods. More...

#include <clipper_types.h>

Inheritance diagram for clipper::Matrix< T >:
clipper::Array2d< T >

Public Member Functions

 Matrix ()
 null constructor
 
 Matrix (const int &d1, const int &d2)
 constructor
 
 Matrix (const int &d1, const int &d2, T val)
 constructor
 
std::vector< T > solve (const std::vector< T > &b) const
 equation solver (square matrices only) More...
 
std::vector< T > eigen (const bool sort=true)
 eigenvalue calculation (square symmetric matrices only) More...
 
- Public Member Functions inherited from clipper::Array2d< T >
 Array2d ()
 null constructor
 
 Array2d (const int &d1, const int &d2)
 constructor
 
 Array2d (const int &d1, const int &d2, T val)
 constructor
 
void resize (const int &d1, const int &d2)
 resize
 
void resize (const int &d1, const int &d2, const T &val)
 resize
 
int size () const
 size
 
const int & rows () const
 number of rows
 
const int & cols () const
 number of cols
 
const T & operator() (const int &i1, const int &i2) const
 read accessor
 
T & operator() (const int &i1, const int &i2)
 write accessor
 

Friends

std::vector< T > operator* (const Matrix< T > &m, const std::vector< T > &v)
 Matrix-vector product. More...
 

Additional Inherited Members

- Protected Attributes inherited from clipper::Array2d< T >
std::vector< T > data
 
int d1_
 
int d2_
 

Detailed Description

template<class T = ftype>
class clipper::Matrix< T >

General matrix class: like Array2d but with numerical methods.

Member Function Documentation

template<class T>
std::vector< T > clipper::Matrix< T >::solve ( const std::vector< T > &  b) const

equation solver (square matrices only)

Solve the system of linear equations Ax=b for x Uses elimination. Only suitable for small systems.

template<class T >
std::vector< T > clipper::Matrix< T >::eigen ( const bool  sort = true)

eigenvalue calculation (square symmetric matrices only)

Find the Eigenvalues and Eigenvectors of the matrix. Uses the Jacobi method. Only suitable for small systems (dimension<20). The matrix is replaced by the matrix of eigenvectors (as columns).

Parameters
sortSort the eigenvalues and vectors, smallest first. (default=true)
Returns
Vector of eigenvalues.

Friends And Related Function Documentation

template<class T = ftype>
std::vector<T> operator* ( const Matrix< T > &  m,
const std::vector< T > &  v 
)
friend

Matrix-vector product.

Assumes a column vector


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