Go to the documentation of this file.00001 #include "../config.h"
00002 #ifdef __MATRIXWRAPPER_EIGEN__
00003
00004 #ifndef __MATRIX_EIGEN__
00005 #define __MATRIX_EIGEN__
00006 #include "../../bfl_constants.h"
00007 #include "matrix_wrapper.h"
00008 #include "vector_wrapper.h"
00009
00010 #include <Eigen/Core>
00011 #include <assert.h>
00012
00013 typedef Eigen::MatrixXd EigenMatrix;
00014 typedef Eigen::MatrixXd EigenSymmetricMatrix;
00015 typedef Eigen::MatrixXd::ConstSelfAdjointViewReturnType<Eigen::Upper>::Type EigenSymmetricView;
00016
00017 namespace MatrixWrapper
00018 {
00019
00021 class Matrix : public EigenMatrix, public Matrix_Wrapper
00022 {
00023 private:
00024
00025 public:
00026
00027
00028 Matrix();
00029 Matrix(int m, int n);
00030
00031
00032 virtual ~Matrix();
00033
00034
00035 Matrix (const MyMatrix& a);
00036 Matrix(const EigenMatrix & a);
00037
00038 Matrix(int num_rows,const RowVector& v);
00039
00040
00041 virtual unsigned int size() const;
00042 virtual unsigned int capacity() const;
00043 virtual unsigned int rows() const;
00044 virtual unsigned int columns() const;
00045 virtual double& operator()(unsigned int,unsigned int);
00046 virtual double operator()(unsigned int,unsigned int) const;
00047 virtual RowVector operator[](unsigned int)const;
00048
00049 using EigenMatrix::operator ==;
00050 using EigenMatrix::operator =;
00051 using EigenMatrix::operator +=;
00052 using EigenMatrix::operator -=;
00053 using EigenMatrix::operator +;
00054 using EigenMatrix::operator -;
00055
00056 virtual bool operator==(const MyMatrix& a) const;
00057
00058 virtual MyMatrix& operator =(double a);
00059
00060 virtual MyMatrix& operator +=(double a);
00061 virtual MyMatrix& operator -=(double a);
00062 virtual MyMatrix& operator *=(double b);
00063 virtual MyMatrix& operator /=(double b);
00064 virtual MyMatrix operator+ (double b) const;
00065 virtual MyMatrix operator- (double b) const;
00066 virtual MyMatrix operator* (double b) const;
00067 virtual MyMatrix operator/ (double b) const;
00068
00069 virtual MyMatrix& operator =(const MySymmetricMatrix& a);
00070 virtual MyMatrix& operator +=(const MyMatrix& a);
00071 virtual MyMatrix& operator -=(const MyMatrix& a);
00072 virtual MyMatrix operator+ (const MyMatrix &a) const;
00073 virtual MyMatrix operator- (const MyMatrix &a) const;
00074 virtual MyMatrix operator* (const MyMatrix &a) const;
00075
00076 virtual MyColumnVector operator* ( const MyColumnVector &b) const;
00077
00078 virtual MyRowVector rowCopy(unsigned int r) const;
00079 virtual MyColumnVector columnCopy(unsigned int c) const;
00080
00081 virtual void resize(unsigned int i, unsigned int j,
00082 bool copy=true, bool initialize=true);
00083 virtual MyMatrix inverse() const;
00084 virtual MyMatrix transpose() const;
00085 virtual double determinant() const;
00086 virtual int convertToSymmetricMatrix(MySymmetricMatrix& sym);
00087 virtual MyMatrix sub(int i_start, int i_end, int j_start , int j_end) const;
00088
00089 };
00090
00091 class SymmetricMatrix : public EigenSymmetricMatrix, public SymmetricMatrix_Wrapper
00092 {
00093 private:
00094
00095 public:
00096
00097 SymmetricMatrix();
00098 SymmetricMatrix(int n);
00099
00100
00101 SymmetricMatrix(const MySymmetricMatrix& a);
00102 SymmetricMatrix(const EigenSymmetricMatrix& a);
00103 SymmetricMatrix(const EigenSymmetricView & a);
00104
00105 SymmetricMatrix(int num_rows,const RowVector& v);
00106
00107
00108 virtual ~SymmetricMatrix();
00109
00110 virtual unsigned int size() const;
00111 virtual unsigned int capacity() const;
00112 virtual unsigned int rows() const;
00113 virtual unsigned int columns() const;
00114 virtual MySymmetricMatrix inverse() const;
00115 virtual MySymmetricMatrix transpose() const;
00116 virtual double determinant() const;
00117
00118 virtual double& operator()(unsigned int,unsigned int);
00119 virtual double operator()(unsigned int,unsigned int) const;
00120 virtual RowVector operator[](unsigned int)const;
00121
00122 using EigenSymmetricMatrix::operator ==;
00123 using EigenSymmetricMatrix::operator =;
00124 using EigenSymmetricMatrix::operator +=;
00125 using EigenSymmetricMatrix::operator -=;
00126 using EigenSymmetricMatrix::operator +;
00127 using EigenSymmetricMatrix::operator -;
00128
00129 virtual bool operator==(const MySymmetricMatrix& a) const;
00130
00131 virtual MySymmetricMatrix& operator=(double a);
00132
00133 virtual MySymmetricMatrix& operator +=(double a);
00134 virtual MySymmetricMatrix& operator -=(double a);
00135 virtual MySymmetricMatrix& operator *=(double b);
00136 virtual MySymmetricMatrix& operator /=(double b);
00137 virtual MySymmetricMatrix operator + (double b) const;
00138 virtual MySymmetricMatrix operator - (double b) const;
00139 virtual MySymmetricMatrix operator * (double b) const;
00140 virtual MySymmetricMatrix operator / (double b) const;
00141
00142 virtual MyRowVector rowCopy(unsigned int r) const;
00143
00144 virtual MyMatrix& operator +=(const MyMatrix& a);
00145 virtual MyMatrix& operator -=(const MyMatrix& a);
00146 virtual MyMatrix operator + (const MyMatrix &a) const;
00147 virtual MyMatrix operator - (const MyMatrix &a) const;
00148 virtual MyMatrix operator * (const MyMatrix &a) const;
00149
00150 virtual MySymmetricMatrix& operator +=(const MySymmetricMatrix& a);
00151 virtual MySymmetricMatrix& operator -=(const MySymmetricMatrix& a);
00152 virtual MySymmetricMatrix operator + (const MySymmetricMatrix &a) const;
00153 virtual MySymmetricMatrix operator - (const MySymmetricMatrix &a) const;
00154 virtual MyMatrix operator * (const MySymmetricMatrix& a) const;
00155
00156 virtual MyColumnVector operator* (const MyColumnVector &b) const;
00157 virtual void multiply (const MyColumnVector &b, MyColumnVector &result) const;
00158
00159 virtual void resize(unsigned int i, bool copy=true, bool initialize=true);
00160 virtual MyMatrix sub(int i_start, int i_end, int j_start , int j_end) const;
00161
00162 };
00163
00164 }
00165
00166 #endif
00167
00168 #endif
bfl_eigen
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. Eigen matrix library support added by Johannes Meyer.
autogenerated on Mon Oct 6 2014 00:20:35