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 unsigned int capacity() const;
00068 virtual void assign(int size, double value) ;
00069 virtual ColumnVector vectorAdd(const MyColumnVector& v2) const;
00070 virtual ColumnVector& operator =(const MyColumnVector& a);
00071 virtual ColumnVector& operator =(double a);
00072
00073 virtual MyColumnVector & operator+= (const MyColumnVector& a);
00074 virtual MyColumnVector & operator-= (const MyColumnVector& a);
00075 virtual MyColumnVector operator+ (const MyColumnVector &a) const;
00076 virtual MyColumnVector operator- (const MyColumnVector &a) const;
00077
00078 virtual MyColumnVector& operator+= (double b);
00079 virtual MyColumnVector& operator-= (double b);
00080 virtual MyColumnVector& operator*= (double b);
00081 virtual MyColumnVector& operator/= (double b);
00082 virtual MyColumnVector operator+ (double b) const;
00083 virtual MyColumnVector operator- (double b) const;
00084 virtual MyColumnVector operator* (double b) const;
00085 virtual MyColumnVector operator/ (double b) const;
00086
00088 virtual double operator[](unsigned int i) const
00089 {
00090
00091
00092
00093
00094 return (*this)(i+1);
00095 }
00096
00098 virtual double& operator[](unsigned int i)
00099 {
00100
00101
00102
00103 return (*this)(i+1);
00104 }
00105
00106 virtual double operator()(unsigned int) const;
00107 virtual bool operator==(const MyColumnVector& a) const;
00108 virtual double& operator()(unsigned int);
00109 virtual MyMatrix operator* (const MyRowVector &a) const;
00110 virtual MyColumnVector sub(int j_start , int j_end) const;
00111 virtual MyRowVector transpose() const;
00112
00113
00114 };
00115
00117 class RowVector : public BoostRowVector, public RowVector_Wrapper
00118 {
00119
00120
00121
00122 public:
00123 RowVector();
00124 RowVector(int ncols);
00125 RowVector(int ncols,double value);
00126
00127
00128
00129
00130 RowVector (const MyRowVector& a);
00131
00132 RowVector (const BoostRowVector& a);
00133
00134 virtual ~RowVector();
00135
00136 virtual void resize(int num_cols);
00137 virtual void assign(int size, double value) ;
00138 virtual RowVector vectorAdd(const MyRowVector& v2) const;
00139 virtual unsigned int rows() const;
00140 virtual unsigned int columns() const;
00141 virtual unsigned int capacity() const;
00142 virtual RowVector& operator =(double a);
00143 virtual RowVector& operator =(const MyRowVector& a);
00144
00145 virtual MyRowVector & operator+= (const MyRowVector& a);
00146 virtual MyRowVector & operator-= (const MyRowVector& a);
00147 virtual MyRowVector operator+ (const MyRowVector &a) const;
00148 virtual MyRowVector operator- (const MyRowVector &a) const;
00149
00150 virtual MyRowVector& operator+= (double b);
00151 virtual MyRowVector& operator-= (double b);
00152 virtual MyRowVector& operator*= (double b);
00153 virtual MyRowVector& operator/= (double b);
00154 virtual MyRowVector operator+ (double b) const;
00155 virtual MyRowVector operator- (double b) const;
00156 virtual MyRowVector operator* (double b) const;
00157 virtual MyRowVector operator/ (double b) const;
00158
00159 virtual double operator()(unsigned int) const;
00160 virtual bool operator==(const MyRowVector& a) const;
00161 virtual double& operator()(unsigned int);
00162 virtual MyRowVector sub(int j_start , int j_end) const;
00163 virtual MyColumnVector transpose() const;
00164 virtual double operator*(const MyColumnVector& a) const;
00165
00166 };
00167
00168 }
00169
00170 #endif
00171
00172 #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 Mon Feb 11 2019 03:45:12