26#ifndef _CXSC_CVECTOR_INL_INCLUDED
27#define _CXSC_CVECTOR_INL_INCLUDED
41 INLINE
cvector::cvector(
const class index &i)
noexcept:l(1),u(i._int()),size(i._int())
49 :l(i1),u(i2),size(i2-i1+1)
51 noexcept:l(i1),u(i2),size(i2-i1+1)
55 if(i1>i2) cxscthrow(ERROR_CVECTOR_WRONG_BOUNDARIES(
"cvector::cvector(const int &i1,const int &i2)"));
63 for(
int i=0, j=l-rs.l;i<size;i++,j++)
70 for (
int i=0;i<size;i++)
83 for(
int i=0, j=l-rs.l;i<size;i++,j++)
90 for (
int i=0;i<size;i++)
108 if(i<start||i>end) cxscthrow(ERROR_CVECTOR_ELEMENT_NOT_IN_VEC(
"complex & cvector_slice::operator [](const int &i) const"));
121 if(i<start||i>end) cxscthrow(ERROR_CVECTOR_ELEMENT_NOT_IN_VEC(
"complex & cvector_slice::operator [](const int &i)"));
134 if(i<l||i>u) cxscthrow(ERROR_CVECTOR_ELEMENT_NOT_IN_VEC(
"complex & cvector::operator [](const int &i) const"));
147 if(i<l||i>u) cxscthrow(ERROR_CVECTOR_ELEMENT_NOT_IN_VEC(
"complex & cvector::operator [](const int &i)"));
167 if(1<l||i>u) cxscthrow(ERROR_CVECTOR_SUB_ARRAY_TOO_BIG(
"cvector_slice cvector::operator ()(const int &i)"));
187 if(i1<l||i2>u) cxscthrow(ERROR_CVECTOR_SUB_ARRAY_TOO_BIG(
"cvector_slice cvector::operator ()(const int &i1,const int &i2)"));
200 if(1<start||i>end) cxscthrow(ERROR_CVECTOR_SUB_ARRAY_TOO_BIG(
"cvector_slice cvector_slice::operator ()(const int &i)"));
213 if(i1<start||i2>end) cxscthrow(ERROR_CVECTOR_SUB_ARRAY_TOO_BIG(
"cvector_slice cvector_slice::operator ()(const int &i1,const int &i2)"));
226 if(rv.size>1) cxscthrow(ERROR_CVECTOR_TYPE_CAST_OF_THICK_OBJ(
"complex::complex(const cvector &rv)"));
227 else if(rv.size<1) cxscthrow(ERROR_CVECTOR_USE_OF_UNINITIALIZED_OBJ(
"complex::complex(const cvector &rv)"));
240 if(sl.size>1) cxscthrow(ERROR_CVECTOR_TYPE_CAST_OF_THICK_OBJ(
"complex::complex(const cvector_slice &sl)"));
241 else if(sl.size<1) cxscthrow(ERROR_CVECTOR_USE_OF_UNINITIALIZED_OBJ(
"complex::complex(const cvector_slice &sl)"));
243 *
this=sl.dat[sl.start-sl.l];
280 INLINE cvector::operator
void*()
noexcept {
return _vvoid(*
this); }
287 {
return _vsvsassign(*
this,sl); }
294 {
return _vsvassign(*
this,rv); }
302 {
return _vsvassign(*
this,
cvector(m)); }
309 {
return _vsvsassign(*
this,sl); }
316 {
return _vsvassign(*
this,rv); }
318 INLINE cvector_slice::operator
void*()
noexcept {
return _vsvoid(*
this); }
336 {
return _vsvsetre(iv,rv); }
343 {
return _vvssetre(iv,rv); }
350 {
return _vsvssetre(iv,rv); }
358 {
return _vvsetim(iv,rv); }
365 {
return _vsvsetim(iv,rv); }
372 {
return _vvssetim(iv,rv); }
379 {
return _vsvssetim(iv,rv); }
393 { _vresize<class cvector,class complex>(rv,len); }
400 { _vresize<class cvector,class complex>(rv,lb,ub); }
407 INLINE
rvector Im(
const cvector &v)
noexcept {
return _vim<cvector,rvector>(v); }
409 INLINE
rvector Re(
const cvector &v)
noexcept {
return _vre<cvector,rvector>(v); }
411 INLINE
bool operator !(
const cvector &rv)
noexcept {
return _vnot(rv); }
412 INLINE
bool operator !(
const cvector_slice &sl)
noexcept {
return _vsnot(sl); }
455 INLINE std::ostream &operator <<(std::ostream &s,
const cvector &rv)
noexcept {
return _vout(s,rv); }
456 INLINE std::ostream &operator <<(std::ostream &o,
const cvector_slice &sl)
noexcept {
return _vsout(o,sl); }
457 INLINE std::istream &operator >>(std::istream &s,
cvector &rv)
noexcept {
return _vin(s,rv); }
458 INLINE std::istream &operator >>(std::istream &s,
cvector_slice &rv)
noexcept {
return _vsin(s,rv); }
471 {
return _vvcmult<cvector,cvector,complex>(rv1,rv2); }
478 {
return _vsvcmult<cvector_slice,cvector,complex>(sl,rv); }
485 {
return _vsvcmult<cvector_slice,cvector,complex>(sl,rv); }
492 {
return _vsvscmult<cvector_slice,cvector_slice,complex>(sl1,sl2); }
502 {
return _vvplus<cvector,cvector,cvector>(rv1,rv2); }
509 {
return _vvsplus<cvector,cvector_slice,cvector>(rv,sl); }
516 {
return _vvsplus<cvector,cvector_slice,cvector>(rv,sl); }
523 {
return _vsvsplus<cvector_slice,cvector_slice,cvector>(sl1,sl2); }
530 {
return _vvplusassign(rv1,rv2); }
537 {
return _vvsplusassign(rv,sl); }
544 {
return _vsvplusassign(*
this,rv); }
551 {
return _vsvsplusassign(*
this,sl2); }
561 {
return _vvminus<cvector,cvector,cvector>(rv1,rv2); }
568 {
return _vvsminus<cvector,cvector_slice,cvector>(rv,sl); }
575 {
return _vsvminus<cvector_slice,cvector,cvector>(sl,rv); }
582 {
return _vsvsminus<cvector_slice,cvector_slice,cvector>(sl1,sl2); }
589 {
return _vvminusassign(rv1,rv2); }
596 {
return _vvsminusassign(rv,sl); }
603 {
return _vsvminusassign(*
this,rv); }
610 {
return _vsvsminusassign(*
this,sl2); }
612 INLINE
bool operator ==(
const cvector &rv1,
const cvector &rv2)
noexcept {
return _vveq(rv1,rv2); }
616 INLINE
bool operator !=(
const cvector &rv1,
const cvector &rv2)
noexcept {
return _vvneq(rv1,rv2); }
648 {
return _vvcmult<rvector,cvector,complex>(rv1,rv2); }
655 {
return _vsvcmult<rvector_slice,cvector,complex>(sl,rv); }
662 {
return _vsvcmult<cvector_slice,rvector,complex>(sl,rv); }
669 {
return _vsvscmult<rvector_slice,cvector_slice,complex>(sl1,sl2); }
677 {
return _vvcmult<rvector,cvector,complex>(rv2,rv1); }
684 {
return _vsvcmult<cvector_slice,rvector,complex>(sl,rv); }
691 {
return _vsvcmult<rvector_slice,cvector,complex>(sl,rv); }
698 {
return _vsvscmult<rvector_slice,cvector_slice,complex>(sl2,sl1); }
706 {
return _vvplus<rvector,cvector,cvector>(rv1,rv2); }
713 {
return _vvsplus<rvector,cvector_slice,cvector>(rv,sl); }
720 {
return _vvsplus<cvector,rvector_slice,cvector>(rv,sl); }
727 {
return _vsvsplus<rvector_slice,cvector_slice,cvector>(sl1,sl2); }
735 {
return _vvplus<rvector,cvector,cvector>(rv2,rv1); }
742 {
return _vvsplus<cvector,rvector_slice,cvector>(rv,sl); }
749 {
return _vvsplus<rvector,cvector_slice,cvector>(rv,sl); }
756 {
return _vsvsplus<rvector_slice,cvector_slice,cvector>(sl2,sl1); }
764 {
return _vvplusassign(rv1,rv2); }
771 {
return _vvsplusassign(rv,sl); }
778 {
return _vsvplusassign(*
this,rv); }
785 {
return _vsvsplusassign(*
this,sl2); }
793 {
return _vvminus<rvector,cvector,cvector>(rv1,rv2); }
800 {
return _vvsminus<rvector,cvector_slice,cvector>(rv,sl); }
807 {
return _vsvminus<rvector_slice,cvector,cvector>(sl,rv); }
814 {
return _vsvsminus<rvector_slice,cvector_slice,cvector>(sl1,sl2); }
822 {
return _vvminus<cvector,rvector,cvector>(rv1,rv2); }
829 {
return _vvsminus<cvector,rvector_slice,cvector>(rv,sl); }
836 {
return _vsvminus<cvector_slice,rvector,cvector>(sl,rv); }
843 {
return _vsvsminus<cvector_slice,rvector_slice,cvector>(sl1,sl2); }
851 {
return _vvminusassign(rv1,rv2); }
858 {
return _vvsminusassign(rv,sl); }
865 {
return _vsvminusassign(*
this,rv); }
872 {
return _vsvsminusassign(*
this,sl2); }
877 for(
int i=0 ; i<
VecLen(x) ; i++)
878 x[i+
Lb(x)] = (*this)[p[i+
Lb(p)]+
Lb(*
this)];
complex(void) noexcept
Constructor of class complex.
The Data Type cvector_slice.
cvector_slice & operator()() noexcept
Operator for accessing the whole vector.
cvector_slice & operator/=(const complex &r) noexcept
Implementation of division and allocation operation.
cvector_slice & operator-=(const cvector &rv) noexcept
Implementation of subtraction and allocation operation.
cvector_slice & operator+=(const cvector &rv) noexcept
Implementation of addition and allocation operation.
cvector_slice & operator=(const scvector &sl)
Implementation of standard assigning operator.
cvector_slice & operator*=(const complex &r) noexcept
Implementation of multiplication and allocation operation.
complex & operator[](const int &i) const noexcept
Operator for accessing the single elements of the vector (read-only)
friend int Lb(const cvector &rv) noexcept
Returns the lower bound of the vector.
cvector() noexcept
Constructor of class cvector.
friend int VecLen(const cvector &rv) noexcept
Returns the dimension of the vector.
cvector & operator=(const cvector &rv) noexcept
Implementation of standard assigning operator.
cvector & operator()() noexcept
Operator for accessing the whole vector.
complex & operator[](const int &i) const noexcept
Operator for accessing the single elements of the vector (read-only)
The Data Type rmatrix_subv.
The Data Type rvector_slice.
The namespace cxsc, providing all functionality of the class library C-XSC.
cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc) noexcept
Implementation of standard algebraic addition and allocation operation.
civector operator/(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of division operation.
cimatrix & operator*=(cimatrix &m, const cinterval &c) noexcept
Implementation of multiplication and allocation operation.
ivector abs(const cimatrix_subv &mv) noexcept
Returns the absolute value of the matrix.
civector operator*(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of multiplication operation.
void Resize(cimatrix &A) noexcept
Resizes the matrix.
cimatrix & operator/=(cimatrix &m, const cinterval &c) noexcept
Implementation of division and allocation operation.