vector_NEWMAT.h
Go to the documentation of this file.
00001 // $Id: vector_NEWMAT.h 29830 2009-01-14 15:10:41Z kgadeyne $
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 unsigned int rows() const;
00063   virtual unsigned int columns() const;
00064   virtual ColumnVector vectorAdd(const MyColumnVector& v2) const;
00065   virtual ColumnVector& operator =(const MyColumnVector& a);
00066   virtual ColumnVector& operator =(double a);
00067   virtual const bool operator==(const MyColumnVector& a) const;
00068 
00069   virtual MyColumnVector & operator+= (const MyColumnVector& a);
00070   virtual MyColumnVector & operator-= (const MyColumnVector& a);
00071   virtual MyColumnVector operator+ (const MyColumnVector &a) const;
00072   virtual MyColumnVector operator- (const MyColumnVector &a) const;
00073 
00074   virtual MyColumnVector& operator+= (double b);
00075   virtual MyColumnVector& operator-= (double b);
00076   virtual MyColumnVector& operator*= (double b);
00077   virtual MyColumnVector& operator/= (double b);
00078   virtual MyColumnVector operator+ (double b) const;
00079   virtual MyColumnVector operator- (double b) const;
00080   virtual MyColumnVector operator* (double b) const;
00081   virtual MyColumnVector operator/ (double b) const;
00082 
00083   virtual const double operator()(unsigned int) const;
00084   virtual double& operator()(unsigned int);
00085   virtual MyMatrix operator* (const MyRowVector &a) const;
00086   virtual MyColumnVector sub(int j_start , int j_end) const;
00087   virtual MyRowVector transpose() const;
00088 
00089 
00090 };
00091 
00093 class RowVector : public NewMatRowVector, public RowVector_Wrapper
00094 {
00095   // No private member:  We don't add anything.
00096 
00097   // Public Members
00098  public:
00099   RowVector();
00100   RowVector(int ncols);
00101   // If you have another constructor in the matrix library you
00102   // want to use, you'll have to redefine it yourself
00103 
00104   // Copy constructor
00105   RowVector (const MyRowVector& a);
00106   // Copy constructor for newmat
00107   RowVector (const NewMatRowVector& a);
00108 
00109   virtual ~RowVector();
00110 
00111   virtual void resize(int num_cols);
00112   virtual RowVector vectorAdd(const MyRowVector& v2) const;
00113   virtual unsigned int rows() const;
00114   virtual unsigned int columns() const;
00115   virtual RowVector& operator =(double a);
00116   virtual RowVector& operator =(const MyRowVector& a);
00117   virtual const bool operator==(const MyRowVector& a) const;
00118 
00119   virtual MyRowVector & operator+= (const MyRowVector& a);
00120   virtual MyRowVector & operator-= (const MyRowVector& a);
00121   virtual MyRowVector operator+ (const MyRowVector &a) const;
00122   virtual MyRowVector operator- (const MyRowVector &a) const;
00123 
00124   virtual MyRowVector& operator+= (double b);
00125   virtual MyRowVector& operator-= (double b);
00126   virtual MyRowVector& operator*= (double b);
00127   virtual MyRowVector& operator/= (double b);
00128   virtual MyRowVector operator+ (double b) const;
00129   virtual MyRowVector operator- (double b) const;
00130   virtual MyRowVector operator* (double b) const;
00131   virtual MyRowVector operator/ (double b) const;
00132 
00133   virtual const double operator()(unsigned int) const;
00134   virtual double& operator()(unsigned int);
00135   virtual MyRowVector sub(int j_start , int j_end) const;
00136   virtual MyColumnVector transpose() const;
00137   virtual double operator*(const MyColumnVector& a) const;
00138 
00139 };
00140 
00141 }
00142 
00143 #endif
00144 
00145 #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 Fri Aug 28 2015 10:10:21