Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
matrix Namespace Reference

namespace for the matrix library More...

Classes

class  Matrix
 Matrix type. More...
 
class  SparseArray
 
class  SparseMatrix
 sparse matrix which uses an HashTable first (fast implemented) version More...
 

Typedefs

typedef unsigned int I
 type for matrix indices More...
 
typedef double D
 type for matrix elements More...
 
typedef std::vector< MatrixMatrices
 

Functions

int cmpdouble (const void *a, const void *b)
 
std::ostream & operator<< (std::ostream &str, const Matrix &mat)
 
gsl_matrix * toGSL (const Matrix &src)
 copies our matrix into a gsl matrix (don't forget gsl_matrix_free) More...
 
Matrix fromGSL (const gsl_matrix *src)
 copies gsl matrix to our matrix More...
 
Matrix fromGSL (const gsl_vector *src)
 copies gsl vector to our matrix (column-vector) More...
 
Matrix fromGSL_real (const gsl_matrix_complex *src)
 copies the real part of gsl matrix_complex to our matrix More...
 
Matrix fromGSL_imag (const gsl_matrix_complex *src)
 copies the imag part of gsl matrix_complex to our matrix More...
 
Matrix eigenValuesRealSym (const Matrix &m)
 calculates the eigenvalues of the real and symmetric matrix m and returns them as a column vector in descending order More...
 
bool eigenValuesVectorsRealSym (const Matrix &m, Matrix &eigenvalues, Matrix &eigenvectors)
 calculates the eigenvalues and corresponding eigenvectors of the the real and symmetric matrix m. More...
 
bool eigenValues (const Matrix &m, Matrix &vals_real, Matrix &vals_imag)
 calculates the eigenvalues of the matrix m and returns them as a column vectors seperated to real and imaginary part in descending order. More...
 
bool eigenValuesVectors (const Matrix &m, Matrix &vals_real, Matrix &vals_imag, Matrix &vecs_real, Matrix &vecs_imag)
 calculates the eigenvalues and corresponding eigenvectors of the matrix m. More...
 
std::vector< int > toPositiveSignEigenVectors (Matrix &vecs_real, Matrix &vecs_imag)
 flips the signs of the eigenvectors such that their first entry has positive real part. More...
 
double __matutils_euklidlen (double a, double b)
 
Matrix scaleEigenVectorsWithValue (const Matrix &vals_real, const Matrix &vals_imag, Matrix &vecs_real, Matrix &vecs_imag)
 scales the eigenvectors with the absolute value of the eigenvalues. More...
 

Variables

const int T = 0xFF
 integer constant for use with exp function and (^) operator to transpose the matrix More...
 

Detailed Description

namespace for the matrix library

Array which uses an HashTable for elements stored in this array.

Author
Georg Martius

Can be used as an base class of SparseMatrix. first (fast implemented) version.

Typedef Documentation

typedef double D

type for matrix elements

typedef unsigned int I

type for matrix indices

typedef std::vector<Matrix> Matrices

Function Documentation

double matrix::__matutils_euklidlen ( double  a,
double  b 
)
int matrix::cmpdouble ( const void *  a,
const void *  b 
)
bool eigenValues ( const Matrix &  m,
Matrix &  real,
Matrix &  imag 
)

calculates the eigenvalues of the matrix m and returns them as a column vectors seperated to real and imaginary part in descending order.

Matrix eigenValuesRealSym ( const Matrix &  m)

calculates the eigenvalues of the real and symmetric matrix m and returns them as a column vector in descending order

bool eigenValuesVectors ( const Matrix &  m,
Matrix &  vals_real,
Matrix &  vals_imag,
Matrix &  vecs_real,
Matrix &  vecs_imag 
)

calculates the eigenvalues and corresponding eigenvectors of the matrix m.

The eigenvalues are returned them as a column vector in descending order and the belonging eigenvectors are stored in the columns of the matrix eigenvectors. Both are seperated into real and imaginary part.

bool eigenValuesVectorsRealSym ( const Matrix &  m,
Matrix &  eigenvalues,
Matrix &  eigenvectors 
)

calculates the eigenvalues and corresponding eigenvectors of the the real and symmetric matrix m.

The eigenvalues are returned them as a column vector in descending order and the belonging eigenvectors are stored in the columns of the matrix eigenvectors.

Matrix fromGSL ( const gsl_matrix *  src)

copies gsl matrix to our matrix

Matrix fromGSL ( const gsl_vector *  src)

copies gsl vector to our matrix (column-vector)

Matrix fromGSL_imag ( const gsl_matrix_complex *  src)

copies the imag part of gsl matrix_complex to our matrix

Matrix fromGSL_real ( const gsl_matrix_complex *  src)

copies the real part of gsl matrix_complex to our matrix

std::ostream& matrix::operator<< ( std::ostream &  str,
const Matrix &  mat 
)
Matrix scaleEigenVectorsWithValue ( const Matrix &  vals_real,
const Matrix &  vals_imag,
Matrix &  vecs_real,
Matrix &  vecs_imag 
)

scales the eigenvectors with the absolute value of the eigenvalues.

returns vector with factors

gsl_matrix * toGSL ( const Matrix &  src)

copies our matrix into a gsl matrix (don't forget gsl_matrix_free)

std::vector< int > toPositiveSignEigenVectors ( Matrix &  vecs_real,
Matrix &  vecs_imag 
)

flips the signs of the eigenvectors such that their first entry has positive real part.

If the first entry is very small the first no-vanishing entry is used. The eigenvectors are assumed to be columnwise (as returned by eigenValues() etc). Returns the original signs (1 or -1 per column)

Variable Documentation

const int T = 0xFF

integer constant for use with exp function and (^) operator to transpose the matrix

Examples:
matrix/matrixexample.cpp.