SubMatrixInline.cxx
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_INLINE_CXX
21 
22 
23 #include "SubMatrix.hxx"
24 
25 
26 namespace Seldon
27 {
28 
29 
31  // MATRIX<SUBSTORAGE> //
33 
34 
35  /***************
36  * CONSTRUCTOR *
37  ***************/
38 
39 
41  template <class T, class Prop, class M, class Allocator>
42  inline Matrix<T, Prop, SubStorage<M>, Allocator>
43  ::Matrix(M& A, Vector<int> row_list, Vector<int> column_list):
44  SubMatrix_Base<T, Prop, M, Allocator>(A, row_list, column_list)
45  {
46  }
47 
48 
49  /**************
50  * DESTRUCTOR *
51  **************/
52 
53 
55  template <class T, class Prop, class M, class Allocator>
56  inline Matrix<T, Prop, SubStorage<M>, Allocator>::~Matrix()
57  {
58  }
59 
60  /***********
61  * METHODS *
62  ***********/
63 
64 
65  template <class T, class Prop, class M, class Allocator>
66  inline typename Matrix<T, Prop, SubStorage<M>, Allocator>::reference
67  Matrix<T, Prop, SubStorage<M>, Allocator>::Get(int i, int j)
68  {
69  return this->Val(i, j);
70  }
71 
72 
74  // SUBMATRIX //
76 
77 
78  /***************
79  * CONSTRUCTOR *
80  ***************/
81 
82 
84  template <class M>
85  inline SubMatrix<M>
86  ::SubMatrix(M& A, Vector<int> row_list, Vector<int> column_list):
87  Matrix<typename M::value_type, typename M::property,
88  SubStorage<M>, typename M::allocator>(A, row_list, column_list)
89  {
90  }
91 
92 
93 } // namespace Seldon.
94 
95 
96 #define SELDON_FILE_SUBMATRIX_INLINE_CXX
97 #endif
Seldon::SubStorage
Definition: Storage.hxx:349
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