26#ifndef _CXSC_IVECTOR_INL_INCLUDED
27#define _CXSC_IVECTOR_INL_INCLUDED
41 INLINE
ivector::ivector(
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_IVECTOR_WRONG_BOUNDARIES(
"ivector::ivector(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<l||i>u) cxscthrow(ERROR_IVECTOR_ELEMENT_NOT_IN_VEC(
"interval & ivector::operator [](const int &i) const"));
121 if(i<l||i>u) cxscthrow(ERROR_IVECTOR_ELEMENT_NOT_IN_VEC(
"interval & ivector::operator [](const int &i)"));
134 if(i<start||i>end) cxscthrow(ERROR_IVECTOR_ELEMENT_NOT_IN_VEC(
"interval & ivector_slice::operator [](const int &i) const"));
147 if(i<start||i>end) cxscthrow(ERROR_IVECTOR_ELEMENT_NOT_IN_VEC(
"interval & ivector_slice::operator [](const int &i)"));
161 if(1<l||i>u) cxscthrow(ERROR_IVECTOR_SUB_ARRAY_TOO_BIG(
"ivector_slice ivector::operator ()(const int &i)"));
174 if(i1<l||i2>u) cxscthrow(ERROR_IVECTOR_SUB_ARRAY_TOO_BIG(
"ivector_slice ivector::operator ()(const int &i1,const int &i2)"));
187 if(1<start||i>end) cxscthrow(ERROR_IVECTOR_SUB_ARRAY_TOO_BIG(
"ivector_slice ivector_slice::operator ()(const int &i)"));
200 if(i1<start||i2>end) cxscthrow(ERROR_IVECTOR_SUB_ARRAY_TOO_BIG(
"ivector_slice ivector_slice::operator ()(const int &i1,const int &i2)"));
213 if(rv.size>1) cxscthrow(ERROR_IVECTOR_TYPE_CAST_OF_THICK_OBJ(
"interval::interval(const ivector &rv)"));
214 else if(rv.size<1) cxscthrow(ERROR_IVECTOR_USE_OF_UNINITIALIZED_OBJ(
"interval::interval(const ivector &rv)"));
227 if(sl.size>1) cxscthrow(ERROR_IVECTOR_TYPE_CAST_OF_THICK_OBJ(
"interval::interval(const ivector_slice &sl)"));
228 else if(sl.size<1) cxscthrow(ERROR_IVECTOR_USE_OF_UNINITIALIZED_OBJ(
"interval::interval(const ivector_slice &sl)"));
230 *
this=sl.dat[sl.start-sl.l];
267 INLINE ivector::operator
void*()
noexcept {
return _vvoid(*
this); }
274 {
return _vsvsassign(*
this,sl); }
281 {
return _vsvassign(*
this,rv); }
289 {
return _vsvassign(*
this,
ivector(m)); }
296 {
return _vsvsassign(*
this,sl); }
303 {
return _vsvassign(*
this,rv); }
305 INLINE ivector_slice::operator
void*()
noexcept {
return _vsvoid(*
this); }
317 {
return _vvsetinf(iv,rv); }
324 {
return _vsvsetinf(iv,rv); }
331 {
return _vvssetinf(iv,rv); }
338 {
return _vsvssetinf(iv,rv); }
345 {
return _vvusetinf(iv,rv); }
352 {
return _vsvusetinf(iv,rv); }
359 {
return _vvsusetinf(iv,rv); }
366 {
return _vsvsusetinf(iv,rv); }
374 {
return _vvsetsup(iv,rv); }
381 {
return _vsvsetsup(iv,rv); }
388 {
return _vvssetsup(iv,rv); }
395 {
return _vsvssetsup(iv,rv); }
402 {
return _vvusetsup(iv,rv); }
409 {
return _vsvusetsup(iv,rv); }
416 {
return _vvsusetsup(iv,rv); }
423 {
return _vsvsusetsup(iv,rv); }
441 { _vresize<class ivector,class interval>(rv,len); }
448 { _vresize<class ivector,class interval>(rv,lb,ub); }
454 for(
int i=
Lb(rv) ; i<=
Ub(rv) ; i++)
458 INLINE rvector
absmin(
const ivector_slice &sl)
noexcept {
459 rvector x(
Lb(sl),
Ub(sl));
460 for(
int i=
Lb(sl) ; i<=
Ub(sl) ; i++)
464 INLINE rvector
absmax(
const ivector &rv)
noexcept {
465 rvector x(
Lb(rv),
Ub(rv));
466 for(
int i=
Lb(rv) ; i<=
Ub(rv) ; i++)
472 for(
int i=
Lb(sl) ; i<=
Ub(sl) ; i++)
480 INLINE
rvector Inf(
const ivector &v)
noexcept {
return _vinf<ivector,rvector>(v); }
482 INLINE
rvector Sup(
const ivector &v)
noexcept {
return _vsup<ivector,rvector>(v); }
484 INLINE
bool operator !(
const ivector &rv)
noexcept {
return _vnot(rv); }
485 INLINE
bool operator !(
const ivector_slice &sl)
noexcept {
return _vsnot(sl); }
528 INLINE std::ostream &operator <<(std::ostream &s,
const ivector &rv)
noexcept {
return _vout(s,rv); }
529 INLINE std::ostream &operator <<(std::ostream &o,
const ivector_slice &sl)
noexcept {
return _vsout(o,sl); }
530 INLINE std::istream &operator >>(std::istream &s,
ivector &rv)
noexcept {
return _vin(s,rv); }
531 INLINE std::istream &operator >>(std::istream &s,
ivector_slice &rv)
noexcept {
return _vsin(s,rv); }
543 {
return _vvimult<ivector,ivector,interval>(rv1,rv2); }
550 {
return _vsvimult<ivector_slice,ivector,interval>(sl,rv); }
557 {
return _vsvimult<ivector_slice,ivector,interval>(sl,rv); }
564 {
return _vsvsimult<ivector_slice,ivector_slice,interval>(sl1,sl2); }
574 {
return _vvplus<ivector,ivector,ivector>(rv1,rv2); }
581 {
return _vvsplus<ivector,ivector_slice,ivector>(rv,sl); }
588 {
return _vvsplus<ivector,ivector_slice,ivector>(rv,sl); }
595 {
return _vsvsplus<ivector_slice,ivector_slice,ivector>(sl1,sl2); }
602 {
return _vvplusassign(rv1,rv2); }
609 {
return _vvsplusassign(rv,sl); }
616 {
return _vsvplusassign(*
this,rv); }
623 {
return _vsvsplusassign(*
this,sl2); }
633 {
return _vvminus<ivector,ivector,ivector>(rv1,rv2); }
640 {
return _vvsminus<ivector,ivector_slice,ivector>(rv,sl); }
647 {
return _vsvminus<ivector_slice,ivector,ivector>(sl,rv); }
654 {
return _vsvsminus<ivector_slice,ivector_slice,ivector>(sl1,sl2); }
661 {
return _vvminusassign(rv1,rv2); }
668 {
return _vvsminusassign(rv,sl); }
675 {
return _vsvminusassign(*
this,rv); }
682 {
return _vsvsminusassign(*
this,sl2); }
690 {
return _vvconv<ivector,ivector,ivector>(rv1,rv2); }
697 {
return _vvsconv<ivector,ivector_slice,ivector>(rv,sl); }
704 {
return _vvsconv<ivector,ivector_slice,ivector>(rv,sl); }
711 {
return _vsvsconv<ivector_slice,ivector_slice,ivector>(sl1,sl2); }
718 {
return _vvconvassign(rv1,rv2); }
725 {
return _vvsconvassign(rv,sl); }
732 {
return _vsvconvassign(*
this,rv); }
739 {
return _vsvsconvassign(*
this,sl2); }
747 {
return _vvsect<ivector,ivector,ivector>(rv1,rv2); }
754 {
return _vvssect<ivector,ivector_slice,ivector>(rv,sl); }
761 {
return _vvssect<ivector,ivector_slice,ivector>(rv,sl); }
768 {
return _vsvssect<ivector_slice,ivector_slice,ivector>(sl1,sl2); }
775 {
return _vvsectassign(rv1,rv2); }
782 {
return _vvssectassign(rv,sl); }
789 {
return _vsvsectassign(*
this,rv); }
796 {
return _vsvssectassign(*
this,sl2); }
798 INLINE
bool operator ==(
const ivector &rv1,
const ivector &rv2)
noexcept {
return _vveq(rv1,rv2); }
802 INLINE
bool operator !=(
const ivector &rv1,
const ivector &rv2)
noexcept {
return _vvneq(rv1,rv2); }
806 INLINE
bool operator <(
const ivector &rv1,
const ivector &rv2)
noexcept {
return _vvless(rv1,rv2); }
810 INLINE
bool operator <=(
const ivector &rv1,
const ivector &rv2)
noexcept {
return _vvleq(rv1,rv2); }
814 INLINE
bool operator >(
const ivector &rv1,
const ivector &rv2)
noexcept {
return _vvless(rv2,rv1); }
818 INLINE
bool operator >=(
const ivector &rv1,
const ivector &rv2)
noexcept {
return _vvleq(rv2,rv1); }
834 {
return _vvimult<rvector,ivector,interval>(rv1,rv2); }
841 {
return _vsvimult<rvector_slice,ivector,interval>(sl,rv); }
848 {
return _vsvimult<ivector_slice,rvector,interval>(sl,rv); }
855 {
return _vsvsimult<rvector_slice,ivector_slice,interval>(sl1,sl2); }
863 {
return _vvimult<rvector,ivector,interval>(rv2,rv1); }
870 {
return _vsvimult<ivector_slice,rvector,interval>(sl,rv); }
877 {
return _vsvimult<rvector_slice,ivector,interval>(sl,rv); }
884 {
return _vsvsimult<rvector_slice,ivector_slice,interval>(sl2,sl1); }
892 {
return _vvplus<rvector,ivector,ivector>(rv1,rv2); }
899 {
return _vvsplus<rvector,ivector_slice,ivector>(rv,sl); }
906 {
return _vvsplus<ivector,rvector_slice,ivector>(rv,sl); }
913 {
return _vsvsplus<rvector_slice,ivector_slice,ivector>(sl1,sl2); }
921 {
return _vvplus<rvector,ivector,ivector>(rv2,rv1); }
928 {
return _vvsplus<ivector,rvector_slice,ivector>(rv,sl); }
935 {
return _vvsplus<rvector,ivector_slice,ivector>(rv,sl); }
942 {
return _vsvsplus<rvector_slice,ivector_slice,ivector>(sl2,sl1); }
950 {
return _vvplusassign(rv1,rv2); }
957 {
return _vvsplusassign(rv,sl); }
964 {
return _vsvplusassign(*
this,rv); }
971 {
return _vsvsplusassign(*
this,sl2); }
979 {
return _vvminus<rvector,ivector,ivector>(rv1,rv2); }
986 {
return _vvsminus<rvector,ivector_slice,ivector>(rv,sl); }
993 {
return _vsvminus<rvector_slice,ivector,ivector>(sl,rv); }
1000 {
return _vsvsminus<rvector_slice,ivector_slice,ivector>(sl1,sl2); }
1003#if(CXSC_INDEX_CHECK)
1008 {
return _vvminus<ivector,rvector,ivector>(rv1,rv2); }
1010#if(CXSC_INDEX_CHECK)
1015 {
return _vvsminus<ivector,rvector_slice,ivector>(rv,sl); }
1017#if(CXSC_INDEX_CHECK)
1022 {
return _vsvminus<ivector_slice,rvector,ivector>(sl,rv); }
1024#if(CXSC_INDEX_CHECK)
1029 {
return _vsvsminus<ivector_slice,rvector_slice,ivector>(sl1,sl2); }
1032#if(CXSC_INDEX_CHECK)
1037 {
return _vvminusassign(rv1,rv2); }
1039#if(CXSC_INDEX_CHECK)
1044 {
return _vvsminusassign(rv,sl); }
1046#if(CXSC_INDEX_CHECK)
1051 {
return _vsvminusassign(*
this,rv); }
1053#if(CXSC_INDEX_CHECK)
1058 {
return _vsvsminusassign(*
this,sl2); }
1061#if(CXSC_INDEX_CHECK)
1066 {
return _vvconv<rvector,rvector,ivector>(rv1,rv2); }
1068#if(CXSC_INDEX_CHECK)
1073 {
return _vvsconv<rvector,rvector_slice,ivector>(rv,sl); }
1075#if(CXSC_INDEX_CHECK)
1080 {
return _vvsconv<rvector,rvector_slice,ivector>(rv,sl); }
1082#if(CXSC_INDEX_CHECK)
1087 {
return _vsvsconv<rvector_slice,rvector_slice,ivector>(sl1,sl2); }
1089#if(CXSC_INDEX_CHECK)
1094 {
return _vvconv<rvector,ivector,ivector>(rv1,rv2); }
1096#if(CXSC_INDEX_CHECK)
1101 {
return _vvsconv<rvector,ivector_slice,ivector>(rv,sl); }
1103#if(CXSC_INDEX_CHECK)
1108 {
return _vvsconv<ivector,rvector_slice,ivector>(rv,sl); }
1110#if(CXSC_INDEX_CHECK)
1115 {
return _vsvsconv<rvector_slice,ivector_slice,ivector>(sl1,sl2); }
1118#if(CXSC_INDEX_CHECK)
1123 {
return _vvconv<rvector,ivector,ivector>(rv2,rv1); }
1125#if(CXSC_INDEX_CHECK)
1130 {
return _vvsconv<ivector,rvector_slice,ivector>(rv,sl); }
1132#if(CXSC_INDEX_CHECK)
1137 {
return _vvsconv<rvector,ivector_slice,ivector>(rv,sl); }
1139#if(CXSC_INDEX_CHECK)
1144 {
return _vsvsconv<rvector_slice,ivector_slice,ivector>(sl2,sl1); }
1147#if(CXSC_INDEX_CHECK)
1152 {
return _vvconvassign(rv1,rv2); }
1154#if(CXSC_INDEX_CHECK)
1159 {
return _vvsconvassign(rv,sl); }
1161#if(CXSC_INDEX_CHECK)
1166 {
return _vsvconvassign(*
this,rv); }
1168#if(CXSC_INDEX_CHECK)
1173 {
return _vsvsconvassign(*
this,sl2); }
1176#if(CXSC_INDEX_CHECK)
1181 {
return _vvsect<rvector,ivector,ivector>(rv1,rv2); }
1183#if(CXSC_INDEX_CHECK)
1188 {
return _vvssect<rvector,ivector_slice,ivector>(rv,sl); }
1190#if(CXSC_INDEX_CHECK)
1195 {
return _vvssect<ivector,rvector_slice,ivector>(rv,sl); }
1197#if(CXSC_INDEX_CHECK)
1202 {
return _vsvssect<rvector_slice,ivector_slice,ivector>(sl1,sl2); }
1205#if(CXSC_INDEX_CHECK)
1210 {
return _vvsect<rvector,ivector,ivector>(rv2,rv1); }
1212#if(CXSC_INDEX_CHECK)
1217 {
return _vvssect<ivector,rvector_slice,ivector>(rv,sl); }
1219#if(CXSC_INDEX_CHECK)
1224 {
return _vvssect<rvector,ivector_slice,ivector>(rv,sl); }
1226#if(CXSC_INDEX_CHECK)
1231 {
return _vsvssect<rvector_slice,ivector_slice,ivector>(sl2,sl1); }
1234#if(CXSC_INDEX_CHECK)
1239 {
return _vvsectassign(rv1,rv2); }
1241#if(CXSC_INDEX_CHECK)
1246 {
return _vvssectassign(rv,sl); }
1248#if(CXSC_INDEX_CHECK)
1253 {
return _vsvsectassign(*
this,rv); }
1255#if(CXSC_INDEX_CHECK)
1260 {
return _vsvssectassign(*
this,sl2); }
1266 for(
int i=0 ; i<
VecLen(x) ; i++)
1267 x[i+
Lb(x)] = (*this)[p[i+
Lb(p)]+
Lb(*
this)];
The Scalar Type interval.
interval()
Constructor of class interval.
The Data Type ivector_slice.
interval & operator[](const int &i) const noexcept
Operator for accessing the single elements of the vector (read-only)
ivector_slice & operator|=(const ivector &rv) noexcept
Allocates the convex hull of the arguments to the first argument.
ivector_slice & operator+=(const ivector &rv) noexcept
Implementation of addition and allocation operation.
ivector_slice & operator-=(const ivector &rv) noexcept
Implementation of subtraction and allocation operation.
ivector_slice & operator*=(const interval &r) noexcept
Implementation of multiplication and allocation operation.
ivector_slice & operator=(const sivector &sl)
Implementation of standard assigning operator.
ivector_slice & operator/=(const interval &r) noexcept
Implementation of division and allocation operation.
ivector_slice & operator&=(const ivector &rv) noexcept
Allocates the intersection of the arguments to the first argument.
ivector_slice & operator()() noexcept
Operator for accessing the whole vector.
ivector & operator=(const ivector &rv) noexcept
Implementation of standard assigning operator.
friend int Lb(const ivector &rv) noexcept
Returns the lower bound of the vector.
ivector & operator()() noexcept
Operator for accessing the whole vector.
ivector() noexcept
Constructor of class ivector.
interval & operator[](const int &i) const noexcept
Operator for accessing the single elements of the vector (read-only)
friend int VecLen(const ivector &rv) noexcept
Returns the dimension of the vector.
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.
INLINE ivector _ivector(const rmatrix &sl) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
civector operator/(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of division operation.
cvector diam(const cimatrix_subv &mv) noexcept
Returns the diameter of the matrix.
rvector absmax(const imatrix_subv &mv) noexcept
Returns the absolute maximum value of the matrix.
int Ub(const cimatrix &rm, const int &i) noexcept
Returns the upper bound index.
rvector absmin(const imatrix_subv &mv) noexcept
Returns the absolute minimum value of the matrix.
cimatrix & operator*=(cimatrix &m, const cinterval &c) noexcept
Implementation of multiplication and allocation operation.
real AbsMax(const interval &x)
Computes the greatest absolute value .
ivector abs(const cimatrix_subv &mv) noexcept
Returns the absolute value of the matrix.
cvector mid(const cimatrix_subv &mv) noexcept
Returns the middle 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_subv & SetUncheckedInf(cimatrix_subv &iv, const complex &r) noexcept
Returns the matrix with the new unchecked given infimum value.
int Lb(const cimatrix &rm, const int &i) noexcept
Returns the lower bound index.
real AbsMin(const interval &x)
Computes the smallest absolute value .
cimatrix & operator/=(cimatrix &m, const cinterval &c) noexcept
Implementation of division and allocation operation.