matrix/SubMatrix.hxx

00001 // Copyright (C) 2009 Vivien Mallet
00002 //
00003 // This file is part of the linear-algebra library Seldon,
00004 // http://seldon.sourceforge.net/.
00005 //
00006 // Seldon is free software; you can redistribute it and/or modify it under the
00007 // terms of the GNU Lesser General Public License as published by the Free
00008 // Software Foundation; either version 2.1 of the License, or (at your option)
00009 // any later version.
00010 //
00011 // Seldon is distributed in the hope that it will be useful, but WITHOUT ANY
00012 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00013 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
00014 // more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public License
00017 // along with Seldon. If not, see http://www.gnu.org/licenses/.
00018 
00019 
00020 #ifndef SELDON_FILE_SUBMATRIX_HXX
00021 
00022 
00023 namespace Seldon
00024 {
00025 
00026 
00028   // MATRIX<SUBSTORAGE> //
00030 
00031 
00033   template <class T, class Prop, class M, class Allocator>
00034   class Matrix<T, Prop, SubStorage<M>, Allocator>:
00035     public SubMatrix_Base<T, Prop, M, Allocator>
00036   {
00037     // typedef declaration.
00038   public:
00039     typedef typename M::value_type value_type;
00040     typedef typename M::pointer pointer;
00041     typedef typename M::const_pointer const_pointer;
00042     typedef typename M::reference reference;
00043     typedef typename M::const_reference const_reference;
00044     typedef typename M::entry_type entry_type;
00045     typedef typename M::access_type access_type;
00046     typedef typename M::const_access_type const_access_type;
00047 
00048     // Methods.
00049   public:
00050     // Constructor.
00051     Matrix(M& A, Vector<int>& row_list, Vector<int>& column_list);
00052 
00053     // Destructor.
00054     ~Matrix();
00055   };
00056 
00057 
00059   // SUBMATRIX //
00061 
00062 
00064 
00067   template <class M>
00068   class SubMatrix:
00069     public Matrix<typename M::value_type, typename M::property,
00070                   SubStorage<M>, typename M::allocator>
00071   {
00072   public:
00073     SubMatrix(M& A, Vector<int>& row_list, Vector<int>& column_list);
00074   };
00075 
00076 
00077 } // namespace Seldon.
00078 
00079 
00080 #define SELDON_FILE_SUBMATRIX_HXX
00081 #endif