itpp_wrap.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2010 NICTA and the authors listed below
00002 // http://nicta.com.au
00003 // 
00004 // Authors:
00005 // - Conrad Sanderson (conradsand at ieee dot org)
00006 // 
00007 // This file is part of the Armadillo C++ library.
00008 // It is provided without any warranty of fitness
00009 // for any purpose. You can redistribute this file
00010 // and/or modify it under the terms of the GNU
00011 // Lesser General Public License (LGPL) as published
00012 // by the Free Software Foundation, either version 3
00013 // of the License or (at your option) any later version.
00014 // (see http://www.opensource.org/licenses for more info)
00015 
00016 
00017 //! \addtogroup itpp_wrap
00018 //! @{
00019 
00020 
00021 #ifdef ARMA_USE_ITPP
00022 
00023   #include <itpp/base/mat.h>
00024   #include <itpp/base/vec.h>
00025 
00026 #else
00027 
00028   namespace itpp
00029     {
00030     
00031     //! dummy itpp::Mat class, to prevent compilation errors
00032     template<typename eT>
00033     class Mat
00034       {
00035       public:
00036       
00037       ~Mat()                      {}
00038       Mat()                       {}
00039       Mat(int n_rows, int n_cols) {}
00040       Mat(const Mat& m)           {}
00041       
00042       const Mat& operator=(const Mat& m) { return *this; }
00043 
00044             int rows()  const { return 0; }
00045             int cols()  const { return 0; }
00046             int size()  const { return 0; }      
00047       const eT* _data() const { return 0; }
00048             eT* _data()       { return 0; }
00049      };
00050   
00051   
00052     //! dummy itpp::Vec class, to prevent compilation errors
00053     template<typename eT>
00054     class Vec
00055       {
00056       public:
00057       
00058       ~Vec()            {}
00059       Vec()             {}
00060       Vec(int length)   {}
00061       Vec(const Vec& m) {}
00062       
00063       const Vec& operator=(const Vec& m) { return *this; }
00064       
00065             int size()   const { return 0; }      
00066             int length() const { return 0; }      
00067       const eT* _data()  const { return 0; }
00068             eT* _data()        { return 0; }
00069       };
00070     
00071     typedef Mat<short int> smat;
00072     typedef Vec<short int> svec;
00073     
00074     typedef Mat<int> imat;
00075     typedef Vec<int> ivec;
00076   
00077     typedef Mat<double> mat;
00078     typedef Vec<double> vec;
00079     
00080     typedef Mat< std::complex<double> > cmat;
00081     typedef Vec< std::complex<double> > cvec;
00082     }
00083 
00084 #endif
00085 
00086 
00087 //! @}