C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
intvector.hpp
1 /*
2 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4)
3 **
4 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
5 ** Universitaet Karlsruhe, Germany
6 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie
7 ** Universitaet Wuppertal, Germany
8 **
9 ** This library is free software; you can redistribute it and/or
10 ** modify it under the terms of the GNU Library General Public
11 ** License as published by the Free Software Foundation; either
12 ** version 2 of the License, or (at your option) any later version.
13 **
14 ** This library is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ** Library General Public License for more details.
18 **
19 ** You should have received a copy of the GNU Library General Public
20 ** License along with this library; if not, write to the Free
21 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23 
24 /* CVS $Id: intvector.hpp,v 1.20 2014/01/30 17:23:45 cxsc Exp $ */
25 
26 #ifndef _CXSC_INTVECTOR_HPP_INCLUDED
27 #define _CXSC_INTVECTOR_HPP_INCLUDED
28 
29 #include "xscclass.hpp"
30 #include "dot.hpp"
31 #include "idot.hpp"
32 #include "cdot.hpp"
33 #include "cidot.hpp"
34 #include "except.hpp"
35 #include "vector.hpp"
36 
37 #include <iostream>
38 
39 namespace cxsc{
40 
41 int abs(int a);
42 
43 class intvector_slice;
44 
46 
51 class intvector
52 {
53  friend class intvector_slice;
54  friend class intmatrix;
55  friend class intmatrix_subv;
56 //#if(CXSC_INDEX_CHECK)
57  //------------ Templates --------------------------------------------------
58 #ifdef _CXSC_FRIEND_TPL
59 template <class V,class MS,class S> friend void _vmsconstr(V &v,const MS &m)
60 #if(CXSC_INDEX_CHECK)
61 ;
62 #else
63  noexcept;
64 #endif
65 template <class V,class M,class S> friend void _vmconstr(V &v,const M &m)
66 #if(CXSC_INDEX_CHECK)
67 ;
68 #else
69  noexcept;
70 #endif
71  template <class V> friend void _vresize(V &rv) noexcept;
72  template <class V,class S> friend void _vresize(V &rv, const int &len)
73 #if(CXSC_INDEX_CHECK)
74  ;
75 #else
76  noexcept;
77 #endif
78  template <class V,class S> friend void _vresize(V &rv, const int &lb, const int &ub)
79 #if(CXSC_INDEX_CHECK)
80  ;
81 #else
82  noexcept;
83 #endif
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)
88 #if(CXSC_INDEX_CHECK)
89  ;
90 #else
91  noexcept;
92 #endif
93 template <class V,class M,class S> friend V &_vmassign(V &v,const M &m)
94 #if(CXSC_INDEX_CHECK)
95 ;
96 #else
97  noexcept;
98 #endif
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)
102 ;
103 #else
104  noexcept;
105 #endif
106 template <class MV,class V> friend V _mvabs(const MV &mv) noexcept;
107 
108  //-------- vector-vector -----------------
109  template <class DP,class V1,class V2> friend void _vvaccu(DP &dp, const V1 & rv1, const V2 &rv2)
110 #if(CXSC_INDEX_CHECK)
111  ;
112 #else
113  noexcept;
114 #endif
115  template <class DP,class VS,class V> friend void _vsvaccu(DP &dp, const VS & sl, const V &rv)
116 #if(CXSC_INDEX_CHECK)
117  ;
118 #else
119  noexcept;
120 #endif
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)
126  ;
127 #else
128  noexcept;
129 #endif
130  template <class V,class VS,class E> friend E _vvsplus(const V &rv,const VS &sl)
131 #if(CXSC_INDEX_CHECK)
132  ;
133 #else
134  noexcept;
135 #endif
136  template <class VS1,class VS2,class E> friend E _vsvsplus(const VS1 &s1,const VS2 &s2)
137 #if(CXSC_INDEX_CHECK)
138  ;
139 #else
140  noexcept;
141 #endif
142  template <class VS1,class VS2,class E> friend E _vsvsminus(const VS1 &s1,const VS2 &s2)
143 #if(CXSC_INDEX_CHECK)
144  ;
145 #else
146  noexcept;
147 #endif
148  template <class V1,class V2> friend V1 &_vvplusassign(V1 &rv1, const V2 &rv2)
149 #if(CXSC_INDEX_CHECK)
150  ;
151 #else
152  noexcept;
153 #endif
154  template <class V,class VS> friend V &_vvsplusassign(V &rv, const VS &sl)
155 #if(CXSC_INDEX_CHECK)
156  ;
157 #else
158  noexcept;
159 #endif
160  template <class VS,class V> friend VS &_vsvplusassign(VS &sl, const V &rv)
161 #if(CXSC_INDEX_CHECK)
162  ;
163 #else
164  noexcept;
165 #endif
166  template <class VS1,class VS2> friend VS1 &_vsvsplusassign(VS1 &sl1, const VS2 &sl2)
167 #if(CXSC_INDEX_CHECK)
168  ;
169 #else
170  noexcept;
171 #endif
172  template <class VS1,class VS2> friend VS1 &_vsvsminusassign(VS1 &sl1, const VS2 &sl2)
173 #if(CXSC_INDEX_CHECK)
174  ;
175 #else
176  noexcept;
177 #endif
178  template <class V1,class V2> friend V1 &_vvminusassign(V1 &rv1, const V2 &rv2)
179 #if(CXSC_INDEX_CHECK)
180  ;
181 #else
182  noexcept;
183 #endif
184  template <class V,class VS> friend V &_vvsminusassign(V &rv, const VS &sl)
185 #if(CXSC_INDEX_CHECK)
186  ;
187 #else
188  noexcept;
189 #endif
190  template <class VS,class V> friend VS &_vsvminusassign(VS &sl, const V &rv)
191 #if(CXSC_INDEX_CHECK)
192  ;
193 #else
194  noexcept;
195 #endif
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)
200  ;
201 #else
202  noexcept;
203 #endif
204  template <class V,class VS,class E> friend E _vvsminus(const V &rv, const VS &sl)
205 #if(CXSC_INDEX_CHECK)
206  ;
207 #else
208  noexcept;
209 #endif
210  template <class VS,class V,class E> friend E _vsvminus(const VS &sl,const V &rv)
211 #if(CXSC_INDEX_CHECK)
212  ;
213 #else
214  noexcept;
215 #endif
216  template <class MV1,class MV2,class E> friend E _mvmvplus(const MV1 &rv1, const MV2 &rv2)
217 #if(CXSC_INDEX_CHECK)
218  ;
219 #else
220  noexcept;
221 #endif
222  template <class MV,class V,class E> friend E _mvvplus(const MV &rv1, const V &rv2)
223 #if(CXSC_INDEX_CHECK)
224  ;
225 #else
226  noexcept;
227 #endif
228  template <class MV,class V,class E> friend E _mvvminus(const MV &rv1, const V &rv2)
229 #if(CXSC_INDEX_CHECK)
230  ;
231 #else
232  noexcept;
233 #endif
234  template <class V,class MV,class E> friend E _vmvminus(const V &rv1, const MV &rv2)
235 #if(CXSC_INDEX_CHECK)
236  ;
237 #else
238  noexcept;
239 #endif
240  template <class MV1,class MV2,class E> friend E _mvmvminus(const MV1 &rv1, const MV2 &rv2)
241 #if(CXSC_INDEX_CHECK)
242  ;
243 #else
244  noexcept;
245 #endif
246 template <class MV,class V> friend MV &_mvvplusassign(MV &v,const V &rv)
247 #if(CXSC_INDEX_CHECK)
248 ;
249 #else
250  noexcept;
251 #endif
252 template <class MV,class V> friend MV &_mvvminusassign(MV &v,const V &rv)
253 #if(CXSC_INDEX_CHECK)
254 ;
255 #else
256  noexcept;
257 #endif
258 
259 
260 template <class DP,class V,class SV> friend void _vmvaccu(DP &dp, const V & rv1, const SV &rv2)
261 #if(CXSC_INDEX_CHECK)
262  ;
263 #else
264  noexcept;
265 #endif
266  //--------- vector-scalar ----------------
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;
295 
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;
298 
299 #endif
300 
301  private:
302  int *dat;
303  int l,u,size;
304 
305  public:
306  //------ Konstruktoren ----------------------------------------------------
308  INLINE intvector () noexcept;
309 #ifdef OLD_CXSC
310  explicit INLINE intvector(const class index &i) noexcept; // for backwards compatibility
312 #endif
313  explicit INLINE intvector(const int &i1,const int &i2)
315 #if(CXSC_INDEX_CHECK)
316 ;
317 #else
318  noexcept;
319 #endif
320  INLINE intvector(const intmatrix_subv &) noexcept;
323  explicit INLINE intvector(const int &) noexcept;
325  explicit INLINE intvector(const intmatrix &)
326 #if(CXSC_INDEX_CHECK)
327 ;
328 #else
329  noexcept;
330 #endif
331  explicit INLINE intvector(const intmatrix_slice &sl)
333 #if(CXSC_INDEX_CHECK)
334 ;
335 #else
336  noexcept;
337 #endif
338  INLINE intvector(const intvector_slice &rs) noexcept;
341  INLINE intvector(const intvector &v) noexcept;
343  INLINE intvector &operator =(const intvector &rv) noexcept;
345  INLINE intvector &operator =(const intvector_slice &sl) noexcept;
347  INLINE intvector &operator =(const int &r) noexcept;
349  INLINE intvector &operator =(const intmatrix &)
350 #if(CXSC_INDEX_CHECK)
351 ;
352 #else
353  noexcept;
354 #endif
355  INLINE intvector &operator =(const intmatrix_slice &)
357 #if(CXSC_INDEX_CHECK)
358 ;
359 #else
360  noexcept;
361 #endif
362  INLINE intvector &operator =(const intmatrix_subv &) noexcept;
364 
365  //--------- Destruktor ----------------------------------------------------
366  INLINE ~intvector() { delete [] dat; }
367 
368  //------ Standardfunktionen -----------------------------------------------
369 
371  friend INLINE int Lb(const intvector &rv) noexcept { return rv.l; }
373  friend INLINE int Ub(const intvector &rv) noexcept { return rv.u; }
375  friend INLINE int VecLen(const intvector &rv) noexcept { return rv.size; }
377  friend INLINE intvector &SetLb(intvector &rv, const int &l) noexcept { rv.l=l; rv.u=l+rv.size-1; return rv; }
379  friend INLINE intvector &SetUb(intvector &rv, const int &u) noexcept { rv.u=u; rv.l=u-rv.size+1; return rv; }
381  INLINE int & operator [](const int &i)
382 #if(CXSC_INDEX_CHECK)
383 ;
384 #else
385  noexcept;
386 #endif
387  INLINE const int &operator [](const int &i) const
389 #if(CXSC_INDEX_CHECK)
390 ;
391 #else
392  noexcept;
393 #endif
394  INLINE intvector & operator ()() noexcept { return *this; }
397  INLINE intvector_slice operator ()(const int &i)
398 #if(CXSC_INDEX_CHECK)
399 ;
400 #else
401  noexcept;
402 #endif
403  INLINE intvector_slice operator ()(const int &i1,const int &i2)
405 #if(CXSC_INDEX_CHECK)
406 ;
407 #else
408  noexcept;
409 #endif
410 
411  INLINE operator void*() noexcept;
412 //#else
413 //#endif
414 };
415 
417 
423 {
424  friend class intvector;
425  friend class intmatrix;
426  private:
427  int *dat;
428  int l,u,size;
429  int start,end;
430 
431  public:
432 //#if(CXSC_INDEX_CHECK)
433 #ifdef _CXSC_FRIEND_TPL
434 //------------------------- Templates -------------------------------------------
435  template <class VS1,class VS2> friend VS1 & _vsvsassign(VS1 &sl1,const VS2 &sl2)
436 #if(CXSC_INDEX_CHECK)
437  ;
438 #else
439  noexcept;
440 #endif
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)
444  ;
445 #else
446  noexcept;
447 #endif
448  template <class VS,class S> friend VS & _vssassign(VS &sl,const S &r) noexcept;
449  //-------- vector-scalar ------------------
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;
452 
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;
468  //------- vector-matrix ----------------
469  //------- vector-vector -----------------
470  template <class DP,class VS,class V> friend void _vsvaccu(DP &dp, const VS & sl, const V &rv)
471 #if(CXSC_INDEX_CHECK)
472  ;
473 #else
474  noexcept;
475 #endif
476  template <class DP,class VS1,class VS2> friend void _vsvsaccu(DP &dp, const VS1 & sl1, const VS2 &sl2)
477 #if(CXSC_INDEX_CHECK)
478  ;
479 #else
480  noexcept;
481 #endif
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)
486  ;
487 #else
488  noexcept;
489 #endif
490  template <class V,class VS,class E> friend E _vvsplus(const V &rv,const VS &sl)
491 #if(CXSC_INDEX_CHECK)
492  ;
493 #else
494  noexcept;
495 #endif
496  template <class VS1,class VS2,class E> friend E _vsvsplus(const VS1 &s1,const VS2 &s2)
497 #if(CXSC_INDEX_CHECK)
498  ;
499 #else
500  noexcept;
501 #endif
502  template <class VS1,class VS2,class E> friend E _vsvsminus(const VS1 &s1,const VS2 &s2)
503 #if(CXSC_INDEX_CHECK)
504  ;
505 #else
506  noexcept;
507 #endif
508  template <class V,class VS> friend V &_vvsplusassign(V &rv, const VS &sl)
509 #if(CXSC_INDEX_CHECK)
510  ;
511 #else
512  noexcept;
513 #endif
514  template <class VS,class V> friend VS &_vsvplusassign(VS &sl, const V &rv)
515 #if(CXSC_INDEX_CHECK)
516  ;
517 #else
518  noexcept;
519 #endif
520  template <class VS1,class VS2> friend VS1 &_vsvsplusassign(VS1 &sl1, const VS2 &sl2)
521 #if(CXSC_INDEX_CHECK)
522  ;
523 #else
524  noexcept;
525 #endif
526  template <class VS1,class VS2> friend VS1 &_vsvsminusassign(VS1 &sl1, const VS2 &sl2)
527 #if(CXSC_INDEX_CHECK)
528  ;
529 #else
530  noexcept;
531 #endif
532  template <class V,class VS> friend V &_vvsminusassign(V &rv, const VS &sl)
533 #if(CXSC_INDEX_CHECK)
534  ;
535 #else
536  noexcept;
537 #endif
538  template <class VS,class V> friend VS &_vsvminusassign(VS &sl, const V &rv)
539 #if(CXSC_INDEX_CHECK)
540  ;
541 #else
542  noexcept;
543 #endif
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)
547  ;
548 #else
549  noexcept;
550 #endif
551  template <class VS,class V,class E> friend E _vsvminus(const VS &sl,const V &rv)
552 #if(CXSC_INDEX_CHECK)
553  ;
554 #else
555  noexcept;
556 #endif
557  template <class VS1,class VS2,class E> friend E _vsvsmult(const VS1 & sl1, const VS2 &sl2)
558 #if(CXSC_INDEX_CHECK)
559  ;
560 #else
561  noexcept;
562 #endif
563 
564 #endif
565 
566 
567  //--------------------- Konstruktoren -----------------------------------
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) { }
571  explicit INLINE intvector_slice(intvector_slice &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) { }
572  public:
574  INLINE intvector_slice(const intvector_slice &a) noexcept:dat(a.dat),l(a.l),u(a.u),size(a.size),start(a.start),end(a.end) { }
575  public:
577  INLINE intvector_slice & operator =(const intvector_slice &sl)
578 #if(CXSC_INDEX_CHECK)
579 ;
580 #else
581  noexcept;
582 #endif
583  INLINE intvector_slice & operator =(const intvector &rv)
585 #if(CXSC_INDEX_CHECK)
586 ;
587 #else
588  noexcept;
589 #endif
590  INLINE intvector_slice & operator =(const int &r) noexcept;
593  INLINE intvector_slice & operator =(const intmatrix &m)
594 #if(CXSC_INDEX_CHECK)
595 ;
596 #else
597  noexcept;
598 #endif
599  INLINE intvector_slice & operator =(const intmatrix_slice &m)
601 #if(CXSC_INDEX_CHECK)
602 ;
603 #else
604  noexcept;
605 #endif
606  INLINE intvector_slice &operator =(const intmatrix_subv &) noexcept;
608 
609  //--------------------- Standardfunktionen ------------------------------
610 
612  friend INLINE int Lb(const intvector_slice &sl) noexcept { return sl.start; }
614  friend INLINE int Ub(const intvector_slice &sl) noexcept { return sl.end; }
616  friend INLINE int VecLen(const intvector_slice &sl) noexcept { return sl.end-sl.start+1; }
618  INLINE int & operator [](const int &i)
619 #if(CXSC_INDEX_CHECK)
620 ;
621 #else
622  noexcept;
623 #endif
624  INLINE const int & operator [](const int &i) const
626 #if(CXSC_INDEX_CHECK)
627 ;
628 #else
629  noexcept;
630 #endif
631  INLINE intvector_slice & operator ()() noexcept { return *this; }
634  INLINE intvector_slice operator ()(const int &i)
635 #if(CXSC_INDEX_CHECK)
636 ;
637 #else
638  noexcept;
639 #endif
640  INLINE intvector_slice operator ()(const int &i1,const int &i2)
642 #if(CXSC_INDEX_CHECK)
643 ;
644 #else
645  noexcept;
646 #endif
647 
649  INLINE intvector_slice &operator /=(const int &r) noexcept;
651  INLINE intvector_slice &operator *=(const int &r) noexcept;
654 #if(CXSC_INDEX_CHECK)
655 ;
656 #else
657  noexcept;
658 #endif
659  INLINE intvector_slice &operator +=(const intvector &rv)
661 #if(CXSC_INDEX_CHECK)
662 ;
663 #else
664  noexcept;
665 #endif
666  INLINE intvector_slice &operator +=(const intvector_slice &sl2)
668 #if(CXSC_INDEX_CHECK)
669 ;
670 #else
671  noexcept;
672 #endif
673  INLINE intvector_slice &operator -=(const intvector &rv)
675 #if(CXSC_INDEX_CHECK)
676 ;
677 #else
678  noexcept;
679 #endif
680  INLINE intvector_slice &operator -=(const intvector_slice &sl2)
682 #if(CXSC_INDEX_CHECK)
683 ;
684 #else
685  noexcept;
686 #endif
687  INLINE operator void*() noexcept;
688 //#else
689 //#endif
690 };
691 
692 //======================== Vector Functions =============================
693 
695  INLINE intvector _intvector(const int &r) noexcept;
696 // INLINE intvector _intvector(const intmatrix &m);
697 // INLINE intvector _intvector(const intmatrix_slice &sl);
698 
700  INLINE void Resize(intvector &rv) noexcept;
702  INLINE void Resize(intvector &rv, const int &len)
703 #if(CXSC_INDEX_CHECK)
704 ;
705 #else
706  noexcept;
707 #endif
708  INLINE void Resize(intvector &rv, const int &lb, const int &ub)
710 #if(CXSC_INDEX_CHECK)
711 ;
712 #else
713  noexcept;
714 #endif
715 
717  INLINE intvector abs(const intvector &rv) noexcept;
719  INLINE intvector abs(const intvector_slice &sl) noexcept;
721  INLINE bool operator !(const intvector &rv) noexcept;
723  INLINE bool operator !(const intvector_slice &sl) noexcept;
724 
725 //======================= Vector / Scalar ===============================
726 
728  INLINE intvector operator *(const intvector &rv, const int &s) noexcept;
730  INLINE intvector operator *(const intvector_slice &sl, const int &s) noexcept;
732  INLINE intvector operator *(const int &s, const intvector &rv) noexcept;
734  INLINE intvector operator *(const int &s, const intvector_slice &sl) noexcept;
736  INLINE intvector &operator *=(intvector &rv,const int &r) noexcept;
737 
739  INLINE intvector operator /(const intvector &rv, const int &s) noexcept;
741  INLINE intvector operator /(const intvector_slice &sl, const int &s) noexcept;
743  INLINE intvector &operator /=(intvector &rv,const int &r) noexcept;
744 
745 //======================= Vector / Vector ===============================
746 
747 
748 
750  INLINE void accumulate(dotprecision &dp, const intvector & rv1, const intvector &rv2)
751 #if(CXSC_INDEX_CHECK)
752 ;
753 #else
754  noexcept;
755 #endif
756  INLINE void accumulate(dotprecision &dp, const intvector & rv1, const intmatrix_subv &rv2)
758 #if(CXSC_INDEX_CHECK)
759 ;
760 #else
761  noexcept;
762 #endif
763  INLINE void accumulate(dotprecision &dp, const intmatrix_subv & rv1, const intvector &rv2)
765 #if(CXSC_INDEX_CHECK)
766 ;
767 #else
768  noexcept;
769 #endif
770  INLINE void accumulate(dotprecision &dp,const intvector_slice &sl,const intvector &rv)
772 #if(CXSC_INDEX_CHECK)
773 ;
774 #else
775  noexcept;
776 #endif
777  INLINE void accumulate(dotprecision &dp,const intvector &rv,const intvector_slice &sl)
779 #if(CXSC_INDEX_CHECK)
780 ;
781 #else
782  noexcept;
783 #endif
784  INLINE void accumulate(dotprecision &dp, const intvector_slice & sl1, const intvector_slice &sl2)
786 #if(CXSC_INDEX_CHECK)
787 ;
788 #else
789  noexcept;
790 #endif
791 
792 
794  INLINE int operator *(const intvector & rv1, const intvector &rv2)
795 #if(CXSC_INDEX_CHECK)
796 ;
797 #else
798  noexcept;
799 #endif
800  INLINE int operator *(const intvector_slice &sl, const intvector &rv)
802 #if(CXSC_INDEX_CHECK)
803 ;
804 #else
805  noexcept;
806 #endif
807  INLINE int operator *(const intvector &rv, const intvector_slice &sl)
809 #if(CXSC_INDEX_CHECK)
810 ;
811 #else
812  noexcept;
813 #endif
814  INLINE int operator *(const intvector_slice & sl1, const intvector_slice &sl2)
816 #if(CXSC_INDEX_CHECK)
817 ;
818 #else
819  noexcept;
820 #endif
821 
823  INLINE const intvector &operator +(const intvector &rv) noexcept;
825  INLINE intvector operator +(const intvector_slice &sl) noexcept;
827  INLINE intvector operator +(const intvector &rv1, const intvector &rv2)
828 #if(CXSC_INDEX_CHECK)
829 ;
830 #else
831  noexcept;
832 #endif
833  INLINE intvector operator +(const intvector &rv, const intvector_slice &sl)
835 #if(CXSC_INDEX_CHECK)
836 ;
837 #else
838  noexcept;
839 #endif
840  INLINE intvector operator +(const intvector_slice &sl, const intvector &rv)
842 #if(CXSC_INDEX_CHECK)
843 ;
844 #else
845  noexcept;
846 #endif
847  INLINE intvector operator +(const intvector_slice &sl1, const intvector_slice &sl2)
849 #if(CXSC_INDEX_CHECK)
850 ;
851 #else
852  noexcept;
853 #endif
854  INLINE intvector & operator +=(intvector &rv1, const intvector &rv2)
856 #if(CXSC_INDEX_CHECK)
857 ;
858 #else
859  noexcept;
860 #endif
861  INLINE intvector &operator +=(intvector &rv, const intvector_slice &sl)
863 #if(CXSC_INDEX_CHECK)
864 ;
865 #else
866  noexcept;
867 #endif
868 
870  INLINE intvector operator -(const intvector &rv) noexcept;
872  INLINE intvector operator -(const intvector_slice &sl) noexcept;
874  INLINE intvector operator -(const intvector &rv1, const intvector &rv2)
875 #if(CXSC_INDEX_CHECK)
876 ;
877 #else
878  noexcept;
879 #endif
880  INLINE intvector operator -(const intvector &rv, const intvector_slice &sl)
882 #if(CXSC_INDEX_CHECK)
883 ;
884 #else
885  noexcept;
886 #endif
887  INLINE intvector operator -(const intvector_slice &sl, const intvector &rv)
889 #if(CXSC_INDEX_CHECK)
890 ;
891 #else
892  noexcept;
893 #endif
894  INLINE intvector operator -(const intvector_slice &sl1, const intvector_slice &sl2)
896 #if(CXSC_INDEX_CHECK)
897 ;
898 #else
899  noexcept;
900 #endif
901  INLINE intvector & operator -=(intvector &rv1, const intvector &rv2)
903 #if(CXSC_INDEX_CHECK)
904 ;
905 #else
906  noexcept;
907 #endif
908  INLINE intvector &operator -=(intvector &rv, const intvector_slice &sl)
910 #if(CXSC_INDEX_CHECK)
911 ;
912 #else
913  noexcept;
914 #endif
915 
917  INLINE bool operator ==(const intvector &rv1, const intvector &rv2) noexcept;
919  INLINE bool operator ==(const intvector_slice &sl1, const intvector_slice &sl2) noexcept;
921  INLINE bool operator ==(const intvector_slice &sl, const intvector &rv) noexcept;
923  INLINE bool operator ==(const intvector &rv, const intvector_slice &sl) noexcept;
925  INLINE bool operator !=(const intvector &rv1, const intvector &rv2) noexcept;
927  INLINE bool operator !=(const intvector_slice &sl1, const intvector_slice &sl2) noexcept;
929  INLINE bool operator !=(const intvector_slice &sl, const intvector &rv) noexcept;
931  INLINE bool operator !=(const intvector &rv, const intvector_slice &sl) noexcept;
933  INLINE bool operator <(const intvector &rv1, const intvector &rv2) noexcept;
935  INLINE bool operator <(const intvector_slice &sl1, const intvector_slice &sl2) noexcept;
937  INLINE bool operator < (const intvector_slice &sl, const intvector &rv) noexcept;
939  INLINE bool operator < (const intvector &rv, const intvector_slice &sl) noexcept;
941  INLINE bool operator <=(const intvector &rv1, const intvector &rv2) noexcept;
943  INLINE bool operator <=(const intvector_slice &sl1, const intvector_slice &sl2) noexcept;
945  INLINE bool operator <=(const intvector_slice &sl, const intvector &rv) noexcept;
947  INLINE bool operator <=(const intvector &rv, const intvector_slice &sl) noexcept;
949  INLINE bool operator >(const intvector &rv1, const intvector &rv2) noexcept;
951  INLINE bool operator >(const intvector_slice &sl1, const intvector_slice &sl2) noexcept;
953  INLINE bool operator >(const intvector_slice &sl, const intvector &rv) noexcept;
955  INLINE bool operator >(const intvector &rv, const intvector_slice &sl) noexcept;
957  INLINE bool operator >=(const intvector &rv1, const intvector &rv2) noexcept;
959  INLINE bool operator >=(const intvector_slice &sl1, const intvector_slice &sl2) noexcept;
961  INLINE bool operator >=(const intvector_slice &sl, const intvector &rv) noexcept;
963  INLINE bool operator >=(const intvector &rv, const intvector_slice &sl) noexcept;
964 
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;
973 
974 
975  INLINE intvector perminv(const intvector&);
976 
977 extern void DoubleSize ( intvector& );
979 extern std::ostream& operator<< ( std::ostream&, intvector& );
980 
981 
982 
983 } // namespace cxsc
984 
985 #ifdef _CXSC_INCL_INL
986 #include "intvector.inl"
987 #include "vector.inl"
988 #endif
989 
990 
991 #endif
992 
cxsc::intvector_slice::intvector_slice
intvector_slice(intvector_slice &a, const int &lb, const int &ub) noexcept
Constructor of class intvector_slice.
Definition: intvector.hpp:571
cxsc::intmatrix_subv
The Data Type intmatrix_subv.
Definition: intmatrix.hpp:46
cxsc::intvector_slice::operator[]
int & operator[](const int &i) noexcept
Operator for accessing the single elements of the vector.
Definition: intvector.inl:76
cxsc::intvector::SetLb
friend intvector & SetLb(intvector &rv, const int &l) noexcept
Sets the lower bound of the vector.
Definition: intvector.hpp:377
cxsc::intvector_slice::intvector_slice
intvector_slice(intvector &a, const int &lb, const int &ub) noexcept
Constructor of class intvector_slice.
Definition: intvector.hpp:569
cxsc::intvector_slice::operator*=
intvector_slice & operator*=(const int &r) noexcept
Implementation of multiplication and allocation operation.
Definition: intvector.inl:250
cxsc::intvector_slice::Ub
friend int Ub(const intvector_slice &sl) noexcept
Returns the upper bound of the vector.
Definition: intvector.hpp:614
cxsc::intvector::SetUb
friend intvector & SetUb(intvector &rv, const int &u) noexcept
Sets the upper bound of the vector.
Definition: intvector.hpp:379
cxsc::operator*=
cimatrix & operator*=(cimatrix &m, const cinterval &c) noexcept
Implementation of multiplication and allocation operation.
Definition: cimatrix.inl:1605
cxsc::operator/
civector operator/(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of division operation.
Definition: cimatrix.inl:730
cxsc::intvector_slice
The Data Type intvector_slice.
Definition: intvector.hpp:423
cxsc::intvector
The Data Type intvector.
Definition: intvector.hpp:52
cxsc::abs
ivector abs(const cimatrix_subv &mv) noexcept
Returns the absolute value of the matrix.
Definition: cimatrix.inl:737
cxsc::operator/=
cimatrix & operator/=(cimatrix &m, const cinterval &c) noexcept
Implementation of division and allocation operation.
Definition: cimatrix.inl:1623
cxsc::intmatrix_slice
The Data Type intmatrix_slice.
Definition: intmatrix.hpp:594
cxsc::intvector_slice::operator()
intvector_slice & operator()() noexcept
Operator for accessing the whole vector.
Definition: intvector.hpp:632
cxsc::intvector_slice::operator-=
intvector_slice & operator-=(const intvector &rv) noexcept
Implementation of subtraction and allocation operation.
Definition: intvector.inl:396
cxsc::intvector_slice::Lb
friend int Lb(const intvector_slice &sl) noexcept
Returns the lower bound of the vector.
Definition: intvector.hpp:612
cxsc::operator*
civector operator*(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of multiplication operation.
Definition: cimatrix.inl:731
cxsc::_intvector
intvector _intvector(const int &r) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
Definition: intvector.inl:220
cxsc::intvector_slice::VecLen
friend int VecLen(const intvector_slice &sl) noexcept
Returns the dimension of the vector.
Definition: intvector.hpp:616
cxsc::intvector_slice::operator=
intvector_slice & operator=(const intvector_slice &sl) noexcept
Constructor of class intvector_slice.
Definition: intvector.inl:197
cxsc::dotprecision
The Data Type dotprecision.
Definition: dot.hpp:112
cxsc::intvector::VecLen
friend int VecLen(const intvector &rv) noexcept
Returns the dimension of the vector.
Definition: intvector.hpp:375
cxsc
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
cxsc::operator+=
cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc) noexcept
Implementation of standard algebraic addition and allocation operation.
Definition: cdot.inl:251
cxsc::DoubleSize
void DoubleSize(cimatrix &A)
Doubles the size of the matrix.
Definition: cimatrix.cpp:83
cxsc::intvector::Lb
friend int Lb(const intvector &rv) noexcept
Returns the lower bound of the vector.
Definition: intvector.hpp:371
cxsc::intvector::Ub
friend int Ub(const intvector &rv) noexcept
Returns the upper bound of the vector.
Definition: intvector.hpp:373
cxsc::intvector::intvector
intvector() noexcept
Constructor of class intvector.
Definition: intvector.inl:33
cxsc::intvector_slice::operator/=
intvector_slice & operator/=(const int &r) noexcept
Implementation of division and allocation operation.
Definition: intvector.inl:255
cxsc::intvector::operator()
intvector & operator()() noexcept
Operator for accessing the whole vector.
Definition: intvector.hpp:395
cxsc::intvector::operator[]
int & operator[](const int &i) noexcept
Operator for accessing the single elements of the vector.
Definition: intvector.inl:115
cxsc::intvector::operator=
intvector & operator=(const intvector &rv) noexcept
Implementation of standard assigning operator.
Definition: intvector.inl:193
cxsc::Resize
void Resize(cimatrix &A) noexcept
Resizes the matrix.
Definition: cimatrix.inl:1211
cxsc::intvector_slice::operator+=
intvector_slice & operator+=(const intvector &rv) noexcept
Implementation of addition and allocation operation.
Definition: intvector.inl:337
cxsc::intmatrix
The Data Type intmatrix.
Definition: intmatrix.hpp:314
cxsc::intvector_slice::intvector_slice
intvector_slice(const intvector_slice &a) noexcept
Constructor of class intvector_slice.
Definition: intvector.hpp:574