matrixabstractlayerboost.hh File Reference
#include "boost/version.hpp"
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/stringize.hpp>
#include "boost/numeric/bindings/traits/ublas_matrix.hpp"
#include "boost/numeric/bindings/traits/std_vector.hpp"
#include "boost/numeric/ublas/matrix_proxy.hpp"
#include "boost/numeric/ublas/matrix.hpp"
#include "boost/numeric/ublas/io.hpp"
#include "boost/numeric/ublas/operation.hpp"
#include "boost/numeric/ublas/vector.hpp"
#include "boost/numeric/ublas/vector_proxy.hpp"
#include "boost/numeric/ublas/triangular.hpp"
#include "boost/numeric/ublas/lu.hpp"
#include "boost/numeric/bindings/lapack/gesvd.hpp"

Defines

#define MRAWDATA(x)   traits::matrix_storage(x)
#define VRAWDATA(x)   traits::vector_storage(x)
#define MAL_VECTOR_TYPE(type)   boost_ublas::vector<type>
#define MAL_VECTOR(name, type)   boost_ublas::vector<type> name
#define MAL_VECTOR_DIM(name, type, nb_rows)   boost_ublas::vector<type> name(nb_rows)
#define MAL_VECTOR_SIZE(name)   name.size()
#define MAL_VECTOR_RESIZE(name, nb_rows)   name.resize(nb_rows)
#define MAL_VECTOR_FILL(name, value)   { for(unsigned int i=0;i<name.size();name[i++]=value) ;}
#define MAL_VECTOR_NORM(name)   boost_ublas::norm_2(name)
#define MAL_VECTOR_3D_CROSS_PRODUCT(res, v1, v2)
#define MAL_RET_VECTOR_DATABLOCK(name)   VRAWDATA(name)
#define MAL_MATRIX_TYPE(type)   boost_ublas::matrix<type>
#define MAL_MATRIX(name, type)   boost_ublas::matrix<type> name
#define MAL_MATRIX_(type)   boost_ublas::matrix<type>
#define MAL_MATRIX_DIM(name, type, nb_rows, nb_cols)   boost_ublas::matrix<type> name(nb_rows,nb_cols)
#define MAL_MATRIX_RESIZE(name, nb_rows, nb_cols)   name.resize(nb_rows,nb_cols)
#define MAL_MATRIX_NB_ROWS(name)   name.size1()
#define MAL_MATRIX_NB_COLS(name)   name.size2()
#define MAL_MATRIX_CLEAR(name)   name.clear()
#define MAL_INVERSE(name, inv_matrix, type)
#define MAL_PSEUDOINVERSE(matrix, pinv_matrix, type)
#define MAL_RET_TRANSPOSE(matrix)   trans(matrix)
#define MAL_TRANSPOSE_A_in_At(A, At)   At=trans(A)
#define MAL_RET_TRANSPOSE_IN_PLACE(matrix)   matrix=trans(matrix)
#define MAL_RET_A_by_B(A, B)   prod(A,B)
#define MAL_C_eq_A_by_B(C, A, B)
#define MAL_MATRIX_SET_IDENTITY(matrix)
#define MAL_MATRIX_FILL(matrix, value)
#define MAL_RET_MATRIX_DATABLOCK(matrix)   MRAWDATA(matrix)
#define MAL_MATRIX_C_eq_EXTRACT_A(C, A, type, top, left, nbrows, nbcols)
#define MAL_MATRIX_RET_DETERMINANT(name, type)   __ret_mal_matrix_ret_determinant<type>(name)
#define _MAL_VERSION_   1

Typedefs

typedef boost_ublas::vector
< double > 
vectorN
typedef boost_ublas::matrix
< double > 
matrixNxP

Functions

void dgesvd_ (char const *jobu, char const *jobvt, int const *m, int const *n, double *a, int const *lda, double *s, double *u, int const *ldu, double *vt, int const *ldvt, double *work, int const *lwork, int *info)
template<class type >
double __ret_mal_matrix_ret_determinant (boost_ublas::matrix< type > const &m)

Define Documentation

#define _MAL_VERSION_   1
#define MAL_C_eq_A_by_B (   C,
  A,
 
)
Value:
{ \
    C = prod(A,B); \
  }
#define MAL_INVERSE (   name,
  inv_matrix,
  type 
)
#define MAL_MATRIX (   name,
  type 
)    boost_ublas::matrix<type> name
#define MAL_MATRIX_ (   type)    boost_ublas::matrix<type>
#define MAL_MATRIX_C_eq_EXTRACT_A (   C,
  A,
  type,
  top,
  left,
  nbrows,
  nbcols 
)
Value:
{ \
    boost_ublas::matrix_slice< boost_ublas::matrix<type> > amatrix(A,boost_ublas::slice(top,1,nbrows),boost_ublas::slice(left,1,nbcols)); \
    C = amatrix;\
  }
#define MAL_MATRIX_CLEAR (   name)    name.clear()
#define MAL_MATRIX_DIM (   name,
  type,
  nb_rows,
  nb_cols 
)    boost_ublas::matrix<type> name(nb_rows,nb_cols)
#define MAL_MATRIX_FILL (   matrix,
  value 
)
Value:
{\
    for(unsigned int i=0;i<matrix.size1();i++) \
      for(unsigned int j=0;j<matrix.size2();j++)\
      matrix(i,j) = value;\
  }
#define MAL_MATRIX_NB_COLS (   name)    name.size2()
#define MAL_MATRIX_NB_ROWS (   name)    name.size1()
#define MAL_MATRIX_RESIZE (   name,
  nb_rows,
  nb_cols 
)    name.resize(nb_rows,nb_cols)
#define MAL_MATRIX_RET_DETERMINANT (   name,
  type 
)    __ret_mal_matrix_ret_determinant<type>(name)
#define MAL_MATRIX_SET_IDENTITY (   matrix)
Value:
{ \
    for(unsigned int i=0;i<matrix.size1();i++) \
      for(unsigned  int j=0;j<matrix.size2();j++)\
        if (i==j) \
           matrix(i,j) = 1; \
        else  \
    matrix(i,j) = 0;\
   }
#define MAL_MATRIX_TYPE (   type)    boost_ublas::matrix<type>
#define MAL_PSEUDOINVERSE (   matrix,
  pinv_matrix,
  type 
)
#define MAL_RET_A_by_B (   A,
 
)    prod(A,B)
#define MAL_RET_MATRIX_DATABLOCK (   matrix)    MRAWDATA(matrix)
#define MAL_RET_TRANSPOSE (   matrix)    trans(matrix)
#define MAL_RET_TRANSPOSE_IN_PLACE (   matrix)    matrix=trans(matrix)
#define MAL_RET_VECTOR_DATABLOCK (   name)    VRAWDATA(name)
#define MAL_TRANSPOSE_A_in_At (   A,
  At 
)    At=trans(A)
#define MAL_VECTOR (   name,
  type 
)    boost_ublas::vector<type> name
#define MAL_VECTOR_3D_CROSS_PRODUCT (   res,
  v1,
  v2 
)
Value:
if ((v1.size()==3) && (v2.size()==3))   \
    { \
      res[0] = v1[1] * v2[2] - v2[1] * v1[2]; \
      res[1] = v1[2] * v2[0] - v2[2] * v1[0]; \
      res[2] = v1[0] * v2[1] - v2[0] * v1[1]; \
    }
#define MAL_VECTOR_DIM (   name,
  type,
  nb_rows 
)    boost_ublas::vector<type> name(nb_rows)
#define MAL_VECTOR_FILL (   name,
  value 
)    { for(unsigned int i=0;i<name.size();name[i++]=value) ;}
#define MAL_VECTOR_NORM (   name)    boost_ublas::norm_2(name)
#define MAL_VECTOR_RESIZE (   name,
  nb_rows 
)    name.resize(nb_rows)
#define MAL_VECTOR_SIZE (   name)    name.size()
#define MAL_VECTOR_TYPE (   type)    boost_ublas::vector<type>
#define MRAWDATA (   x)    traits::matrix_storage(x)
#define VRAWDATA (   x)    traits::vector_storage(x)

Typedef Documentation

typedef boost_ublas::matrix<double> matrixNxP
typedef boost_ublas::vector<double> vectorN

Function Documentation

template<class type >
double __ret_mal_matrix_ret_determinant ( boost_ublas::matrix< type > const &  m) [inline]
void dgesvd_ ( char const *  jobu,
char const *  jobvt,
int const *  m,
int const *  n,
double *  a,
int const *  lda,
double *  s,
double *  u,
int const *  ldu,
double *  vt,
int const *  ldvt,
double *  work,
int const *  lwork,
int *  info 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines