HeterogeneousCollectionInline.cxx
1 // Copyright (C) 2001-2009 INRIA
2 // Author(s): Marc Fragu, Vivien Mallet
3 //
4 // This file is part of the linear-algebra library Seldon,
5 // http://seldon.sourceforge.net/.
6 //
7 // Seldon is free software; you can redistribute it and/or modify it under the
8 // terms of the GNU Lesser General Public License as published by the Free
9 // Software Foundation; either version 2.1 of the License, or (at your option)
10 // any later version.
11 //
12 // Seldon is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15 // more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with Seldon. If not, see http://www.gnu.org/licenses/.
19 
20 
21 #ifndef SELDON_FILE_VECTOR_HETEROGENEOUSCOLLECTION_INLINE_CXX
22 
23 
24 #include "HeterogeneousCollection.hxx"
25 
26 
27 namespace Seldon
28 {
29 
30 
32  // VECTOR HETEROGENEOUSCOLLECTION //
34 
35 
36  /***************
37  * CONSTRUCTOR *
38  ***************/
39 
40 
42 
45  template <class T, template <class U> class Allocator >
46  inline Vector<FloatDouble, DenseSparseCollection, Allocator<T> >
47  ::Vector(): Vector_Base<T, Allocator<T> >(), label_map_(),
48  label_vector_()
49  {
50  Nvector_ = 0;
51  }
52 
53 
55 
58  template <class T, template <class U> class Allocator >
60  ::Vector(const
61  Vector<FloatDouble, DenseSparseCollection, Allocator<T> >& V):
62  Vector_Base<T, Allocator<T> >(V), label_map_(), label_vector_()
63  {
64  Copy(V);
65  }
66 
67 
68  /*****************
69  * BASIC METHODS *
70  *****************/
71 
72 
74 
77  template <class T, template <class U> class Allocator >
79  const
80  {
81  return this->m_;
82  }
83 
84 
86 
89  template <class T, template <class U> class Allocator >
91  ::GetLength() const
92  {
93  return this->m_;
94  }
95 
96 
98 
101  template <class T, template <class U> class Allocator >
103  ::GetNvector() const
104  {
105  return Nvector_;
106  }
107 
108 
110 
113  template <class T, template <class U> class Allocator >
116  ::GetVectorLength() const
117  {
118  return length_;
119  }
120 
121 
123 
126  template <class T, template <class U> class Allocator >
129  ::GetLengthSum() const
130  {
131  return length_sum_;
132  }
133 
134 
136 
139  template <class T, template <class U> class Allocator >
142  ::GetCollectionIndex() const
143  {
144  return collection_;
145  }
146 
147 
149 
153  template <class T, template <class U> class Allocator >
156  ::GetSubvectorIndex() const
157  {
158  return length_sum_;
159  }
160 
161 
163 
166  template <class T, template <class U> class Allocator >
168  ::float_dense_c&
170  {
171  return float_dense_c_;
172  }
173 
174 
176 
179  template <class T, template <class U> class Allocator >
180  inline const
182  ::float_dense_c&
184  ::GetFloatDense() const
185  {
186  return float_dense_c_;
187  }
188 
189 
191 
194  template <class T, template <class U> class Allocator >
195  inline typename
196  Vector<FloatDouble, DenseSparseCollection, Allocator<T> >::float_sparse_c&
198  {
199  return float_sparse_c_;
200  }
201 
202 
204 
207  template <class T, template <class U> class Allocator >
208  inline const
210  ::float_sparse_c&
212  ::GetFloatSparse() const
213  {
214  return float_sparse_c_;
215  }
216 
217 
219 
222  template <class T, template <class U> class Allocator >
223  inline typename Vector<FloatDouble, DenseSparseCollection, Allocator<T> >
224  ::double_dense_c&
226  {
227  return double_dense_c_;
228  }
229 
230 
232 
235  template <class T, template <class U> class Allocator >
236  inline
238  ::double_dense_c&
240  ::GetDoubleDense() const
241  {
242  return double_dense_c_;
243  }
244 
245 
247 
250  template <class T, template <class U> class Allocator >
251  inline typename Vector<FloatDouble, DenseSparseCollection, Allocator<T> >
252  ::double_sparse_c&
254  {
255  return double_sparse_c_;
256  }
257 
258 
260 
263  template <class T, template <class U> class Allocator >
264  inline
266  ::double_sparse_c&
268  ::GetDoubleSparse() const
269  {
270  return double_sparse_c_;
271  }
272 
273 
275 
280  template <class T, template <class U> class Allocator >
281  inline Vector<FloatDouble, DenseSparseCollection, Allocator<T> >&
282  Vector<FloatDouble, DenseSparseCollection, Allocator<T> >::operator=
284  {
285  this->Copy(X);
286  return *this;
287  }
288 
289 } // namespace Seldon.
290 
291 
292 #define SELDON_FILE_VECTOR_HETEROGENEOUSCOLLECTION_INLINE_CXX
293 #endif
Seldon::FloatDouble
Definition: Storage.hxx:365
Seldon::DenseSparseCollection
Definition: StorageInline.cxx:89
Seldon::Vector
Definition: SeldonHeader.hxx:207
Seldon::Vector_Base
Base structure for all vectors.
Definition: SeldonHeader.hxx:201
Seldon
Seldon namespace.
Definition: Array.cxx:24