26 #ifndef _CXSC_INTVECTOR_INL_INCLUDED
27 #define _CXSC_INTVECTOR_INL_INCLUDED
29 #include "intvector.hpp"
45 dat=
new int[i._int()];
51 :l(i1),u(i2),size(i2-i1+1)
53 noexcept:l(i1),u(i2),size(i2-i1+1)
57 if(i1>i2) cxscthrow(ERROR_INTVECTOR_WRONG_BOUNDARIES(
"intvector::intvector(const int &i1,const int &i2)"));
65 for(
int i=0, j=l-rs.l;i<size;i++,j++)
72 for (
int i=0;i<size;i++)
84 if(i<start||i>end) cxscthrow(ERROR_INTVECTOR_ELEMENT_NOT_IN_VEC(
"int & intvector_slice::operator [](const int &i)"));
97 if(i<start||i>end) cxscthrow(ERROR_INTVECTOR_ELEMENT_NOT_IN_VEC(
"int & intvector_slice::operator [](const int &i)"));
103 #if(CXSC_INDEX_CHECK)
109 #if(CXSC_INDEX_CHECK)
110 if(i<l||i>u) cxscthrow(ERROR_INTVECTOR_ELEMENT_NOT_IN_VEC(
"int & intvector::operator [](const int &i)"));
116 #if(CXSC_INDEX_CHECK)
122 #if(CXSC_INDEX_CHECK)
123 if(i<l||i>u) cxscthrow(ERROR_INTVECTOR_ELEMENT_NOT_IN_VEC(
"int & intvector::operator [](const int &i)"));
135 #if(CXSC_INDEX_CHECK)
141 #if(CXSC_INDEX_CHECK)
142 if(1<l||i>u) cxscthrow(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG(
"intvector_slice intvector::operator ()(const int &i)"));
155 #if(CXSC_INDEX_CHECK)
161 #if(CXSC_INDEX_CHECK)
162 if(i1<l||i2>u) cxscthrow(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG(
"intvector_slice intvector::operator ()(const int &i1,const int &i2)"));
168 #if(CXSC_INDEX_CHECK)
174 #if(CXSC_INDEX_CHECK)
175 if(1<start||i>end) cxscthrow(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG(
"intvector_slice intvector_slice::operator ()(const int &i)"));
181 #if(CXSC_INDEX_CHECK)
187 #if(CXSC_INDEX_CHECK)
188 if(i1<start||i2>end) cxscthrow(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG(
"intvector_slice intvector_slice::operator ()(const int &i1,const int &i2)"));
195 INLINE intvector::operator
void*() noexcept {
return _vvoid(*
this); }
198 #if(CXSC_INDEX_CHECK)
203 {
return _vsvsassign<intvector_slice,intvector_slice>(*
this,sl); }
205 #if(CXSC_INDEX_CHECK)
210 {
return _vsvassign<intvector_slice,intvector>(*
this,rv); }
212 INLINE intvector_slice::operator
void*() noexcept {
return _vsvoid(*
this); }
224 #if(CXSC_INDEX_CHECK)
229 { _vresize<intvector,int>(rv,len); }
231 #if(CXSC_INDEX_CHECK)
236 { _vresize<intvector,int>(rv,lb,ub); }
240 INLINE
bool operator !(
const intvector &rv) noexcept {
return _vnot(rv); }
263 #if(CXSC_INDEX_CHECK)
268 { _vvaccu(dp,rv1,rv2); }
272 #if(CXSC_INDEX_CHECK)
277 { _vsvaccu(dp,sl,rv); }
279 #if(CXSC_INDEX_CHECK)
284 { _vsvaccu(dp,sl,rv); }
286 #if(CXSC_INDEX_CHECK)
291 { _vsvsaccu(dp,sl1,sl2); }
296 #if(CXSC_INDEX_CHECK)
301 {
return _vvplus<intvector,intvector,intvector>(rv1,rv2); }
303 #if(CXSC_INDEX_CHECK)
308 {
return _vvsplus<intvector,intvector_slice,intvector>(rv,sl); }
310 #if(CXSC_INDEX_CHECK)
315 {
return _vvsplus<intvector,intvector_slice,intvector>(rv,sl); }
317 #if(CXSC_INDEX_CHECK)
322 {
return _vsvsplus<intvector_slice,intvector_slice,intvector>(sl1,sl2); }
324 #if(CXSC_INDEX_CHECK)
329 {
return _vvplusassign(rv1,rv2); }
331 #if(CXSC_INDEX_CHECK)
336 {
return _vvsplusassign(rv,sl); }
338 #if(CXSC_INDEX_CHECK)
343 {
return _vsvplusassign(*
this,rv); }
345 #if(CXSC_INDEX_CHECK)
350 {
return _vsvsplusassign(*
this,sl2); }
355 #if(CXSC_INDEX_CHECK)
360 {
return _vvminus<intvector,intvector,intvector>(rv1,rv2); }
362 #if(CXSC_INDEX_CHECK)
367 {
return _vvsminus<intvector,intvector_slice,intvector>(rv,sl); }
369 #if(CXSC_INDEX_CHECK)
374 {
return _vsvminus<intvector_slice,intvector,intvector>(sl,rv); }
376 #if(CXSC_INDEX_CHECK)
381 {
return _vsvsminus<intvector_slice,intvector_slice,intvector>(sl1,sl2); }
383 #if(CXSC_INDEX_CHECK)
388 {
return _vvminusassign(rv1,rv2); }
390 #if(CXSC_INDEX_CHECK)
395 {
return _vvsminusassign(rv,sl); }
397 #if(CXSC_INDEX_CHECK)
402 {
return _vsvminusassign(*
this,rv); }
404 #if(CXSC_INDEX_CHECK)
409 {
return _vsvsminusassign(*
this,sl2); }
411 INLINE
bool operator ==(
const intvector &rv1,
const intvector &rv2) noexcept {
return _vveq(rv1,rv2); }
415 INLINE
bool operator !=(
const intvector &rv1,
const intvector &rv2) noexcept {
return _vvneq(rv1,rv2); }
419 INLINE
bool operator <(
const intvector &rv1,
const intvector &rv2) noexcept {
return _vvless(rv1,rv2); }
423 INLINE
bool operator <=(
const intvector &rv1,
const intvector &rv2) noexcept {
return _vvleq(rv1,rv2); }
427 INLINE
bool operator >(
const intvector &rv1,
const intvector &rv2) noexcept {
return _vvless(rv2,rv1); }
431 INLINE
bool operator >=(
const intvector &rv1,
const intvector &rv2) noexcept {
return _vvleq(rv2,rv1); }
436 INLINE std::ostream &operator <<(std::ostream &s,
const intvector &rv) noexcept {
return _vout(s,rv); }
437 INLINE std::ostream &operator <<(std::ostream &o,
const intvector_slice &sl) noexcept {
return _vsout(o,sl); }
438 INLINE std::istream &operator >>(std::istream &s,
intvector &rv) noexcept {
return _vin(s,rv); }
439 INLINE std::istream &operator >>(std::istream &s,
intvector_slice &rv) noexcept {
return _vsin(s,rv); }
441 INLINE intvector perminv(
const intvector& x) {
443 for(
int i=0 ; i<
VecLen(x) ; i++)
The Data Type dotprecision.
The Data Type intvector_slice.
intvector_slice & operator-=(const intvector &rv) noexcept
Implementation of subtraction and allocation operation.
intvector_slice & operator+=(const intvector &rv) noexcept
Implementation of addition and allocation operation.
intvector_slice & operator()() noexcept
Operator for accessing the whole vector.
intvector_slice & operator/=(const int &r) noexcept
Implementation of division and allocation operation.
int & operator[](const int &i) noexcept
Operator for accessing the single elements of the vector.
intvector_slice & operator*=(const int &r) noexcept
Implementation of multiplication and allocation operation.
intvector_slice & operator=(const intvector_slice &sl) noexcept
Constructor of class intvector_slice.
intvector() noexcept
Constructor of class intvector.
int & operator[](const int &i) noexcept
Operator for accessing the single elements of the vector.
intvector & operator=(const intvector &rv) noexcept
Implementation of standard assigning operator.
intvector & operator()() noexcept
Operator for accessing the whole vector.
The namespace cxsc, providing all functionality of the class library C-XSC.
int VecLen(const scimatrix_subv &S)
Returns the length of the subvector.
civector operator/(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of division operation.
intvector _intvector(const int &r) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc) noexcept
Implementation of standard algebraic addition and allocation 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.
int Lb(const cimatrix &rm, const int &i) noexcept
Returns the lower bound index.
cimatrix & operator/=(cimatrix &m, const cinterval &c) noexcept
Implementation of division and allocation operation.