21 #ifndef SELDON_FILE_MATRIX_TRIANGPACKED_INLINE_CXX
23 #include "Matrix_TriangPacked.hxx"
38 template <
class T,
class Prop,
class Storage,
class Allocator>
51 template <
class T,
class Prop,
class Storage,
class Allocator>
68 template <
class T,
class Prop,
class Storage,
class Allocator>
71 return (
long(this->m_) *
long(this->m_ + 1)) / 2;
76 template <
class T,
class Prop,
class Storage,
class Allocator>
79 size_t taille =
sizeof(*this) + size_t(GetDataSize())*
sizeof(T);
96 template <
class T,
class Prop,
class Storage,
class Allocator>
98 Matrix_TriangPacked<T, Prop, Storage, Allocator>::value_type
103 #ifdef SELDON_CHECK_BOUNDS
104 CheckBounds(i, j, this->m_, this->n_,
"Matrix_TriangPacked");
108 SetComplexZero(zero);
114 return this->data_[Storage::GetFirst(i *
long(this->n_)
115 - (i *
long(i + 1)) / 2 + j,
116 (j *
long(j + 1)) / 2 + i)];
121 return this->data_[Storage::GetFirst((i *
long(i + 1)) / 2 + j,
123 - (j *
long(j + 1)) / 2 + i)];
135 template <
class T,
class Prop,
class Storage,
class Allocator>
136 inline typename Matrix_TriangPacked<T, Prop, Storage, Allocator>::reference
140 #ifdef SELDON_CHECK_BOUNDS
141 CheckBoundsTriang(i, j, this->m_, this->n_,
142 Storage::UpLo(),
"Matrix_TriangPacked");
146 return this->data_[Storage::GetFirst(i *
long(this->n_)
147 - (i *
long(i + 1)) / 2 + j,
148 (j *
long(j + 1)) / 2 + i)];
150 return this->data_[Storage::GetFirst((i *
long(i + 1)) / 2 + j,
152 - (j *
long(j + 1)) / 2 + i)];
164 template <
class T,
class Prop,
class Storage,
class Allocator>
170 #ifdef SELDON_CHECK_BOUNDS
171 CheckBoundsTriang(i, j, this->m_, this->n_,
172 Storage::UpLo(),
"Matrix_TriangPacked");
176 return this->data_[Storage::GetFirst(i *
long(this->n_)
177 - (i *
long(i + 1)) / 2 + j,
178 (j *
long(j + 1)) / 2 + i)];
180 return this->data_[Storage::GetFirst((i *
long(i + 1)) / 2 + j,
182 - (j *
long(j + 1)) / 2 + i)];
193 template <
class T,
class Prop,
class Storage,
class Allocator>
194 inline typename Matrix_TriangPacked<T, Prop, Storage, Allocator>::reference
197 return this->Val(i, j);
208 template <
class T,
class Prop,
class Storage,
class Allocator>
213 return this->Val(i, j);
223 template <
class T,
class Prop,
class Storage,
class Allocator>
224 inline typename Matrix_TriangPacked<T, Prop, Storage, Allocator>::reference
228 #ifdef SELDON_CHECK_BOUNDS
229 CheckBounds(i, this->GetDataSize(),
"Matrix_TriangPacked");
232 return this->data_[i];
242 template <
class T,
class Prop,
class Storage,
class Allocator>
248 #ifdef SELDON_CHECK_BOUNDS
249 CheckBounds(i, this->GetDataSize(),
"Matrix_TriangPacked");
252 return this->data_[i];
262 template <
class T,
class Prop,
class Storage,
class Allocator>
279 template <
class T,
class Prop,
class Storage,
class Allocator>
293 template <
class T,
class Prop,
class Storage,
class Allocator>
297 this->Reallocate(A.
GetM(), A.
GetN());
299 Allocator::memorycpy(this->data_, A.
GetData(), this->GetDataSize());
303 #ifdef SELDON_WITH_VIRTUAL
304 template <
class T,
class Prop,
class Storage,
class Allocator>
314 template <
class T,
class Prop,
class Storage,
class Allocator>
315 inline void Matrix_TriangPacked<T, Prop, Storage, Allocator>
316 ::MltAddVector(
const Tcplx& alpha,
const Vector<Tcplx>& x,
317 const Tcplx& beta, Vector<Tcplx>& y)
const
320 static_cast<const Matrix<T, Prop, Storage, Allocator>&
>(*
this),
324 template <
class T,
class Prop,
class Storage,
class Allocator>
325 inline void Matrix_TriangPacked<T, Prop, Storage, Allocator>
326 ::MltAddVector(
const Treal& alpha,
const SeldonTranspose& trans,
327 const Vector<Treal>& x,
328 const Treal& beta, Vector<Treal>& y)
const
331 static_cast<const Matrix<T, Prop, Storage, Allocator>&
>(*
this),
335 template <
class T,
class Prop,
class Storage,
class Allocator>
336 inline void Matrix_TriangPacked<T, Prop, Storage, Allocator>
337 ::MltAddVector(
const Tcplx& alpha,
const SeldonTranspose& trans,
338 const Vector<Tcplx>& x,
339 const Tcplx& beta, Vector<Tcplx>& y)
const
342 static_cast<const Matrix<T, Prop, Storage, Allocator>&
>(*
this),
346 template <
class T,
class Prop,
class Storage,
class Allocator>
347 inline void Matrix_TriangPacked<T, Prop, Storage, Allocator>
348 ::MltVector(
const Vector<Treal>& x, Vector<Treal>& y)
const
350 Mlt(
static_cast<const Matrix<T, Prop, Storage, Allocator>&
>(*
this), x, y);
353 template <
class T,
class Prop,
class Storage,
class Allocator>
354 inline void Matrix_TriangPacked<T, Prop, Storage, Allocator>
355 ::MltVector(
const Vector<Tcplx>& x, Vector<Tcplx>& y)
const
357 Mlt(
static_cast<const Matrix<T, Prop, Storage, Allocator>&
>(*
this), x, y);
360 template <
class T,
class Prop,
class Storage,
class Allocator>
361 inline void Matrix_TriangPacked<T, Prop, Storage, Allocator>
362 ::MltVector(
const SeldonTranspose& trans,
363 const Vector<Treal>& x, Vector<Treal>& y)
const
366 static_cast<const Matrix<T, Prop, Storage, Allocator>&
>(*
this), x, y);
369 template <
class T,
class Prop,
class Storage,
class Allocator>
370 inline void Matrix_TriangPacked<T, Prop, Storage, Allocator>
371 ::MltVector(
const SeldonTranspose& trans,
372 const Vector<Tcplx>& x, Vector<Tcplx>& y)
const
375 static_cast<const Matrix<T, Prop, Storage, Allocator>&
>(*
this), x, y);
378 template <
class T,
class Prop,
class Storage,
class Allocator>
379 inline bool Matrix_TriangPacked<T, Prop, Storage, Allocator>
380 ::IsSymmetric()
const
401 template <
class T,
class Prop,
class Allocator>
414 template <
class T,
class Prop,
class Allocator>
430 template <
class T,
class Prop,
class Allocator>
447 template <
class T,
class Prop,
class Allocator>
461 template <
class T,
class Prop,
class Allocator>
466 for (
long i = 0; i < this->GetDataSize();i++)
488 template <
class T,
class Prop,
class Allocator>
501 template <
class T,
class Prop,
class Allocator>
517 template <
class T,
class Prop,
class Allocator>
534 template <
class T,
class Prop,
class Allocator>
548 template <
class T,
class Prop,
class Allocator>
553 for (
long i = 0; i < this->GetDataSize();i++)
575 template <
class T,
class Prop,
class Allocator>
588 template <
class T,
class Prop,
class Allocator>
604 template <
class T,
class Prop,
class Allocator>
621 template <
class T,
class Prop,
class Allocator>
635 template <
class T,
class Prop,
class Allocator>
640 for (
long i = 0; i < this->GetDataSize();i++)
662 template <
class T,
class Prop,
class Allocator>
675 template <
class T,
class Prop,
class Allocator>
691 template <
class T,
class Prop,
class Allocator>
708 template <
class T,
class Prop,
class Allocator>
722 template <
class T,
class Prop,
class Allocator>
727 for (
long i = 0; i < this->GetDataSize();i++)
736 #define SELDON_FILE_MATRIX_TRIANGPACKED_INLINE_CXX