00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SELDON_FILE_MATRIX_BASE_HXX
00023
00024 #include "../share/Common.hxx"
00025 #include "../share/Properties.hxx"
00026 #include "../share/Storage.hxx"
00027 #include "../share/Errors.hxx"
00028 #include "../share/Allocator.hxx"
00029
00030 namespace Seldon
00031 {
00032
00033
00035
00039 template <class T, class Allocator = SELDON_DEFAULT_ALLOCATOR<T> >
00040 class Matrix_Base
00041 {
00042
00043 public:
00044 typedef typename Allocator::value_type value_type;
00045 typedef typename Allocator::pointer pointer;
00046 typedef typename Allocator::const_pointer const_pointer;
00047 typedef typename Allocator::reference reference;
00048 typedef typename Allocator::const_reference const_reference;
00049
00050
00051 protected:
00052 static Allocator allocator_;
00053
00054
00055 protected:
00056
00057 int m_;
00058
00059 int n_;
00060
00061 pointer data_;
00062
00063
00064 public:
00065
00066 Matrix_Base();
00067 explicit Matrix_Base(int i, int j);
00068 Matrix_Base(const Matrix_Base<T, Allocator>& A);
00069
00070
00071 ~Matrix_Base();
00072
00073
00074 int GetM() const;
00075 int GetN() const;
00076 int GetM(const Seldon::SeldonTranspose& status) const;
00077 int GetN(const Seldon::SeldonTranspose& status) const;
00078 #ifdef SELDON_WITH_BLAS
00079 int GetM(const CBLAS_TRANSPOSE& status) const;
00080 int GetN(const CBLAS_TRANSPOSE& status) const;
00081 #endif
00082 int GetSize() const;
00083 pointer GetData() const;
00084 const_pointer GetDataConst() const;
00085 void* GetDataVoid() const;
00086 const void* GetDataConstVoid() const;
00087
00088 Allocator& GetAllocator();
00089
00090 };
00091
00092
00093
00094 template <class T, class Allocator>
00095 Allocator Matrix_Base<T, Allocator>::allocator_;
00096
00097
00098 template <class T, class Prop, class Storage, class Allocator>
00099 ostream& operator << (ostream& out,
00100 const Matrix<T, Prop, Storage, Allocator>& A);
00101
00102
00103 }
00104
00105 #define SELDON_FILE_MATRIX_BASE_HXX
00106 #endif