26 #ifndef _CXSC_INTVECTOR_HPP_INCLUDED
27 #define _CXSC_INTVECTOR_HPP_INCLUDED
29 #include "xscclass.hpp"
43 class intvector_slice;
58 #ifdef _CXSC_FRIEND_TPL
59 template <
class V,
class MS,
class S>
friend void _vmsconstr(V &v,
const MS &m)
65 template <
class V,
class M,
class S>
friend void _vmconstr(V &v,
const M &m)
71 template <
class V>
friend void _vresize(V &rv) noexcept;
72 template <
class V,
class S>
friend void _vresize(V &rv,
const int &len)
78 template <
class V,
class S>
friend void _vresize(V &rv,
const int &lb,
const int &ub)
84 template <
class V1,
class V2,
class S>
friend V1 &_vvassign(V1 &rv1,
const V2 &rv2) noexcept;
85 template <
class V,
class S>
friend V & _vsassign(V &rv,
const S &r) noexcept;
86 template <
class V,
class VS,
class S>
friend V & _vvsassign(V &rv,
const VS &sl) noexcept;
87 template <
class VS,
class V>
friend VS & _vsvassign(VS &sl,
const V &rv)
93 template <
class V,
class M,
class S>
friend V &_vmassign(V &v,
const M &m)
99 template <
class M,
class V,
class S>
friend M &_mvassign(M &m,
const V &v) noexcept;
100 template <
class MV,
class V>
friend MV &_mvvassign(MV &v,
const V &rv)
101 #if(CXSC_INDEX_CHECK)
106 template <
class MV,
class V>
friend V _mvabs(
const MV &mv) noexcept;
109 template <
class DP,
class V1,
class V2>
friend void _vvaccu(DP &dp,
const V1 & rv1,
const V2 &rv2)
110 #if(CXSC_INDEX_CHECK)
115 template <
class DP,
class VS,
class V>
friend void _vsvaccu(DP &dp,
const VS & sl,
const V &rv)
116 #if(CXSC_INDEX_CHECK)
121 template <
class V,
class S>
friend V &_vsmultassign(V &rv,
const S &r) noexcept;
122 template <
class VS,
class S>
friend VS &_vssmultassign(VS &rv,
const S &r) noexcept;
123 template <
class VS,
class S>
friend VS &_vssdivassign(VS &rv,
const S &r) noexcept;
124 template <
class V1,
class V2,
class E>
friend E _vvplus(
const V1 &rv1,
const V2 &rv2)
125 #if(CXSC_INDEX_CHECK)
130 template <
class V,
class VS,
class E>
friend E _vvsplus(
const V &rv,
const VS &sl)
131 #if(CXSC_INDEX_CHECK)
136 template <
class VS1,
class VS2,
class E>
friend E _vsvsplus(
const VS1 &s1,
const VS2 &s2)
137 #if(CXSC_INDEX_CHECK)
142 template <
class VS1,
class VS2,
class E>
friend E _vsvsminus(
const VS1 &s1,
const VS2 &s2)
143 #if(CXSC_INDEX_CHECK)
148 template <
class V1,
class V2>
friend V1 &_vvplusassign(V1 &rv1,
const V2 &rv2)
149 #if(CXSC_INDEX_CHECK)
154 template <
class V,
class VS>
friend V &_vvsplusassign(V &rv,
const VS &sl)
155 #if(CXSC_INDEX_CHECK)
160 template <
class VS,
class V>
friend VS &_vsvplusassign(VS &sl,
const V &rv)
161 #if(CXSC_INDEX_CHECK)
166 template <
class VS1,
class VS2>
friend VS1 &_vsvsplusassign(VS1 &sl1,
const VS2 &sl2)
167 #if(CXSC_INDEX_CHECK)
172 template <
class VS1,
class VS2>
friend VS1 &_vsvsminusassign(VS1 &sl1,
const VS2 &sl2)
173 #if(CXSC_INDEX_CHECK)
178 template <
class V1,
class V2>
friend V1 &_vvminusassign(V1 &rv1,
const V2 &rv2)
179 #if(CXSC_INDEX_CHECK)
184 template <
class V,
class VS>
friend V &_vvsminusassign(V &rv,
const VS &sl)
185 #if(CXSC_INDEX_CHECK)
190 template <
class VS,
class V>
friend VS &_vsvminusassign(VS &sl,
const V &rv)
191 #if(CXSC_INDEX_CHECK)
196 template <
class V>
friend V _vminus(
const V &rv) noexcept;
197 template <
class VS,
class V>
friend V _vsminus(
const VS &sl) noexcept;
198 template <
class V1,
class V2,
class E>
friend E _vvminus(
const V1 &rv1,
const V2 &rv2)
199 #if(CXSC_INDEX_CHECK)
204 template <
class V,
class VS,
class E>
friend E _vvsminus(
const V &rv,
const VS &sl)
205 #if(CXSC_INDEX_CHECK)
210 template <
class VS,
class V,
class E>
friend E _vsvminus(
const VS &sl,
const V &rv)
211 #if(CXSC_INDEX_CHECK)
216 template <
class MV1,
class MV2,
class E>
friend E _mvmvplus(
const MV1 &rv1,
const MV2 &rv2)
217 #if(CXSC_INDEX_CHECK)
222 template <
class MV,
class V,
class E>
friend E _mvvplus(
const MV &rv1,
const V &rv2)
223 #if(CXSC_INDEX_CHECK)
228 template <
class MV,
class V,
class E>
friend E _mvvminus(
const MV &rv1,
const V &rv2)
229 #if(CXSC_INDEX_CHECK)
234 template <
class V,
class MV,
class E>
friend E _vmvminus(
const V &rv1,
const MV &rv2)
235 #if(CXSC_INDEX_CHECK)
240 template <
class MV1,
class MV2,
class E>
friend E _mvmvminus(
const MV1 &rv1,
const MV2 &rv2)
241 #if(CXSC_INDEX_CHECK)
246 template <
class MV,
class V>
friend MV &_mvvplusassign(MV &v,
const V &rv)
247 #if(CXSC_INDEX_CHECK)
252 template <
class MV,
class V>
friend MV &_mvvminusassign(MV &v,
const V &rv)
253 #if(CXSC_INDEX_CHECK)
260 template <
class DP,
class V,
class SV>
friend void _vmvaccu(DP &dp,
const V & rv1,
const SV &rv2)
261 #if(CXSC_INDEX_CHECK)
267 template <
class V,
class S,
class E>
friend E _vsdiv(
const V &rv,
const S &s) noexcept;
268 template <
class V,
class S>
friend V &_vsdivassign(V &rv,
const S &r) noexcept;
269 template <
class VS,
class S,
class E>
friend E _vssdiv(
const VS &sl,
const S &s) noexcept;
270 template <
class MV,
class S,
class E>
friend E _mvsmult(
const MV &rv,
const S &s) noexcept;
271 template <
class V,
class S,
class E>
friend E _vsmult(
const V &rv,
const S &s) noexcept;
272 template <
class VS,
class S,
class E>
friend E _vssmult(
const VS &sl,
const S &s) noexcept;
273 template <
class V1,
class V2>
friend bool _vveq(
const V1 &rv1,
const V2 &rv2) noexcept;
274 template <
class VS,
class V>
friend bool _vsveq(
const VS &sl,
const V &rv) noexcept;
275 template <
class V1,
class V2>
friend bool _vvneq(
const V1 &rv1,
const V2 &rv2) noexcept;
276 template <
class VS,
class V>
friend bool _vsvneq(
const VS &sl,
const V &rv) noexcept;
277 template <
class V1,
class V2>
friend bool _vvless(
const V1 &rv1,
const V2 &rv2) noexcept;
278 template <
class VS,
class V>
friend bool _vsvless(
const VS &sl,
const V &rv) noexcept;
279 template <
class V1,
class V2>
friend bool _vvleq(
const V1 &rv1,
const V2 &rv2) noexcept;
280 template <
class VS,
class V>
friend bool _vsvleq(
const VS &sl,
const V &rv) noexcept;
281 template <
class V,
class VS>
friend bool _vvsless(
const V &rv,
const VS &sl) noexcept;
282 template <
class V,
class VS>
friend bool _vvsleq(
const V &rv,
const VS &sl) noexcept;
283 template <
class V>
friend bool _vnot(
const V &rv) noexcept;
284 template <
class V>
friend void *_vvoid(
const V &rv) noexcept;
285 template <
class V,
class E>
friend E _vabs(
const V &rv) noexcept;
286 template <
class VS,
class E>
friend E _vsabs(
const VS &sl) noexcept;
287 template <
class VS1,
class VS2>
friend bool _vsvseq(
const VS1 &sl1,
const VS2 &sl2) noexcept;
288 template <
class VS1,
class VS2>
friend bool _vsvsneq(
const VS1 &sl1,
const VS2 &sl2) noexcept;
289 template <
class VS1,
class VS2>
friend bool _vsvsless(
const VS1 &sl1,
const VS2 &sl2) noexcept;
290 template <
class VS1,
class VS2>
friend bool _vsvsleq(
const VS1 &sl1,
const VS2 &sl2) noexcept;
291 template <
class VS>
friend bool _vsnot(
const VS &sl) noexcept;
292 template <
class VS>
friend void *_vsvoid(
const VS &sl) noexcept;
293 template <
class V>
friend std::ostream &_vout(std::ostream &s,
const V &rv) noexcept;
294 template <
class V>
friend std::istream &_vin(std::istream &s, V &rv) noexcept;
296 template <
class V,
class MV2,
class S>
friend V &_vmvassign(V &v,
const MV2 &rv) noexcept;
297 template <
class MV,
class S,
class E>
friend E _mvsdiv(
const MV &rv,
const S &s) noexcept;
311 explicit INLINE
intvector(
const class index &i) noexcept;
314 explicit INLINE
intvector(
const int &i1,
const int &i2)
315 #if(CXSC_INDEX_CHECK)
323 explicit INLINE
intvector(
const int &) noexcept;
326 #if(CXSC_INDEX_CHECK)
333 #if(CXSC_INDEX_CHECK)
350 #if(CXSC_INDEX_CHECK)
357 #if(CXSC_INDEX_CHECK)
371 friend INLINE
int Lb(
const intvector &rv) noexcept {
return rv.l; }
373 friend INLINE
int Ub(
const intvector &rv) noexcept {
return rv.u; }
382 #if(CXSC_INDEX_CHECK)
389 #if(CXSC_INDEX_CHECK)
398 #if(CXSC_INDEX_CHECK)
405 #if(CXSC_INDEX_CHECK)
411 INLINE
operator void*() noexcept;
433 #ifdef _CXSC_FRIEND_TPL
435 template <
class VS1,
class VS2>
friend VS1 & _vsvsassign(VS1 &sl1,
const VS2 &sl2)
436 #if(CXSC_INDEX_CHECK)
441 template <
class V,
class VS,
class S>
friend V & _vvsassign(V &rv,
const VS &sl) noexcept;
442 template <
class VS,
class V>
friend VS & _vsvassign(VS &sl,
const V &rv)
443 #if(CXSC_INDEX_CHECK)
448 template <
class VS,
class S>
friend VS & _vssassign(VS &sl,
const S &r) noexcept;
450 template <
class VS,
class S>
friend VS &_vssmultassign(VS &rv,
const S &r) noexcept;
451 template <
class VS,
class S>
friend VS &_vssdivassign(VS &rv,
const S &r) noexcept;
453 template <
class VS,
class V>
friend bool _vsveq(
const VS &sl,
const V &rv) noexcept;
454 template <
class VS,
class V>
friend bool _vsvneq(
const VS &sl,
const V &rv) noexcept;
455 template <
class VS,
class V>
friend bool _vsvless(
const VS &sl,
const V &rv) noexcept;
456 template <
class VS,
class V>
friend bool _vsvleq(
const VS &sl,
const V &rv) noexcept;
457 template <
class V,
class VS>
friend bool _vvsless(
const V &rv,
const VS &sl) noexcept;
458 template <
class V,
class VS>
friend bool _vvsleq(
const V &rv,
const VS &sl) noexcept;
459 template <
class VS,
class E>
friend E _vsabs(
const VS &sl) noexcept;
460 template <
class VS1,
class VS2>
friend bool _vsvseq(
const VS1 &sl1,
const VS2 &sl2) noexcept;
461 template <
class VS1,
class VS2>
friend bool _vsvsneq(
const VS1 &sl1,
const VS2 &sl2) noexcept;
462 template <
class VS1,
class VS2>
friend bool _vsvsless(
const VS1 &sl1,
const VS2 &sl2) noexcept;
463 template <
class VS1,
class VS2>
friend bool _vsvsleq(
const VS1 &sl1,
const VS2 &sl2) noexcept;
464 template <
class VS>
friend bool _vsnot(
const VS &sl) noexcept;
465 template <
class VS>
friend void *_vsvoid(
const VS &sl) noexcept;
466 template <
class V>
friend std::ostream &_vsout(std::ostream &s,
const V &rv) noexcept;
467 template <
class V>
friend std::istream &_vsin(std::istream &s, V &rv) noexcept;
470 template <
class DP,
class VS,
class V>
friend void _vsvaccu(DP &dp,
const VS & sl,
const V &rv)
471 #if(CXSC_INDEX_CHECK)
476 template <
class DP,
class VS1,
class VS2>
friend void _vsvsaccu(DP &dp,
const VS1 & sl1,
const VS2 &sl2)
477 #if(CXSC_INDEX_CHECK)
482 template <
class VS,
class S,
class E>
friend E _vssdiv(
const VS &sl,
const S &s) noexcept;
483 template <
class VS,
class S,
class E>
friend E _vssmult(
const VS &sl,
const S &s) noexcept;
484 template <
class VS,
class V,
class E>
friend E _vsvmult(
const VS & sl,
const V &rv)
485 #if(CXSC_INDEX_CHECK)
490 template <
class V,
class VS,
class E>
friend E _vvsplus(
const V &rv,
const VS &sl)
491 #if(CXSC_INDEX_CHECK)
496 template <
class VS1,
class VS2,
class E>
friend E _vsvsplus(
const VS1 &s1,
const VS2 &s2)
497 #if(CXSC_INDEX_CHECK)
502 template <
class VS1,
class VS2,
class E>
friend E _vsvsminus(
const VS1 &s1,
const VS2 &s2)
503 #if(CXSC_INDEX_CHECK)
508 template <
class V,
class VS>
friend V &_vvsplusassign(V &rv,
const VS &sl)
509 #if(CXSC_INDEX_CHECK)
514 template <
class VS,
class V>
friend VS &_vsvplusassign(VS &sl,
const V &rv)
515 #if(CXSC_INDEX_CHECK)
520 template <
class VS1,
class VS2>
friend VS1 &_vsvsplusassign(VS1 &sl1,
const VS2 &sl2)
521 #if(CXSC_INDEX_CHECK)
526 template <
class VS1,
class VS2>
friend VS1 &_vsvsminusassign(VS1 &sl1,
const VS2 &sl2)
527 #if(CXSC_INDEX_CHECK)
532 template <
class V,
class VS>
friend V &_vvsminusassign(V &rv,
const VS &sl)
533 #if(CXSC_INDEX_CHECK)
538 template <
class VS,
class V>
friend VS &_vsvminusassign(VS &sl,
const V &rv)
539 #if(CXSC_INDEX_CHECK)
544 template <
class VS,
class V>
friend V _vsminus(
const VS &sl) noexcept;
545 template <
class V,
class VS,
class E>
friend E _vvsminus(
const V &rv,
const VS &sl)
546 #if(CXSC_INDEX_CHECK)
551 template <
class VS,
class V,
class E>
friend E _vsvminus(
const VS &sl,
const V &rv)
552 #if(CXSC_INDEX_CHECK)
557 template <
class VS1,
class VS2,
class E>
friend E _vsvsmult(
const VS1 & sl1,
const VS2 &sl2)
558 #if(CXSC_INDEX_CHECK)
569 explicit INLINE
intvector_slice(
intvector &a,
const int &lb,
const int &ub) noexcept:dat(a.dat),l(a.l),u(a.u),size(ub-lb+1),start(lb),end(ub) { }
578 #if(CXSC_INDEX_CHECK)
585 #if(CXSC_INDEX_CHECK)
594 #if(CXSC_INDEX_CHECK)
601 #if(CXSC_INDEX_CHECK)
619 #if(CXSC_INDEX_CHECK)
626 #if(CXSC_INDEX_CHECK)
635 #if(CXSC_INDEX_CHECK)
642 #if(CXSC_INDEX_CHECK)
654 #if(CXSC_INDEX_CHECK)
661 #if(CXSC_INDEX_CHECK)
668 #if(CXSC_INDEX_CHECK)
675 #if(CXSC_INDEX_CHECK)
682 #if(CXSC_INDEX_CHECK)
687 INLINE
operator void*() noexcept;
703 #if(CXSC_INDEX_CHECK)
710 #if(CXSC_INDEX_CHECK)
721 INLINE
bool operator !(
const intvector &rv) noexcept;
751 #if(CXSC_INDEX_CHECK)
758 #if(CXSC_INDEX_CHECK)
765 #if(CXSC_INDEX_CHECK)
772 #if(CXSC_INDEX_CHECK)
779 #if(CXSC_INDEX_CHECK)
786 #if(CXSC_INDEX_CHECK)
795 #if(CXSC_INDEX_CHECK)
802 #if(CXSC_INDEX_CHECK)
809 #if(CXSC_INDEX_CHECK)
816 #if(CXSC_INDEX_CHECK)
828 #if(CXSC_INDEX_CHECK)
835 #if(CXSC_INDEX_CHECK)
842 #if(CXSC_INDEX_CHECK)
849 #if(CXSC_INDEX_CHECK)
856 #if(CXSC_INDEX_CHECK)
863 #if(CXSC_INDEX_CHECK)
875 #if(CXSC_INDEX_CHECK)
882 #if(CXSC_INDEX_CHECK)
889 #if(CXSC_INDEX_CHECK)
896 #if(CXSC_INDEX_CHECK)
903 #if(CXSC_INDEX_CHECK)
910 #if(CXSC_INDEX_CHECK)
966 INLINE std::ostream &operator <<(std::ostream &s,
const intvector &rv) noexcept;
968 INLINE std::ostream &operator <<(std::ostream &o,
const intvector_slice &sl) noexcept;
970 INLINE std::istream &operator >>(std::istream &s,
intvector &rv) noexcept;
972 INLINE std::istream &operator >>(std::istream &s,
intvector_slice &rv) noexcept;
979 extern std::ostream& operator<< ( std::ostream&,
intvector& );
985 #ifdef _CXSC_INCL_INL
986 #include "intvector.inl"
987 #include "vector.inl"
The Data Type dotprecision.
The Data Type intmatrix_slice.
The Data Type intmatrix_subv.
The Data Type intvector_slice.
intvector_slice(const intvector_slice &a) noexcept
Constructor of class intvector_slice.
intvector_slice & operator-=(const intvector &rv) noexcept
Implementation of subtraction and allocation operation.
friend int Lb(const intvector_slice &sl) noexcept
Returns the lower bound of the vector.
friend int VecLen(const intvector_slice &sl) noexcept
Returns the dimension of the vector.
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.
friend int Ub(const intvector_slice &sl) noexcept
Returns the upper bound of the vector.
intvector_slice(intvector &a, const int &lb, const int &ub) noexcept
Constructor of class intvector_slice.
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_slice(intvector_slice &a, const int &lb, const int &ub) noexcept
Constructor of class intvector_slice.
intvector() noexcept
Constructor of class intvector.
friend int Ub(const intvector &rv) noexcept
Returns the upper bound of the vector.
friend intvector & SetUb(intvector &rv, const int &u) noexcept
Sets the upper bound of the vector.
int & operator[](const int &i) noexcept
Operator for accessing the single elements of the vector.
friend int VecLen(const intvector &rv) noexcept
Returns the dimension of the vector.
friend int Lb(const intvector &rv) noexcept
Returns the lower bound of the vector.
friend intvector & SetLb(intvector &rv, const int &l) noexcept
Sets the lower bound 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.
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.
void DoubleSize(cimatrix &A)
Doubles the size of the matrix.
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.
cimatrix & operator/=(cimatrix &m, const cinterval &c) noexcept
Implementation of division and allocation operation.