Main Page | User's Guide | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

Matrix_Base.hxx

00001 // Copyright (C) 2001-2004 Vivien Mallet
00002 //
00003 // This file is part of Seldon library.
00004 // Seldon library provides matrices and vectors structures for
00005 // linear algebra.
00006 // 
00007 // Seldon is free software; you can redistribute it and/or modify
00008 // it under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation; either version 2 of the License, or
00010 // (at your option) any later version.
00011 // 
00012 // Seldon is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License (file "license") for more details.
00016 //
00017 // For more information, please see the Seldon home page:
00018 //     http://spacetown.free.fr/lib/seldon/
00019 
00020 // To be included by Seldon.hxx
00021 
00022 #ifndef SELDON_FILE_MATRIX_BASE_HXX
00023 
00024 #include "../Common/Common.hxx"
00025 #include "../Common/Properties.hxx"
00026 #include "../Common/Storage.hxx"
00027 #include "../Common/Errors.cxx"
00028 #include "../Common/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     // typdef declarations.
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     // Static attributes.
00051   protected:
00052     static Allocator allocator_;
00053 
00054     // Attributes.
00055   protected:
00056     // Number of rows.
00057     int m_;
00058     // Number of columns.
00059     int n_;
00060     // Pointer to stored elements.
00061     pointer data_;
00062 
00063     // Methods.
00064   public:
00065     // Constructors.
00066     Matrix_Base();
00067     Matrix_Base(int i);
00068     Matrix_Base(int i, int j);
00069   
00070     // Destructor.
00071     ~Matrix_Base();
00072 
00073     // Basic methods.
00074     int GetM() const;
00075     int GetN() const;
00076     int GetSize() const;
00077     pointer GetData() const;
00078     const_pointer GetDataConst() const;
00079     void* GetDataVoid() const;
00080     const void* GetDataConstVoid() const;
00081 
00082   };
00083 
00084 
00085   // Matrix allocator.
00086   template <class T, class Allocator>
00087   Allocator Matrix_Base<T, Allocator>::allocator_;
00088 
00089 
00090   template <class T, class Prop, class Storage, class Allocator>
00091   ostream& operator << (ostream& out,
00092                         const Matrix<T, Prop, Storage, Allocator>& A);
00093 
00094 
00095 } // namespace Seldon.
00096 
00097 #define SELDON_FILE_MATRIX_BASE_HXX
00098 #endif

Generated on Sun Jan 16 23:37:58 2005 for Multivac by  doxygen 1.4.0