vector_NEWMAT.h
Go to the documentation of this file.
00001 // $Id$
00002 // Copyright (C) 2002 Klaas Gadeyne <first dot last at gmail dot com>
00003 
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU Lesser General Public License as published by
00007 // the Free Software Foundation; either version 2.1 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 //
00019 
00020 #include "../config.h"
00021 #ifdef __MATRIXWRAPPER_NEWMAT__
00022 
00023 #ifndef __VECTOR_NEWMAT__
00024 #define __VECTOR_NEWMAT__
00025 
00026 #include "matrix_wrapper.h"
00027 #include "vector_wrapper.h"
00028 #include <newmat/newmatio.h>
00029 #include <assert.h>
00030 
00031 
00032 #define NewMatColumnVector NEWMAT::ColumnVector
00033 #define NewMatRowVector    NEWMAT::RowVector
00034 
00035 namespace MatrixWrapper
00036 {
00037 
00039 class ColumnVector : public NewMatColumnVector, public ColumnVector_Wrapper
00040 {
00041 public:
00042 
00044   ColumnVector();
00045 
00047   ColumnVector(int nrows);
00048 
00050   ColumnVector(const MyColumnVector& a, const MyColumnVector& b);
00051 
00053   virtual ~ColumnVector();
00054 
00056   ColumnVector (const MyColumnVector& a);
00057 
00059   ColumnVector (const NewMatColumnVector& a);
00060 
00061   virtual void resize(int num_rows);
00062   virtual void assign(int size, double value) ;
00063   virtual unsigned int rows() const;
00064   virtual unsigned int columns() const;
00065   virtual unsigned int capacity() const;
00066   virtual ColumnVector vectorAdd(const MyColumnVector& v2) const;
00067   virtual ColumnVector& operator =(const MyColumnVector& a);
00068   virtual ColumnVector& operator =(double a);
00069   virtual const bool operator==(const MyColumnVector& a) const;
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 
00085   virtual const double operator()(unsigned int) const;
00086   virtual double& operator()(unsigned int);
00087   virtual MyMatrix operator* (const MyRowVector &a) const;
00088   virtual MyColumnVector sub(int j_start , int j_end) const;
00089   virtual MyRowVector transpose() const;
00090 
00091 
00092 };
00093 
00095 class RowVector : public NewMatRowVector, public RowVector_Wrapper
00096 {
00097   // No private member:  We don't add anything.
00098 
00099   // Public Members
00100  public:
00101   RowVector();
00102   RowVector(int ncols);
00103   // If you have another constructor in the matrix library you
00104   // want to use, you'll have to redefine it yourself
00105 
00106   // Copy constructor
00107   RowVector (const MyRowVector& a);
00108   // Copy constructor for newmat
00109   RowVector (const NewMatRowVector& a);
00110 
00111   virtual ~RowVector();
00112 
00113   virtual void resize(int num_cols);
00114   virtual void assign(int size, double value) ;
00115   virtual RowVector vectorAdd(const MyRowVector& v2) const;
00116   virtual unsigned int rows() const;
00117   virtual unsigned int columns() const;
00118   virtual unsigned int capacity() const;
00119   virtual RowVector& operator =(double a);
00120   virtual RowVector& operator =(const MyRowVector& a);
00121   virtual const bool operator==(const MyRowVector& a) const;
00122 
00123   virtual MyRowVector & operator+= (const MyRowVector& a);
00124   virtual MyRowVector & operator-= (const MyRowVector& a);
00125   virtual MyRowVector operator+ (const MyRowVector &a) const;
00126   virtual MyRowVector operator- (const MyRowVector &a) const;
00127 
00128   virtual MyRowVector& operator+= (double b);
00129   virtual MyRowVector& operator-= (double b);
00130   virtual MyRowVector& operator*= (double b);
00131   virtual MyRowVector& operator/= (double b);
00132   virtual MyRowVector operator+ (double b) const;
00133   virtual MyRowVector operator- (double b) const;
00134   virtual MyRowVector operator* (double b) const;
00135   virtual MyRowVector operator/ (double b) const;
00136 
00137   virtual const double operator()(unsigned int) const;
00138   virtual double& operator()(unsigned int);
00139   virtual MyRowVector sub(int j_start , int j_end) const;
00140   virtual MyColumnVector transpose() const;
00141   virtual double operator*(const MyColumnVector& a) const;
00142 
00143 };
00144 
00145 }
00146 
00147 #endif
00148 
00149 #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