SubMatrix.hxx
1 // Copyright (C) 2009 Vivien Mallet
2 //
3 // This file is part of the linear-algebra library Seldon,
4 // http://seldon.sourceforge.net/.
5 //
6 // Seldon is free software; you can redistribute it and/or modify it under the
7 // terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 2.1 of the License, or (at your option)
9 // any later version.
10 //
11 // Seldon is distributed in the hope that it will be useful, but WITHOUT ANY
12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
14 // more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with Seldon. If not, see http://www.gnu.org/licenses/.
18 
19 
20 #ifndef SELDON_FILE_SUBMATRIX_HXX
21 
22 
23 namespace Seldon
24 {
25 
26 
28  // MATRIX<SUBSTORAGE> //
30 
31 
33  template <class T, class Prop, class M, class Allocator>
34  class Matrix<T, Prop, SubStorage<M>, Allocator>:
35  public SubMatrix_Base<T, Prop, M, Allocator>
36  {
37  // typedef declaration.
38  public:
39  typedef typename M::value_type value_type;
40  typedef typename M::pointer pointer;
41  typedef typename M::const_pointer const_pointer;
42  typedef typename M::reference reference;
43  typedef typename M::const_reference const_reference;
44  typedef typename M::entry_type entry_type;
45  typedef typename M::access_type access_type;
46  typedef typename M::const_access_type const_access_type;
47 
48  // Methods.
49  public:
50  // Constructor.
51  Matrix(M& A, Vector<int> row_list, Vector<int> column_list);
52 
53  // Destructor.
54  ~Matrix();
55 
56  reference Get(int i, int j);
57  };
58 
59 
61  // SUBMATRIX //
63 
64 
66 
69  template <class M>
70  class SubMatrix:
71  public Matrix<typename M::value_type, typename M::property,
72  SubStorage<M>, typename M::allocator>
73  {
74  public:
75  typedef typename M::reference reference;
76 
77  public:
78  SubMatrix(M& A, Vector<int> row_list, Vector<int> column_list);
79  };
80 
81 
82 } // namespace Seldon.
83 
84 
85 #define SELDON_FILE_SUBMATRIX_HXX
86 #endif
Seldon::SubStorage
Definition: Storage.hxx:349
Seldon::SubMatrix
Sub-matrix class.
Definition: SubMatrix.hxx:70
Seldon::Vector< int >
Seldon::Matrix
Definition: SeldonHeader.hxx:226
Seldon::SubMatrix_Base
Sub-matrix base class.
Definition: SubMatrix_Base.hxx:29
Seldon::SubMatrix::SubMatrix
SubMatrix(M &A, Vector< int > row_list, Vector< int > column_list)
Main constructor.
Definition: SubMatrixInline.cxx:86
Seldon
Seldon namespace.
Definition: Array.cxx:24