21 #ifndef SELDON_FILE_MATRIX_POINTERS_INLINE_CXX
23 #include "Matrix_Pointers.hxx"
38 template <
class T,
class Prop,
class Storage,
class Allocator>
52 template <
class T,
class Prop,
class Storage,
class Allocator>
71 template <
class T,
class Prop,
class Storage,
class Allocator>
74 return long(this->m_) * long(this->n_);
79 template<
class T,
class Prop,
class Storage,
class Allocator>
82 size_t taille =
sizeof(*this) + size_t(this->GetDataSize())*
sizeof(T);
83 taille += size_t(Storage::GetFirst(this->m_, this->n_))*
sizeof(pointer);
94 template <
class T,
class Prop,
class Storage,
class Allocator>
96 Matrix_Pointers<T, Prop, Storage, Allocator>::pointer*
107 template <
class T,
class Prop,
class Storage,
class Allocator>
110 return Storage::GetSecond(this->m_, this->n_);
125 template <
class T,
class Prop,
class Storage,
class Allocator>
126 inline typename Matrix_Pointers<T, Prop, Storage, Allocator>::pointer
130 long lgth = Storage::GetSecond(this->m_, this->n_);
131 return this->data_ + long(Storage::GetFirst(i, j)) * lgth
132 + long(Storage::GetSecond(i, j));
143 template <
class T,
class Prop,
class Storage,
class Allocator>
144 inline typename Matrix_Pointers<T, Prop, Storage, Allocator>::reference
148 #ifdef SELDON_CHECK_BOUNDS
149 CheckBounds(i, j, this->m_, this->n_,
"Matrix_Pointers");
152 return me_[Storage::GetFirst(i, j)][Storage::GetSecond(i, j)];
163 template <
class T,
class Prop,
class Storage,
class Allocator>
169 #ifdef SELDON_CHECK_BOUNDS
170 CheckBounds(i, j, this->m_, this->n_,
"Matrix_Pointers");
173 return me_[Storage::GetFirst(i, j)][Storage::GetSecond(i, j)];
184 template <
class T,
class Prop,
class Storage,
class Allocator>
185 inline typename Matrix_Pointers<T, Prop, Storage, Allocator>::reference
189 #ifdef SELDON_CHECK_BOUNDS
190 CheckBounds(i, j, this->m_, this->n_,
"Matrix_Pointers");
193 return me_[Storage::GetFirst(i, j)][Storage::GetSecond(i, j)];
204 template <
class T,
class Prop,
class Storage,
class Allocator>
205 inline typename Matrix_Pointers<T, Prop, Storage, Allocator>::reference
219 template <
class T,
class Prop,
class Storage,
class Allocator>
225 #ifdef SELDON_CHECK_BOUNDS
226 CheckBounds(i, j, this->m_, this->n_,
"Matrix_Pointers");
229 return me_[Storage::GetFirst(i, j)][Storage::GetSecond(i, j)];
240 template <
class T,
class Prop,
class Storage,
class Allocator>
255 template <
class T,
class Prop,
class Storage,
class Allocator>
256 inline typename Matrix_Pointers<T, Prop, Storage, Allocator>::reference
260 #ifdef SELDON_CHECK_BOUNDS
261 CheckBounds(i, this->GetDataSize(),
"Matrix_Pointers");
264 return this->data_[i];
274 template <
class T,
class Prop,
class Storage,
class Allocator>
280 #ifdef SELDON_CHECK_BOUNDS
281 CheckBounds(i, this->GetDataSize(),
"Matrix_Pointers");
284 return this->data_[i];
294 template <
class T,
class Prop,
class Storage,
class Allocator>
298 this->Val(i, j) = val;
308 template <
class T,
class Prop,
class Storage,
class Allocator>
325 template <
class T,
class Prop,
class Storage,
class Allocator>
329 this->Reallocate(A.
GetM(), A.
GetN());
331 Allocator::memorycpy(this->data_, A.
GetData(), this->GetDataSize());
335 #ifdef SELDON_WITH_VIRTUAL
336 template <
class T,
class Prop,
class Storage,
class Allocator>
346 template <
class T,
class Prop,
class Storage,
class Allocator>
347 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
348 ::AddInteraction(
int i,
int j,
const T& val)
356 template <
class T,
class Prop,
class Storage,
class Allocator>
357 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
358 ::AddInteractionRow(
int i,
int n,
const Vector<int>& col,
359 const Vector<T>& val,
bool sorted)
367 template <
class T,
class Prop,
class Storage,
class Allocator>
368 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
369 ::AddInteractionColumn(
int i,
int n,
const Vector<int>& row,
370 const Vector<T>& val,
bool sorted)
378 template <
class T,
class Prop,
class Storage,
class Allocator>
379 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
388 template <
class T,
class Prop,
class Storage,
class Allocator>
389 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
390 ::MltAddVector(
const Treal& alpha,
const Vector<Treal>& x,
391 const Treal& beta, Vector<Treal>& y)
const
394 throw Undefined(
"MltAddVector",
"Not implemented");
399 template <
class T,
class Prop,
class Storage,
class Allocator>
400 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
401 ::MltAddVector(
const Tcplx& alpha,
const Vector<Tcplx>& x,
402 const Tcplx& beta, Vector<Tcplx>& y)
const
405 throw Undefined(
"MltAddVector",
"Not implemented");
410 template <
class T,
class Prop,
class Storage,
class Allocator>
411 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
412 ::MltAddVector(
const Treal& alpha,
const SeldonTranspose&,
413 const Vector<Treal>& x,
414 const Treal& beta, Vector<Treal>& y)
const
417 throw Undefined(
"MltAddVector",
"Not implemented");
422 template <
class T,
class Prop,
class Storage,
class Allocator>
423 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
424 ::MltAddVector(
const Tcplx& alpha,
const SeldonTranspose&,
425 const Vector<Tcplx>& x,
426 const Tcplx& beta, Vector<Tcplx>& y)
const
429 throw Undefined(
"MltAddVector",
"Not implemented");
434 template <
class T,
class Prop,
class Storage,
class Allocator>
435 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
436 ::MltVector(
const Vector<Treal>& x, Vector<Treal>& y)
const
439 throw Undefined(
"MltVector",
"Not implemented");
444 template <
class T,
class Prop,
class Storage,
class Allocator>
445 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
446 ::MltVector(
const Vector<Tcplx>& x, Vector<Tcplx>& y)
const
449 throw Undefined(
"MltVector",
"Not implemented");
454 template <
class T,
class Prop,
class Storage,
class Allocator>
455 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
456 ::MltVector(
const SeldonTranspose&,
457 const Vector<Treal>& x, Vector<Treal>& y)
const
460 throw Undefined(
"MltVector with transpose",
"Not implemented");
465 template <
class T,
class Prop,
class Storage,
class Allocator>
466 inline void Matrix_Pointers<T, Prop, Storage, Allocator>
467 ::MltVector(
const SeldonTranspose&,
468 const Vector<Tcplx>& x, Vector<Tcplx>& y)
const
471 throw Undefined(
"MltVector with transpose",
"Not implemented");
491 template <
class T,
class Prop,
class Allocator>
503 template <
class T,
class Prop,
class Allocator>
511 template <
class T,
class Prop,
class Allocator>
523 template <
class T,
class Prop,
class Allocator>
540 template <
class T,
class Prop,
class Allocator>
555 template <
class T,
class Prop,
class Allocator>
template<
class T0>
559 for (
long i = 0; i < long(this->m_) * long(this->n_); i++)
560 this->data_[i] *= alpha;
580 template <
class T,
class Prop,
class Allocator>
592 template <
class T,
class Prop,
class Allocator>
600 template <
class T,
class Prop,
class Allocator>
617 template <
class T,
class Prop,
class Allocator>
634 template <
class T,
class Prop,
class Allocator>
649 template <
class T,
class Prop,
class Allocator>
template<
class T0>
653 for (
long i = 0; i < long(this->m_)*long(this->n_); i++)
654 this->data_[i] *= alpha;
662 #define SELDON_FILE_MATRIX_POINTERS_INLINE_CXX