Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "../config.h"
00021 #ifdef __MATRIXWRAPPER_BOOST__
00022
00023 #ifndef __VECTOR_BOOST__
00024 #define __VECTOR_BOOST__
00025
00026 #include "matrix_wrapper.h"
00027 #include "vector_wrapper.h"
00028 #include <boost/numeric/ublas/vector.hpp>
00029 #include <boost/numeric/ublas/vector_proxy.hpp>
00030 #include <boost/numeric/ublas/io.hpp>
00031
00032
00033 #define BoostColumnVector boost::numeric::ublas::vector<double>
00034 #define BoostRowVector boost::numeric::ublas::vector<double>
00035
00036
00037 namespace MatrixWrapper
00038 {
00039
00041 class ColumnVector : public BoostColumnVector, public ColumnVector_Wrapper
00042 {
00043 public:
00044
00046 ColumnVector();
00047
00049 ColumnVector(int nrows);
00050 ColumnVector(int nrows,double value);
00051
00053 ColumnVector(const MyColumnVector& a, const MyColumnVector& b);
00054
00056 virtual ~ColumnVector();
00057
00059 ColumnVector (const MyColumnVector& a);
00060
00062 ColumnVector (const BoostColumnVector& a);
00063
00064 virtual void resize(int num_rows);
00065 virtual unsigned int rows() const;
00066 virtual unsigned int columns() const;
00067 virtual ColumnVector vectorAdd(const MyColumnVector& v2) const;
00068 virtual ColumnVector& operator =(const MyColumnVector& a);
00069 virtual ColumnVector& operator =(double a);
00070
00071 virtual MyColumnVector & operator+= (const MyColumnVector& a);
00072 virtual MyColumnVector & operator-= (const MyColumnVector& a);
00073 virtual MyColumnVector operator+ (const MyColumnVector &a) const;
00074 virtual MyColumnVector operator- (const MyColumnVector &a) const;
00075
00076 virtual MyColumnVector& operator+= (double b);
00077 virtual MyColumnVector& operator-= (double b);
00078 virtual MyColumnVector& operator*= (double b);
00079 virtual MyColumnVector& operator/= (double b);
00080 virtual MyColumnVector operator+ (double b) const;
00081 virtual MyColumnVector operator- (double b) const;
00082 virtual MyColumnVector operator* (double b) const;
00083 virtual MyColumnVector operator/ (double b) const;
00084
00086 virtual double operator[](unsigned int i) const
00087 {
00088
00089
00090
00091
00092 return (*this)(i+1);
00093 }
00094
00096 virtual double& operator[](unsigned int i)
00097 {
00098
00099
00100
00101 return (*this)(i+1);
00102 }
00103
00104 virtual double operator()(unsigned int) const;
00105 virtual bool operator==(const MyColumnVector& a) const;
00106 virtual double& operator()(unsigned int);
00107 virtual MyMatrix operator* (const MyRowVector &a) const;
00108 virtual MyColumnVector sub(int j_start , int j_end) const;
00109 virtual MyRowVector transpose() const;
00110
00111
00112 };
00113
00115 class RowVector : public BoostRowVector, public RowVector_Wrapper
00116 {
00117
00118
00119
00120 public:
00121 RowVector();
00122 RowVector(int ncols);
00123 RowVector(int ncols,double value);
00124
00125
00126
00127
00128 RowVector (const MyRowVector& a);
00129
00130 RowVector (const BoostRowVector& a);
00131
00132 virtual ~RowVector();
00133
00134 virtual void resize(int num_cols);
00135 virtual RowVector vectorAdd(const MyRowVector& v2) const;
00136 virtual unsigned int rows() const;
00137 virtual unsigned int columns() const;
00138 virtual RowVector& operator =(double a);
00139 virtual RowVector& operator =(const MyRowVector& a);
00140
00141 virtual MyRowVector & operator+= (const MyRowVector& a);
00142 virtual MyRowVector & operator-= (const MyRowVector& a);
00143 virtual MyRowVector operator+ (const MyRowVector &a) const;
00144 virtual MyRowVector operator- (const MyRowVector &a) const;
00145
00146 virtual MyRowVector& operator+= (double b);
00147 virtual MyRowVector& operator-= (double b);
00148 virtual MyRowVector& operator*= (double b);
00149 virtual MyRowVector& operator/= (double b);
00150 virtual MyRowVector operator+ (double b) const;
00151 virtual MyRowVector operator- (double b) const;
00152 virtual MyRowVector operator* (double b) const;
00153 virtual MyRowVector operator/ (double b) const;
00154
00155 virtual double operator()(unsigned int) const;
00156 virtual bool operator==(const MyRowVector& a) const;
00157 virtual double& operator()(unsigned int);
00158 virtual MyRowVector sub(int j_start , int j_end) const;
00159 virtual MyColumnVector transpose() const;
00160 virtual double operator*(const MyColumnVector& a) const;
00161
00162 };
00163
00164 }
00165
00166 #endif
00167
00168 #endif
bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Thu Feb 11 2016 22:31:57