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)"));
110 if(i<l||i>u) cxscthrow(ERROR_INTVECTOR_ELEMENT_NOT_IN_VEC(
"int & intvector::operator [](const int &i)"));
123 if(i<l||i>u) cxscthrow(ERROR_INTVECTOR_ELEMENT_NOT_IN_VEC(
"int & intvector::operator [](const int &i)"));
142 if(1<l||i>u) cxscthrow(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG(
"intvector_slice intvector::operator ()(const int &i)"));
162 if(i1<l||i2>u) cxscthrow(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG(
"intvector_slice intvector::operator ()(const int &i1,const int &i2)"));
175 if(1<start||i>end) cxscthrow(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG(
"intvector_slice intvector_slice::operator ()(const int &i)"));
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); }
203 {
return _vsvsassign<intvector_slice,intvector_slice>(*
this,sl); }
210 {
return _vsvassign<intvector_slice,intvector>(*
this,rv); }
212 INLINE intvector_slice::operator
void*()
noexcept {
return _vsvoid(*
this); }
229 { _vresize<intvector,int>(rv,len); }
236 { _vresize<intvector,int>(rv,lb,ub); }
240 INLINE
bool operator !(
const intvector &rv)
noexcept {
return _vnot(rv); }
268 { _vvaccu(dp,rv1,rv2); }
277 { _vsvaccu(dp,sl,rv); }
284 { _vsvaccu(dp,sl,rv); }
291 { _vsvsaccu(dp,sl1,sl2); }
301 {
return _vvplus<intvector,intvector,intvector>(rv1,rv2); }
308 {
return _vvsplus<intvector,intvector_slice,intvector>(rv,sl); }
315 {
return _vvsplus<intvector,intvector_slice,intvector>(rv,sl); }
322 {
return _vsvsplus<intvector_slice,intvector_slice,intvector>(sl1,sl2); }
329 {
return _vvplusassign(rv1,rv2); }
336 {
return _vvsplusassign(rv,sl); }
343 {
return _vsvplusassign(*
this,rv); }
350 {
return _vsvsplusassign(*
this,sl2); }
360 {
return _vvminus<intvector,intvector,intvector>(rv1,rv2); }
367 {
return _vvsminus<intvector,intvector_slice,intvector>(rv,sl); }
374 {
return _vsvminus<intvector_slice,intvector,intvector>(sl,rv); }
381 {
return _vsvsminus<intvector_slice,intvector_slice,intvector>(sl1,sl2); }
388 {
return _vvminusassign(rv1,rv2); }
395 {
return _vvsminusassign(rv,sl); }
402 {
return _vsvminusassign(*
this,rv); }
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/=(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()() noexcept
Operator for accessing the whole 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()() noexcept
Operator for accessing the whole vector.
intvector & operator=(const intvector &rv) noexcept
Implementation of standard assigning operator.
The namespace cxsc, providing all functionality of the class library C-XSC.
int VecLen(const scimatrix_subv &S)
Returns the length of the subvector.
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.
intvector _intvector(const int &r) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
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.