C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
vector.inl
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: vector.inl,v 1.28 2014/01/30 17:23:49 cxsc Exp $ */
25 
26 #ifndef _CXSC_VECTOR_INL_INCLUDED
27 #define _CXSC_VECTOR_INL_INCLUDED
28 
29 #include "except.hpp"
30 
31 #ifdef CXSC_USE_BLAS
32 #include "cxsc_blas.hpp"
33 #endif
34 
35 namespace cxsc {
36 int abs(int a);
37 
38  template <class V>
39  TINLINE void _vresize(V &rv) throw()
40  {
41  rv.size=rv.u=0;
42  rv.l=1;
43  delete [] rv.dat;
44  rv.dat=NULL;
45  }
46 
47  template <class V,class S>
48  TINLINE void _vresize(V &rv, const int &len)
49 #if(CXSC_INDEX_CHECK)
50  throw(ERROR__WRONG_BOUNDARIES<V>)
51 #else
52  throw()
53 #endif
54  {
55  if(rv.size==len)
56  SetLb(rv,1);
57  else
58  {
59 #if(CXSC_INDEX_CHECK)
60  if(len<0) cxscthrow(ERROR__WRONG_BOUNDARIES<V>(" Resize("+nameof(rv)+" &, const int &)"));
61 #endif
62  S *ndat=new S[len];
63  int beg,end;
64  beg=(rv.l>1)?rv.l:1;
65  end=(rv.u<len)?rv.u:len;
66  for(int i=beg-1;i<end;i++)
67  ndat[i]=rv.dat[i-rv.l+1];
68  delete [] rv.dat;
69  rv.dat=ndat;
70  rv.size=rv.u=len;
71  rv.l=1;
72  }
73  }
74 
75  template <class V,class S>
76  TINLINE void _vresize(V &rv, const int &lb, const int &ub)
77 #if(CXSC_INDEX_CHECK)
78  throw(ERROR__WRONG_BOUNDARIES<V>)
79 #else
80  throw()
81 #endif
82  {
83  if(rv.size==ub-lb+1)
84  SetUb(rv,ub);
85  else
86  {
87  rv.size=ub-lb+1;
88 #if(CXSC_INDEX_CHECK)
89  if(rv.size<0) cxscthrow(ERROR__WRONG_BOUNDARIES<V>("void Resize("+nameof(rv)+" &, const int &, const int &)"));
90 #endif
91  S *ndat=new S[rv.size];
92  int beg,end;
93  beg=(rv.l>lb)?rv.l:lb;
94  end=(rv.u<ub)?rv.u:ub;
95  for(int i=beg;i<=end;i++)
96  ndat[i-lb]=rv.dat[i-rv.l];
97  delete [] rv.dat;
98  rv.dat=ndat;
99  rv.l=lb;
100  rv.u=ub;
101  }
102  }
103 
104  template <class V1,class V2,class S>
105  TINLINE V1 &_vvassign(V1 &rv1,const V2 &rv2) throw()
106  {
107  S *ndat=new S[rv2.size];
108  rv1.l=rv2.l;
109  rv1.u=rv2.u;
110  rv1.size=rv2.size;
111 
112  for (int i=0;i<rv2.size;i++)
113  ndat[i]=rv2.dat[i];
114  delete [] rv1.dat;
115  rv1.dat=ndat;
116 
117  return rv1;
118  }
119 
120  template <class V,class S>
121  TINLINE V & _vsassign(V &rv,const S &r) throw()
122  {
123  for (int i=0;i<rv.size;i++)
124  rv.dat[i]=r;
125 
126  return rv;
127  }
128 
129  template <class VS1,class VS2>
130  TINLINE VS1 & _vsvsassign(VS1 &sl1,const VS2 &sl2)
131 #if(CXSC_INDEX_CHECK)
132  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
133 #else
134  throw()
135 #endif
136  {
137 #if(CXSC_INDEX_CHECK)
138  if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" "+nameof(sl1)+"::operator =(const "+nameof(sl2)+" &)"));
139 #endif
140  for (int i=sl1.start-sl1.l, j=sl2.start-sl2.l;i<=sl1.end-sl1.l;i++,j++)
141  sl1.dat[i]=sl2.dat[j];
142  return sl1;
143  }
144 
145  template <class V,class VS,class S>
146  TINLINE V & _vvsassign(V &rv,const VS &sl) throw()
147  {
148  S *ndat=new S[sl.size];
149  rv.l=sl.start;
150  rv.u=sl.end;
151  rv.size=sl.size;
152  for (int i=sl.start-sl.l, j=0;j<rv.size;i++,j++)
153  ndat[j]=sl.dat[i];
154  delete [] rv.dat;
155  rv.dat=ndat;
156  return rv;
157  }
158 
159  template <class VS,class V>
160  TINLINE VS & _vsvassign(VS &sl,const V &rv)
161 #if(CXSC_INDEX_CHECK)
162  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
163 #else
164  throw()
165 #endif
166  {
167 #if(CXSC_INDEX_CHECK)
168  if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" "+nameof(sl)+"::operator =(const "+nameof(rv)+" &)"));
169 #endif
170  for (int i=sl.start-sl.l, j=0;j<sl.size;i++,j++)
171  sl.dat[i]=rv.dat[j];
172  return sl;
173  }
174 
175  template <class VS,class S>
176  TINLINE VS & _vssassign(VS &sl,const S &r) throw()
177  {
178  for (int i=sl.start-sl.l;i<=sl.end-sl.l;i++)
179  sl.dat[i]=r;
180  return sl;
181  }
182 
183  template <class DP,class V1,class V2>
184  TINLINE void _vvaccu(DP &dp, const V1 & rv1, const V2 &rv2)
185 #if(CXSC_INDEX_CHECK)
186  throw(OP_WITH_WRONG_DIM)
187 #else
188  throw()
189 #endif
190  {
191 #if(CXSC_INDEX_CHECK)
192  if(rv1.size!=rv2.size) cxscthrow(OP_WITH_WRONG_DIM("void accumulate("+nameof(dp)+" &, const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
193 #endif
194  for(int i=0;i<rv1.size;i++)
195  accumulate(dp,rv1.dat[i],rv2.dat[i]);
196  }
197 
198  template <class DP,class VS,class V>
199  TINLINE void _vsvaccu(DP &dp, const VS & sl, const V &rv)
200 #if(CXSC_INDEX_CHECK)
201  throw(OP_WITH_WRONG_DIM)
202 #else
203  throw()
204 #endif
205  {
206 #if(CXSC_INDEX_CHECK)
207  if(sl.size!=rv.size) cxscthrow(OP_WITH_WRONG_DIM("void accumulate("+nameof(dp)+" &, const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
208 #endif
209  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
210  accumulate(dp,sl.dat[j],rv.dat[i]);
211  }
212 
213  template <class V,class S,class E>
214  TINLINE E _vsdiv(const V &rv, const S &s) throw()
215  {
216  E p(rv.l,rv.u);
217 
218  for(int i=0;i<rv.size;i++)
219  p.dat[i]=rv.dat[i]/s;
220 
221  return p;
222  }
223 
224  template <class V,class S>
225  TINLINE V &_vsdivassign(V &rv,const S &r) throw()
226  {
227  for(int i=0;i<rv.size;i++)
228  rv.dat[i]/=r;
229  return rv;
230  }
231 
232  template <class VS,class S,class E>
233  TINLINE E _vssdiv(const VS &sl, const S &s) throw()
234  {
235  E p(sl.start,sl.end);
236 
237  for(int i=sl.start-sl.l;i<sl.size;i++)
238  p.dat[i]=sl.dat[i]/s;
239 
240  return p;
241  }
242 
243  template <class V,class S,class E>
244  TINLINE E _vsmult(const V &rv, const S &s) throw()
245  {
246  E p(rv.l,rv.u);
247 
248  for(int i=0;i<rv.size;i++)
249  p.dat[i]=rv.dat[i]*s;
250 
251  return p;
252  }
253 
254  template <class VS,class S,class E>
255  TINLINE E _vssmult(const VS &sl, const S &s) throw()
256  {
257  E p(sl.start,sl.end);
258 
259  for(int i=sl.start-sl.l,k=0;k<sl.size;i++,k++)
260  p.dat[k]=sl.dat[i]*s;
261 
262  return p;
263  }
264 
265  template <class V1,class V2,class E>
266  TINLINE E _vvlmult(const V1 & rv1, const V2 &rv2)
267 #if(CXSC_INDEX_CHECK)
268  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
269 #else
270  throw()
271 #endif
272  {
273 #if(CXSC_INDEX_CHECK)
274  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
275 #endif
276  dotprecision dot(0.0);
277  accumulate(dot,rv1,rv2);
278 /* for(int i=0;i<rv1.size;i++)
279  accumulate(dotakku[0],rv1.dat[i],rv2.dat[i]);*/
280 
281  return E(dot);
282  }
283 
284  template <class VS,class V,class E>
285  TINLINE E _vsvlmult(const VS & sl, const V &rv)
286 #if(CXSC_INDEX_CHECK)
287  throw(ERROR__OP_WITH_WRONG_DIM<V>)
288 #else
289  throw()
290 #endif
291  {
292 #if(CXSC_INDEX_CHECK)
293  if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
294 #endif
295  dotprecision dot(0.0);
296  accumulate(dot,sl,rv);
297 /* for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
298  accumulate(dotakku[0],sl.dat[j],rv.dat[i]);*/
299 
300  return E(dot);
301  }
302 
303  template <class VS1,class VS2,class E>
304  TINLINE E _vsvslmult(const VS1 & sl1, const VS2 &sl2)
305 #if(CXSC_INDEX_CHECK)
306  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
307 #else
308  throw()
309 #endif
310  {
311 #if(CXSC_INDEX_CHECK)
312  if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
313 #endif
314  dotprecision dot(0.0);
315  accumulate(dot,sl1,sl2);
316  /*for(int i=sl1.start-sl1.l,j=sl2.start-sl2.l,k=0;k<sl1.size;i++,j++,k++)
317  accumulate(dotakku[0],sl1.dat[i],sl2.dat[j]);*/
318 
319  return E(dot);
320  }
321 
322  template <class V1,class V2,class E>
323  TINLINE E _vvlimult(const V1 & rv1, const V2 &rv2)
324 #if(CXSC_INDEX_CHECK)
325  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
326 #else
327  throw()
328 #endif
329  {
330 #if(CXSC_INDEX_CHECK)
331  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
332 #endif
333  idotprecision idot(0.0);
334  accumulate(idot,rv1,rv2);
335 
336  return E(idot);
337  }
338 
339  template <class VS,class V,class E>
340  TINLINE E _vsvlimult(const VS & sl, const V &rv)
341 #if(CXSC_INDEX_CHECK)
342  throw(ERROR__OP_WITH_WRONG_DIM<V>)
343 #else
344  throw()
345 #endif
346  {
347 #if(CXSC_INDEX_CHECK)
348  if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
349 #endif
350  idotprecision idot(0.0);
351  accumulate(idot,sl,rv);
352 
353  return E(idot);
354  }
355 
356  template <class VS1,class VS2,class E>
357  TINLINE E _vsvslimult(const VS1 & sl1, const VS2 &sl2)
358 #if(CXSC_INDEX_CHECK)
359  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
360 #else
361  throw()
362 #endif
363  {
364 #if(CXSC_INDEX_CHECK)
365  if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
366 #endif
367  idotprecision idot(0.0);
368  accumulate(idot,sl1,sl2);
369 
370  return E(idot);
371  }
372 
373  template <class V1,class V2,class E>
374  TINLINE E _vvmult(const V1 & rv1, const V2 &rv2)
375 #if(CXSC_INDEX_CHECK)
376  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
377 #else
378  throw()
379 #endif
380  {
381 #if(CXSC_INDEX_CHECK)
382  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
383 #endif
384 
385 #ifdef CXSC_USE_BLAS
386  if(opdotprec == 1)
387  {
388  E ret;
389  blasdot(rv1,rv2,ret);
390  return ret;
391  }
392  else
393 #endif
394  {
395  dotprecision dot(0.0);
396  dot.set_k(opdotprec);
397  accumulate_approx(dot,rv1,rv2);
398  return rnd(dot);
399  }
400 /* for(int i=0;i<rv1.size;i++)
401  accumulate(dotakku[0],rv1.dat[i],rv2.dat[i]);*/
402 
403  }
404 
405  template <class VS,class V,class E>
406  TINLINE E _vsvmult(const VS & sl, const V &rv)
407 #if(CXSC_INDEX_CHECK)
408  throw(ERROR__OP_WITH_WRONG_DIM<V>)
409 #else
410  throw()
411 #endif
412  {
413 #if(CXSC_INDEX_CHECK)
414  if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
415 #endif
416 #ifdef CXSC_USE_BLAS
417  if(opdotprec == 1)
418  {
419  E ret;
420  blasdot(sl,rv,ret);
421  return ret;
422  }
423  else
424 #endif
425  {
426  dotprecision dot(0.0);
427  dot.set_k(opdotprec);
428  accumulate_approx(dot,sl,rv);
429  return rnd(dot);
430  }
431  /*for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
432  accumulate(dotakku[0],sl.dat[j],rv.dat[i]);*/
433 
434  }
435 
436  template <class VS1,class VS2,class E>
437  TINLINE E _vsvsmult(const VS1 & sl1, const VS2 &sl2)
438 #if(CXSC_INDEX_CHECK)
439  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
440 #else
441  throw()
442 #endif
443  {
444 #if(CXSC_INDEX_CHECK)
445  if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
446 #endif
447 #ifdef CXSC_USE_BLAS
448  if(opdotprec == 1)
449  {
450  E ret;
451  blasdot(sl1,sl2,ret);
452  return ret;
453  }
454  else
455 #endif
456  {
457  dotprecision dot(0.0);
458  dot.set_k(opdotprec);
459  accumulate_approx(dot,sl1,sl2);
460  return rnd(dot);
461  }
462 /* for(int i=sl1.start-sl1.l,j=sl2.start-sl2.l,k=0;k<sl1.size;i++,j++,k++)
463  accumulate(dotakku[0],sl1.dat[i],sl2.dat[j]);*/
464 
465  }
466 
467  template <class V1,class V2,class E>
468  TINLINE E _vvimult(const V1 & rv1, const V2 &rv2)
469 #if(CXSC_INDEX_CHECK)
470  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
471 #else
472  throw()
473 #endif
474  {
475 #if(CXSC_INDEX_CHECK)
476  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
477 #endif
478 #ifdef CXSC_USE_BLAS
479  if(opdotprec == 1)
480  {
481  E ret;
482  blasdot(rv1,rv2,ret);
483  return ret;
484  }
485  else
486 #endif
487  {
488  idotprecision idot(0.0);
489  idot.set_k(opdotprec);
490  accumulate(idot,rv1,rv2);
491  return rnd(idot);
492  }
493 
494  }
495 
496  template <class VS,class V,class E>
497  TINLINE E _vsvimult(const VS & sl, const V &rv)
498 #if(CXSC_INDEX_CHECK)
499  throw(ERROR__OP_WITH_WRONG_DIM<V>)
500 #else
501  throw()
502 #endif
503  {
504 #if(CXSC_INDEX_CHECK)
505  if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
506 #endif
507 #ifdef CXSC_USE_BLAS
508  if(opdotprec == 1)
509  {
510  E ret;
511  blasdot(sl,rv,ret);
512  return ret;
513  }
514  else
515 #endif
516  {
517  idotprecision idot(0.0);
518  idot.set_k(opdotprec);
519  accumulate(idot,sl,rv);
520  return rnd(idot);
521  }
522 
523  }
524 
525  template <class VS1,class VS2,class E>
526  TINLINE E _vsvsimult(const VS1 & sl1, const VS2 &sl2)
527 #if(CXSC_INDEX_CHECK)
528  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
529 #else
530  throw()
531 #endif
532  {
533 #if(CXSC_INDEX_CHECK)
534  if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
535 #endif
536 #ifdef CXSC_USE_BLAS
537  if(opdotprec == 1)
538  {
539  E ret;
540  blasdot(sl1,sl2,ret);
541  return ret;
542  }
543  else
544 #endif
545  {
546  idotprecision idot(0.0);
547  idot.set_k(opdotprec);
548  accumulate(idot,sl1,sl2);
549  return rnd(idot);
550  }
551 
552  }
553 
554  template <class V1,class V2,class E>
555  TINLINE E _vvcmult(const V1 & rv1, const V2 &rv2)
556 #if(CXSC_INDEX_CHECK)
557  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
558 #else
559  throw()
560 #endif
561  {
562 #if(CXSC_INDEX_CHECK)
563  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
564 #endif
565 #ifdef CXSC_USE_BLAS
566  if(opdotprec == 1)
567  {
568  E ret;
569  blasdot(rv1,rv2,ret);
570  return ret;
571  }
572  else
573 #endif
574  {
575  cdotprecision cdot(0.0);
576  cdot.set_k(opdotprec);
577  accumulate_approx(cdot,rv1,rv2);
578  return rnd(cdot);
579  }
580 
581  }
582 
583  template <class VS,class V,class E>
584  TINLINE E _vsvcmult(const VS & sl, const V &rv)
585 #if(CXSC_INDEX_CHECK)
586  throw(ERROR__OP_WITH_WRONG_DIM<V>)
587 #else
588  throw()
589 #endif
590  {
591 #if(CXSC_INDEX_CHECK)
592  if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
593 #endif
594 #ifdef CXSC_USE_BLAS
595  if(opdotprec == 1)
596  {
597  E ret;
598  blasdot(sl,rv,ret);
599  return ret;
600  }
601  else
602 #endif
603  {
604  cdotprecision cdot(0.0);
605  cdot.set_k(opdotprec);
606  accumulate_approx(cdot,sl,rv);
607  return rnd(cdot);
608  }
609 
610  }
611 
612  template <class VS1,class VS2,class E>
613  TINLINE E _vsvscmult(const VS1 & sl1, const VS2 &sl2)
614 #if(CXSC_INDEX_CHECK)
615  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
616 #else
617  throw()
618 #endif
619  {
620 #if(CXSC_INDEX_CHECK)
621  if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
622 #endif
623 #ifdef CXSC_USE_BLAS
624  if(opdotprec == 1)
625  {
626  E ret;
627  blasdot(sl1,sl2,ret);
628  return ret;
629  }
630  else
631 #endif
632  {
633  cdotprecision cdot(0.0);
634  cdot.set_k(opdotprec);
635  accumulate_approx(cdot,sl1,sl2);
636  return rnd(cdot);
637  }
638 
639  }
640 
641  template <class V1,class V2,class E>
642  TINLINE E _vvcimult(const V1 & rv1, const V2 &rv2)
643 #if(CXSC_INDEX_CHECK)
644  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
645 #else
646  throw()
647 #endif
648  {
649 #if(CXSC_INDEX_CHECK)
650  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
651 #endif
652 #ifdef CXSC_USE_BLAS
653  if(opdotprec == 1)
654  {
655  E ret;
656  blasdot(rv1,rv2,ret);
657  return ret;
658  }
659  else
660 #endif
661  {
662  cidotprecision cidot(0.0);
663  cidot.set_k(opdotprec);
664  accumulate(cidot,rv1,rv2);
665  return rnd(cidot);
666  }
667 
668  }
669 
670  template <class VS,class V,class E>
671  TINLINE E _vsvcimult(const VS & sl, const V &rv)
672 #if(CXSC_INDEX_CHECK)
673  throw(ERROR__OP_WITH_WRONG_DIM<V>)
674 #else
675  throw()
676 #endif
677  {
678 #if(CXSC_INDEX_CHECK)
679  if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
680 #endif
681 #ifdef CXSC_USE_BLAS
682  if(opdotprec == 1)
683  {
684  E ret;
685  blasdot(sl,rv,ret);
686  return ret;
687  }
688  else
689 #endif
690  {
691  cidotprecision cidot(0.0);
692  cidot.set_k(opdotprec);
693  accumulate(cidot,sl,rv);
694  return rnd(cidot);
695  }
696 
697  }
698 
699  template <class VS1,class VS2,class E>
700  TINLINE E _vsvscimult(const VS1 & sl1, const VS2 &sl2)
701 #if(CXSC_INDEX_CHECK)
702  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
703 #else
704  throw()
705 #endif
706  {
707 #if(CXSC_INDEX_CHECK)
708  if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
709 #endif
710 #ifdef CXSC_USE_BLAS
711  if(opdotprec == 1)
712  {
713  E ret;
714  blasdot(sl1,sl2,ret);
715  return ret;
716  }
717  else
718 #endif
719  {
720  cidotprecision cidot(0.0);
721  cidot.set_k(opdotprec);
722  accumulate(cidot,sl1,sl2);
723  return rnd(cidot);
724  }
725 
726  }
727 
728  template <class V,class S>
729  TINLINE V &_vsmultassign(V &rv,const S &r) throw()
730  {
731  for(int i=0;i<rv.size;i++)
732  rv.dat[i]*=r;
733  return rv;
734  }
735 
736  template <class VS,class S>
737  TINLINE VS &_vssmultassign(VS &rv,const S &r) throw()
738  {
739  for(int i=rv.start-rv.l;i<=rv.end-rv.l;i++)
740  rv.dat[i]*=r;
741  return rv;
742  }
743 
744  template <class VS,class S>
745  TINLINE VS &_vssdivassign(VS &rv,const S &r) throw()
746  {
747  for(int i=rv.start-rv.l;i<=rv.end-rv.l;i++)
748  rv.dat[i]/=r;
749  return rv;
750  }
751 
752  template <class V1,class V2,class E>
753  TINLINE E _vvplus(const V1 &rv1, const V2 &rv2)
754 #if(CXSC_INDEX_CHECK)
755  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
756 #else
757  throw()
758 #endif
759  {
760  E sum(rv1.l,rv1.u);
761 
762 #if(CXSC_INDEX_CHECK)
763  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" operator +(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
764 #endif
765  for (int i=0;i<rv1.size;i++)
766  sum.dat[i]=rv1.dat[i]+rv2.dat[i];
767  return sum;
768  }
769 
770  template <class V,class VS,class E>
771  TINLINE E _vvsplus(const V &rv,const VS &sl)
772 #if(CXSC_INDEX_CHECK)
773  throw(ERROR__OP_WITH_WRONG_DIM<V>)
774 #else
775  throw()
776 #endif
777  {
778  E sum(rv.l,rv.u);
779 
780 #if(CXSC_INDEX_CHECK)
781  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(sum)+" operator +(const "+nameof(rv)+" &,const "+nameof(sl)+" &)"));
782 #endif
783  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
784  sum.dat[i]=rv.dat[i]+sl.dat[j];
785  return sum;
786  }
787 
788  template <class VS1,class VS2,class E>
789  TINLINE E _vsvsplus(const VS1 &s1,const VS2 &s2)
790 #if(CXSC_INDEX_CHECK)
791  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
792 #else
793  throw()
794 #endif
795  {
796  E sum(s1.start,s1.end);
797 
798 #if(CXSC_INDEX_CHECK)
799  if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sum)+" operator +(const "+nameof(s1)+" &,const "+nameof(s2)+" &)"));
800 #endif
801  for(int i=s1.start-s1.l,j=s2.start-s2.l,k=0;k<s1.size;i++,j++,k++)
802  sum.dat[k]=s1.dat[i]+s2.dat[j];
803  return sum;
804  }
805 
806  template <class VS1,class VS2,class E>
807  TINLINE E _vsvsminus(const VS1 &s1,const VS2 &s2)
808 #if(CXSC_INDEX_CHECK)
809  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
810 #else
811  throw()
812 #endif
813  {
814  E sum(s1.start,s1.end);
815 
816 #if(CXSC_INDEX_CHECK)
817  if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sum)+" operator -(const "+nameof(s1)+" &,const "+nameof(s2)+" &)"));
818 #endif
819  for(int i=s1.start-s1.l,j=s2.start-s2.l,k=0;k<s1.size;i++,j++,k++)
820  sum.dat[k]=s1.dat[i]-s2.dat[j];
821  return sum;
822  }
823 
824  template <class V1,class V2>
825  TINLINE V1 &_vvplusassign(V1 &rv1, const V2 &rv2)
826 #if(CXSC_INDEX_CHECK)
827  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
828 #else
829  throw()
830 #endif
831  {
832 #if(CXSC_INDEX_CHECK)
833  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & operator +=("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
834 #endif
835  for(int i=0;i<rv1.size;i++)
836  rv1.dat[i]+=rv2.dat[i];
837  return rv1;
838  }
839 
840  template <class V,class VS>
841  TINLINE V &_vvsplusassign(V &rv, const VS &sl)
842 #if(CXSC_INDEX_CHECK)
843  throw(ERROR__OP_WITH_WRONG_DIM<V>)
844 #else
845  throw()
846 #endif
847  {
848 #if(CXSC_INDEX_CHECK)
849  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & operator +=("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
850 #endif
851  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
852  rv.dat[i]+=sl.dat[j];
853  return rv;
854  }
855 
856  template <class VS,class V>
857  TINLINE VS &_vsvplusassign(VS &sl, const V &rv)
858 #if(CXSC_INDEX_CHECK)
859  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
860 #else
861  throw()
862 #endif
863  {
864 #if(CXSC_INDEX_CHECK)
865  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & operator +=("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
866 #endif
867  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
868  sl.dat[j]+=rv.dat[i];
869  return sl;
870  }
871 
872  template <class VS1,class VS2>
873  TINLINE VS1 &_vsvsplusassign(VS1 &sl1, const VS2 &sl2)
874 #if(CXSC_INDEX_CHECK)
875  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
876 #else
877  throw()
878 #endif
879  {
880 #if(CXSC_INDEX_CHECK)
881  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" & operator +=("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
882 #endif
883  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
884  sl1.dat[j]+=sl2.dat[k];
885  return sl1;
886  }
887 
888  template <class VS1,class VS2>
889  TINLINE VS1 &_vsvsminusassign(VS1 &sl1, const VS2 &sl2)
890 #if(CXSC_INDEX_CHECK)
891  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
892 #else
893  throw()
894 #endif
895  {
896 #if(CXSC_INDEX_CHECK)
897  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" & operator +=("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
898 #endif
899  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
900  sl1.dat[j]-=sl2.dat[k];
901  return sl1;
902  }
903 
904  template <class V1,class V2>
905  TINLINE V1 &_vvminusassign(V1 &rv1, const V2 &rv2)
906 #if(CXSC_INDEX_CHECK)
907  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
908 #else
909  throw()
910 #endif
911  {
912 #if(CXSC_INDEX_CHECK)
913  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & operator -=("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
914 #endif
915  for(int i=0;i<rv1.size;i++)
916  rv1.dat[i]-=rv2.dat[i];
917  return rv1;
918  }
919 
920  template <class V,class VS>
921  TINLINE V &_vvsminusassign(V &rv, const VS &sl)
922 #if(CXSC_INDEX_CHECK)
923  throw(ERROR__OP_WITH_WRONG_DIM<V>)
924 #else
925  throw()
926 #endif
927  {
928 #if(CXSC_INDEX_CHECK)
929  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & operator -=("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
930 #endif
931  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
932  rv.dat[i]-=sl.dat[j];
933  return rv;
934  }
935 
936  template <class VS,class V>
937  TINLINE VS &_vsvminusassign(VS &sl, const V &rv)
938 #if(CXSC_INDEX_CHECK)
939  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
940 #else
941  throw()
942 #endif
943  {
944 #if(CXSC_INDEX_CHECK)
945  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & operator -=("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
946 #endif
947  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
948  sl.dat[j]-=rv.dat[i];
949  return sl;
950  }
951 
952  template <class V>
953  TINLINE V _vminus(const V &rv) throw()
954  {
955  V sum(rv.l,rv.u);
956 
957  for (int i=0;i<rv.size;i++)
958  sum.dat[i]= -rv.dat[i];
959 
960  return sum;
961  }
962 
963  template <class VS,class V>
964  TINLINE V _vsminus(const VS &sl) throw()
965  {
966  V sum(sl.start,sl.end);
967 
968  for (int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
969  sum.dat[i]= -sl.dat[j];
970 
971  return sum;
972  }
973 
974  template <class V1,class V2,class E>
975  TINLINE E _vvminus(const V1 &rv1, const V2 &rv2)
976 #if(CXSC_INDEX_CHECK)
977  throw(ERROR__OP_WITH_WRONG_DIM<E>)
978 #else
979  throw()
980 #endif
981  {
982  E sum(rv1.l,rv1.u);
983 
984 #if(CXSC_INDEX_CHECK)
985  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator -(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
986 #endif
987  for (int i=0;i<rv1.size;i++)
988  sum.dat[i]=rv1.dat[i]-rv2.dat[i];
989  return sum;
990  }
991 
992  template <class V,class VS,class E>
993  TINLINE E _vvsminus(const V &rv, const VS &sl)
994 #if(CXSC_INDEX_CHECK)
995  throw(ERROR__OP_WITH_WRONG_DIM<E>)
996 #else
997  throw()
998 #endif
999  {
1000  E sum(rv.l,rv.u);
1001 
1002 #if(CXSC_INDEX_CHECK)
1003  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator -(const "+nameof(rv)+" &, const "+nameof(sl)+" &)"));
1004 #endif
1005  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1006  sum.dat[i]=rv.dat[i]-sl.dat[j];
1007 
1008  return sum;
1009  }
1010 
1011  template <class VS,class V,class E>
1012  TINLINE E _vsvminus(const VS &sl,const V &rv)
1013 #if(CXSC_INDEX_CHECK)
1014  throw(ERROR__OP_WITH_WRONG_DIM<E>)
1015 #else
1016  throw()
1017 #endif
1018  {
1019  E sum(sl.start,sl.end);
1020 
1021 #if(CXSC_INDEX_CHECK)
1022  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator -(const "+nameof(sl)+" &,const "+nameof(rv)+" &)"));
1023 #endif
1024  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1025  sum.dat[i]=sl.dat[j]-rv.dat[i];
1026  return sum;
1027  }
1028 
1029  template <class V1,class V2,class E>
1030  TINLINE E _vvconv(const V1 &rv1, const V2 &rv2)
1031 #if(CXSC_INDEX_CHECK)
1032  throw(ERROR__OP_WITH_WRONG_DIM<E>)
1033 #else
1034  throw()
1035 #endif
1036  {
1037  E sum(rv1.l,rv1.u);
1038 
1039 #if(CXSC_INDEX_CHECK)
1040  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1041 #endif
1042  for (int i=0;i<rv1.size;i++)
1043  sum.dat[i]=rv1.dat[i]|rv2.dat[i];
1044  return sum;
1045  }
1046 
1047  template <class V,class VS,class E>
1048  TINLINE E _vvsconv(const V &rv,const VS &sl)
1049 #if(CXSC_INDEX_CHECK)
1050  throw(ERROR__OP_WITH_WRONG_DIM<E>)
1051 #else
1052  throw()
1053 #endif
1054  {
1055  E sum(rv.l,rv.u);
1056 
1057 #if(CXSC_INDEX_CHECK)
1058  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(rv)+" &,const "+nameof(sl)+" &)"));
1059 #endif
1060  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1061  sum.dat[i]=rv.dat[i]|sl.dat[j];
1062  return sum;
1063  }
1064 
1065  template <class VS1,class VS2,class E>
1066  TINLINE E _vsvsconv(const VS1 &s1,const VS2 &s2)
1067 #if(CXSC_INDEX_CHECK)
1068  throw(ERROR__OP_WITH_WRONG_DIM<E>)
1069 #else
1070  throw()
1071 #endif
1072  {
1073  E sum(s1.start,s1.end);
1074 
1075 #if(CXSC_INDEX_CHECK)
1076  if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(s1)+" &,const "+nameof(s2)+" &)"));
1077 #endif
1078  for(int i=s1.start-s1.l,j=s2.start-s2.l,k=0;k<s1.size;i++,j++,k++)
1079  sum.dat[k]=s1.dat[i]|s2.dat[j];
1080  return sum;
1081  }
1082 
1083  template <class V1,class V2>
1084  TINLINE V1 &_vvconvassign(V1 &rv1, const V2 &rv2)
1085 #if(CXSC_INDEX_CHECK)
1086  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
1087 #else
1088  throw()
1089 #endif
1090  {
1091 #if(CXSC_INDEX_CHECK)
1092  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & operator +=("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1093 #endif
1094  for(int i=0;i<rv1.size;i++)
1095  rv1.dat[i]|=rv2.dat[i];
1096  return rv1;
1097  }
1098 
1099  template <class V,class VS>
1100  TINLINE V &_vvsconvassign(V &rv, const VS &sl)
1101 #if(CXSC_INDEX_CHECK)
1102  throw(ERROR__OP_WITH_WRONG_DIM<V>)
1103 #else
1104  throw()
1105 #endif
1106  {
1107 #if(CXSC_INDEX_CHECK)
1108  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & operator +=("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
1109 #endif
1110  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1111  rv.dat[i]|=sl.dat[j];
1112  return rv;
1113  }
1114 
1115  template <class VS,class V>
1116  TINLINE VS &_vsvconvassign(VS &sl, const V &rv)
1117 #if(CXSC_INDEX_CHECK)
1118  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
1119 #else
1120  throw()
1121 #endif
1122  {
1123 #if(CXSC_INDEX_CHECK)
1124  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & operator +=("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
1125 #endif
1126  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1127  sl.dat[j]|=rv.dat[i];
1128  return sl;
1129  }
1130 
1131  template <class VS1,class VS2>
1132  TINLINE VS1 &_vsvsconvassign(VS1 &sl1, const VS2 &sl2)
1133 #if(CXSC_INDEX_CHECK)
1134  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
1135 #else
1136  throw()
1137 #endif
1138  {
1139 #if(CXSC_INDEX_CHECK)
1140  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" & operator +=("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
1141 #endif
1142  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
1143  sl1.dat[j]|=sl2.dat[k];
1144  return sl1;
1145  }
1146 
1147  template <class V1,class V2,class E>
1148  TINLINE E _vvsect(const V1 &rv1, const V2 &rv2)
1149 #if(CXSC_INDEX_CHECK)
1150  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
1151 #else
1152  throw()
1153 #endif
1154  {
1155  E sum(rv1.l,rv1.u);
1156 
1157 #if(CXSC_INDEX_CHECK)
1158  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(sum)+" operator +(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1159 #endif
1160  for (int i=0;i<rv1.size;i++)
1161  sum.dat[i]=rv1.dat[i]&rv2.dat[i];
1162  return sum;
1163  }
1164 
1165  template <class V,class VS,class E>
1166  TINLINE E _vvssect(const V &rv,const VS &sl)
1167 #if(CXSC_INDEX_CHECK)
1168  throw(ERROR__OP_WITH_WRONG_DIM<E>)
1169 #else
1170  throw()
1171 #endif
1172  {
1173  E sum(rv.l,rv.u);
1174 
1175 #if(CXSC_INDEX_CHECK)
1176  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(rv)+" &,const "+nameof(sl)+" &)"));
1177 #endif
1178  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1179  sum.dat[i]=rv.dat[i]&sl.dat[j];
1180  return sum;
1181  }
1182 
1183  template <class VS1,class VS2,class E>
1184  TINLINE E _vsvssect(const VS1 &s1,const VS2 &s2)
1185 #if(CXSC_INDEX_CHECK)
1186  throw(ERROR__OP_WITH_WRONG_DIM<E>)
1187 #else
1188  throw()
1189 #endif
1190  {
1191  E sum(s1.start,s1.end);
1192 
1193 #if(CXSC_INDEX_CHECK)
1194  if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(s1)+" &,const "+nameof(s2)+" &)"));
1195 #endif
1196  for(int i=s1.start-s1.l,j=s2.start-s2.l,k=0;k<s1.size;i++,j++,k++)
1197  sum.dat[k]=s1.dat[i]&s2.dat[j];
1198  return sum;
1199  }
1200 
1201  template <class V1,class V2>
1202  TINLINE V1 &_vvsectassign(V1 &rv1, const V2 &rv2)
1203 #if(CXSC_INDEX_CHECK)
1204  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
1205 #else
1206  throw()
1207 #endif
1208  {
1209 #if(CXSC_INDEX_CHECK)
1210  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & operator +=("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1211 #endif
1212  for(int i=0;i<rv1.size;i++)
1213  rv1.dat[i]&=rv2.dat[i];
1214  return rv1;
1215  }
1216 
1217  template <class V,class VS>
1218  TINLINE V &_vvssectassign(V &rv, const VS &sl)
1219 #if(CXSC_INDEX_CHECK)
1220  throw(ERROR__OP_WITH_WRONG_DIM<V>)
1221 #else
1222  throw()
1223 #endif
1224  {
1225 #if(CXSC_INDEX_CHECK)
1226  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & operator +=("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
1227 #endif
1228  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1229  rv.dat[i]&=sl.dat[j];
1230  return rv;
1231  }
1232 
1233  template <class VS,class V>
1234  TINLINE VS &_vsvsectassign(VS &sl, const V &rv)
1235 #if(CXSC_INDEX_CHECK)
1236  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
1237 #else
1238  throw()
1239 #endif
1240  {
1241 #if(CXSC_INDEX_CHECK)
1242  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & operator +=("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
1243 #endif
1244  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1245  sl.dat[j]&=rv.dat[i];
1246  return sl;
1247  }
1248 
1249  template <class VS1,class VS2>
1250  TINLINE VS1 &_vsvssectassign(VS1 &sl1, const VS2 &sl2)
1251 #if(CXSC_INDEX_CHECK)
1252  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
1253 #else
1254  throw()
1255 #endif
1256  {
1257 #if(CXSC_INDEX_CHECK)
1258  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" & operator +=("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
1259 #endif
1260  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
1261  sl1.dat[j]&=sl2.dat[k];
1262  return sl1;
1263  }
1264 
1265  template <class V1,class V2>
1266  TINLINE bool _vveq(const V1 &rv1, const V2 &rv2) throw()
1267  {
1268  if(rv1.size!=rv2.size)
1269  return(false);
1270 
1271  int i;
1272  for (i=0;i<rv1.size && rv1.dat[i]==rv2.dat[i];i++);
1273 
1274  return (i==rv1.size);
1275  }
1276 
1277  template <class VS,class V>
1278  TINLINE bool _vsveq(const VS &sl, const V &rv) throw()
1279  {
1280  if(sl.size!=rv.size)
1281  return(false);
1282 
1283  int i,j;
1284  for (i=0,j=sl.start-sl.l;i<rv.size && sl.dat[j]==rv.dat[i];i++,j++);
1285 
1286  return (i==rv.size);
1287  }
1288 
1289  template <class V1,class V2>
1290  TINLINE bool _vvneq(const V1 &rv1, const V2 &rv2) throw()
1291  {
1292  if(rv1.size!=rv2.size)
1293  return(true);
1294 
1295  int i;
1296  for (i=0;i<rv1.size && rv1.dat[i]==rv2.dat[i];i++);
1297 
1298  return (i!=rv1.size);
1299  }
1300 
1301  template <class VS,class V>
1302  TINLINE bool _vsvneq(const VS &sl, const V &rv) throw()
1303  {
1304  if(sl.size!=rv.size)
1305  return(true);
1306 
1307  int i,j;
1308  for (i=0,j=sl.start-sl.l;i<rv.size && sl.dat[j]==rv.dat[i];i++,j++);
1309 
1310  return (i!=rv.size);
1311  }
1312 
1313  template <class V1,class V2>
1314  TINLINE bool _vvless(const V1 &rv1, const V2 &rv2) throw()
1315  {
1316  if(rv1.size!=rv2.size)
1317  return(false);
1318 
1319  int i;
1320  for(i=0;i<rv1.size&&(rv1.dat[i]<rv2.dat[i]);i++);
1321 
1322  return (i==rv1.size);
1323  }
1324 
1325  template <class VS,class V>
1326  TINLINE bool _vsvless(const VS &sl, const V &rv) throw()
1327  {
1328  if(sl.size!=rv.size)
1329  return(false);
1330 
1331  int i,j;
1332  for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]<rv.dat[j]);i++,j++);
1333 
1334  return (j==sl.size);
1335  }
1336 
1337  template <class V1,class V2>
1338  TINLINE bool _vvleq(const V1 &rv1, const V2 &rv2) throw()
1339  {
1340  if(rv1.size!=rv2.size)
1341  return(false);
1342 
1343  int i;
1344  for(i=0;i<rv1.size&&(rv1.dat[i]<=rv2.dat[i]);i++);
1345 
1346  return (i==rv1.size);
1347  }
1348 
1349  template <class VS,class V>
1350  TINLINE bool _vsvleq(const VS &sl, const V &rv) throw()
1351  {
1352  if(sl.size!=rv.size)
1353  return(false);
1354 
1355  int i,j;
1356  for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]<=rv.dat[j]);i++,j++);
1357 
1358  return (j==sl.size);
1359  }
1360 
1361  template <class V,class VS>
1362  TINLINE bool _vvsless(const V &rv, const VS &sl) throw()
1363  {
1364  if(sl.size!=rv.size)
1365  return(false);
1366 
1367  int i,j;
1368  for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]>rv.dat[j]);i++,j++);
1369 
1370  return (j==sl.size);
1371  }
1372 
1373  template <class V,class VS>
1374  TINLINE bool _vvsleq(const V &rv, const VS &sl) throw()
1375  {
1376  if(sl.size!=rv.size)
1377  return(false);
1378 
1379  int i,j;
1380  for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]>=rv.dat[j]);i++,j++);
1381 
1382  return (j==sl.size);
1383  }
1384 
1385  template <class V>
1386  TINLINE bool _vnot(const V &rv) throw()
1387  {
1388  int i;
1389  for(i=0;i<rv.size;i++)
1390  {
1391  if(!!rv.dat[i])
1392  return(false);
1393  }
1394 
1395  return true;
1396  }
1397 
1398  template <class V>
1399  TINLINE void *_vvoid(const V &rv) throw()
1400  {
1401  for(int i=0;i<rv.size;i++)
1402  {
1403  if(!!rv.dat[i])
1404  return (void *)1;
1405  }
1406 
1407  return (void *)0;
1408  }
1409 
1410  template <class V>
1411  TINLINE V _vconj(const V &rv) throw()
1412  {
1413  V erg(rv.l,rv.u);
1414 
1415  for(int i=0;i<rv.size;i++)
1416  erg.dat[i]=conj(rv.dat[i]);
1417 
1418  return erg;
1419  }
1420 
1421  template <class VS,class E>
1422  TINLINE E _vsconj(const VS &sl) throw()
1423  {
1424  E erg(sl.start,sl.end);
1425 
1426  for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1427  erg.dat[i]=conj(sl.dat[j]);
1428 
1429  return erg;
1430  }
1431 
1432  template <class V,class E>
1433  TINLINE E _vabs(const V &rv) throw()
1434  {
1435  E erg(rv.l,rv.u);
1436 
1437  for(int i=0;i<rv.size;i++)
1438  erg.dat[i]=abs(rv.dat[i]);
1439 
1440  return erg;
1441  }
1442 
1443  template <class VS,class E>
1444  TINLINE E _vsabs(const VS &sl) throw()
1445  {
1446  E erg(sl.start,sl.end);
1447 
1448  for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1449  erg.dat[i]=abs(sl.dat[j]);
1450 
1451  return erg;
1452  }
1453 
1454  template <class V,class E>
1455  TINLINE E _vdiam(const V &rv) throw()
1456  {
1457  E erg(rv.l,rv.u);
1458 
1459  for(int i=0;i<rv.size;i++)
1460  erg.dat[i]=diam(rv.dat[i]);
1461 
1462  return erg;
1463  }
1464 
1465  template <class VS,class E>
1466  TINLINE E _vsdiam(const VS &sl) throw()
1467  {
1468  E erg(sl.start,sl.end);
1469 
1470  for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1471  erg.dat[i]=diam(sl.dat[j]);
1472 
1473  return erg;
1474  }
1475 
1476  template <class V,class E>
1477  TINLINE E _vmid(const V &rv) throw()
1478  {
1479  E erg(rv.l,rv.u);
1480 
1481  for(int i=0;i<rv.size;i++)
1482  erg.dat[i]=mid(rv.dat[i]);
1483 
1484  return erg;
1485  }
1486 
1487  template <class VS,class E>
1488  TINLINE E _vsmid(const VS &sl) throw()
1489  {
1490  E erg(sl.start,sl.end);
1491 
1492  for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1493  erg.dat[i]=mid(sl.dat[j]);
1494 
1495  return erg;
1496  }
1497 
1498  template <class V,class E>
1499  TINLINE E _vinf(const V &rv) throw()
1500  {
1501  E erg(rv.l,rv.u);
1502 
1503  for(int i=0;i<rv.size;i++)
1504  erg.dat[i]=Inf(rv.dat[i]);
1505 
1506  return erg;
1507  }
1508 
1509  template <class VS,class E>
1510  TINLINE E _vsinf(const VS &sl) throw()
1511  {
1512  E erg(sl.start,sl.end);
1513 
1514  for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1515  erg.dat[i]=Inf(sl.dat[j]);
1516 
1517  return erg;
1518  }
1519 
1520  template <class V,class E>
1521  TINLINE E _vsup(const V &rv) throw()
1522  {
1523  E erg(rv.l,rv.u);
1524 
1525  for(int i=0;i<rv.size;i++)
1526  erg.dat[i]=Sup(rv.dat[i]);
1527 
1528  return erg;
1529  }
1530 
1531  template <class VS,class E>
1532  TINLINE E _vssup(const VS &sl) throw()
1533  {
1534  E erg(sl.start,sl.end);
1535 
1536  for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1537  erg.dat[i]=Sup(sl.dat[j]);
1538 
1539  return erg;
1540  }
1541 
1542  template <class V,class E>
1543  TINLINE E _vre(const V &rv) throw()
1544  {
1545  E erg(rv.l,rv.u);
1546 
1547  for(int i=0;i<rv.size;i++)
1548  erg.dat[i]=Re(rv.dat[i]);
1549 
1550  return erg;
1551  }
1552 
1553  template <class VS,class E>
1554  TINLINE E _vsre(const VS &sl) throw()
1555  {
1556  E erg(sl.start,sl.end);
1557 
1558  for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1559  erg.dat[i]=Re(sl.dat[j]);
1560 
1561  return erg;
1562  }
1563 
1564  template <class V,class E>
1565  TINLINE E _vim(const V &rv) throw()
1566  {
1567  E erg(rv.l,rv.u);
1568 
1569  for(int i=0;i<rv.size;i++)
1570  erg.dat[i]=Im(rv.dat[i]);
1571 
1572  return erg;
1573  }
1574 
1575  template <class VS,class E>
1576  TINLINE E _vsim(const VS &sl) throw()
1577  {
1578  E erg(sl.start,sl.end);
1579 
1580  for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1581  erg.dat[i]=Im(sl.dat[j]);
1582 
1583  return erg;
1584  }
1585 
1586  template <class V,class S>
1587  TINLINE V &_vsusetsup(V &v, const S &s) throw()
1588  {
1589  for(int i=0;i<v.size;i++)
1590  UncheckedSetInf(v.dat[i],s);
1591  return v;
1592  }
1593 
1594  template <class V,class S>
1595  TINLINE V &_vsusetinf(V &v, const S &s) throw()
1596  {
1597  for(int i=0;i<v.size;i++)
1598  UncheckedSetInf(v.dat[i],s);
1599  return v;
1600  }
1601 
1602  template <class V,class S>
1603  TINLINE V &_vssetinf(V &v, const S &s) throw()
1604  {
1605  for(int i=0;i<v.size;i++)
1606  SetInf(v.dat[i],s);
1607  return v;
1608  }
1609 
1610  template <class V,class S>
1611  TINLINE V &_vssetsup(V &v, const S &s) throw()
1612  {
1613  for(int i=0;i<v.size;i++)
1614  SetSup(v.dat[i],s);
1615  return v;
1616  }
1617 
1618  template <class V,class S>
1619  TINLINE V &_vssetre(V &v, const S &s) throw()
1620  {
1621  for(int i=0;i<v.size;i++)
1622  SetRe(v.dat[i],s);
1623  return v;
1624  }
1625 
1626  template <class V,class S>
1627  TINLINE V &_vssetim(V &v, const S &s) throw()
1628  {
1629  for(int i=0;i<v.size;i++)
1630  SetIm(v.dat[i],s);
1631  return v;
1632  }
1633 
1634  template <class VS,class S>
1635  TINLINE VS &_vssusetsup(VS &vs, const S &s) throw()
1636  {
1637  for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1638  UncheckedSetInf(vs.dat[i],s);
1639  return vs;
1640  }
1641 
1642  template <class VS,class S>
1643  TINLINE VS &_vssusetinf(VS &vs, const S &s) throw()
1644  {
1645  for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1646  UncheckedSetInf(vs.dat[i],s);
1647  return vs;
1648  }
1649 
1650  template <class VS,class S>
1651  TINLINE VS &_vsssetinf(VS &vs, const S &s) throw()
1652  {
1653  for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1654  SetInf(vs.dat[i],s);
1655  return vs;
1656  }
1657 
1658  template <class VS,class S>
1659  TINLINE VS &_vsssetsup(VS &vs, const S &s) throw()
1660  {
1661  for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1662  SetSup(vs.dat[i],s);
1663  return vs;
1664  }
1665 
1666  template <class VS,class S>
1667  TINLINE VS &_vsssetre(VS &vs, const S &s) throw()
1668  {
1669  for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1670  SetRe(vs.dat[i],s);
1671  return vs;
1672  }
1673 
1674  template <class VS,class S>
1675  TINLINE VS &_vsssetim(VS &vs, const S &s) throw()
1676  {
1677  for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1678  SetIm(vs.dat[i],s);
1679  return vs;
1680  }
1681 
1682  template <class V1,class V2>
1683  TINLINE V1 &_vvsetinf(V1 &rv1, const V2 &rv2)
1684 #if(CXSC_INDEX_CHECK)
1685  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
1686 #else
1687  throw()
1688 #endif
1689  {
1690 #if(CXSC_INDEX_CHECK)
1691  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & SetInf("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1692 #endif
1693  for(int i=0;i<rv1.size;i++)
1694  SetInf(rv1.dat[i],rv2.dat[i]);
1695  return rv1;
1696  }
1697 
1698  template <class V,class VS>
1699  TINLINE V &_vvssetinf(V &rv, const VS &sl)
1700 #if(CXSC_INDEX_CHECK)
1701  throw(ERROR__OP_WITH_WRONG_DIM<V>)
1702 #else
1703  throw()
1704 #endif
1705  {
1706 #if(CXSC_INDEX_CHECK)
1707  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & SetInf("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
1708 #endif
1709  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1710  SetInf(rv.dat[i],sl.dat[j]);
1711  return rv;
1712  }
1713 
1714  template <class VS,class V>
1715  TINLINE VS &_vsvsetinf(VS &sl, const V &rv)
1716 #if(CXSC_INDEX_CHECK)
1717  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
1718 #else
1719  throw()
1720 #endif
1721  {
1722 #if(CXSC_INDEX_CHECK)
1723  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & SetInf("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
1724 #endif
1725  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1726  SetInf(sl.dat[j],rv.dat[i]);
1727  return sl;
1728  }
1729 
1730  template <class VS1,class VS2>
1731  TINLINE VS1 &_vsvssetinf(VS1 &sl1, const VS2 &sl2)
1732 #if(CXSC_INDEX_CHECK)
1733  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
1734 #else
1735  throw()
1736 #endif
1737  {
1738 #if(CXSC_INDEX_CHECK)
1739  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &SetInf("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
1740 #endif
1741  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
1742  SetInf(sl1.dat[j],sl2.dat[k]);
1743  return sl1;
1744  }
1745 
1746  template <class V1,class V2>
1747  TINLINE V1 &_vvsetsup(V1 &rv1, const V2 &rv2)
1748 #if(CXSC_INDEX_CHECK)
1749  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
1750 #else
1751  throw()
1752 #endif
1753  {
1754 #if(CXSC_INDEX_CHECK)
1755  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &SetSup("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1756 #endif
1757  for(int i=0;i<rv1.size;i++)
1758  SetSup(rv1.dat[i],rv2.dat[i]);
1759  return rv1;
1760  }
1761 
1762  template <class V,class VS>
1763  TINLINE V &_vvssetsup(V &rv, const VS &sl)
1764 #if(CXSC_INDEX_CHECK)
1765  throw(ERROR__OP_WITH_WRONG_DIM<V>)
1766 #else
1767  throw()
1768 #endif
1769  {
1770 #if(CXSC_INDEX_CHECK)
1771  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &SetSup("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
1772 #endif
1773  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1774  SetSup(rv.dat[i],sl.dat[j]);
1775  return rv;
1776  }
1777 
1778  template <class VS,class V>
1779  TINLINE VS &_vsvsetsup(VS &sl, const V &rv)
1780 #if(CXSC_INDEX_CHECK)
1781  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
1782 #else
1783  throw()
1784 #endif
1785  {
1786 #if(CXSC_INDEX_CHECK)
1787  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" &SetSup("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
1788 #endif
1789  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1790  SetSup(sl.dat[j],rv.dat[i]);
1791  return sl;
1792  }
1793 
1794  template <class VS1,class VS2>
1795  TINLINE VS1 &_vsvssetsup(VS1 &sl1, const VS2 &sl2)
1796 #if(CXSC_INDEX_CHECK)
1797  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
1798 #else
1799  throw()
1800 #endif
1801  {
1802 #if(CXSC_INDEX_CHECK)
1803  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &SetSup("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
1804 #endif
1805  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
1806  SetSup(sl1.dat[j],sl2.dat[k]);
1807  return sl1;
1808  }
1809 
1810  template <class V1,class V2>
1811  TINLINE V1 &_vvusetinf(V1 &rv1, const V2 &rv2)
1812 #if(CXSC_INDEX_CHECK)
1813  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
1814 #else
1815  throw()
1816 #endif
1817  {
1818 #if(CXSC_INDEX_CHECK)
1819  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &UncheckedSetInf("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1820 #endif
1821  for(int i=0;i<rv1.size;i++)
1822  UncheckedSetInf(rv1.dat[i],rv2.dat[i]);
1823  return rv1;
1824  }
1825 
1826  template <class V,class VS>
1827  TINLINE V &_vvsusetinf(V &rv, const VS &sl)
1828 #if(CXSC_INDEX_CHECK)
1829  throw(ERROR__OP_WITH_WRONG_DIM<V>)
1830 #else
1831  throw()
1832 #endif
1833  {
1834 #if(CXSC_INDEX_CHECK)
1835  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &UncheckedSetInf("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
1836 #endif
1837  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1838  UncheckedSetInf(rv.dat[i],sl.dat[j]);
1839  return rv;
1840  }
1841 
1842  template <class VS,class V>
1843  TINLINE VS &_vsvusetinf(VS &sl, const V &rv)
1844 #if(CXSC_INDEX_CHECK)
1845  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
1846 #else
1847  throw()
1848 #endif
1849  {
1850 #if(CXSC_INDEX_CHECK)
1851  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" &UncheckedSetInf("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
1852 #endif
1853  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1854  UncheckedSetInf(sl.dat[j],rv.dat[i]);
1855  return sl;
1856  }
1857 
1858  template <class VS1,class VS2>
1859  TINLINE VS1 &_vsvsusetinf(VS1 &sl1, const VS2 &sl2)
1860 #if(CXSC_INDEX_CHECK)
1861  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
1862 #else
1863  throw()
1864 #endif
1865  {
1866 #if(CXSC_INDEX_CHECK)
1867  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &UncheckedSetInf("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
1868 #endif
1869  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
1870  UncheckedSetInf(sl1.dat[j],sl2.dat[k]);
1871  return sl1;
1872  }
1873 
1874  template <class V1,class V2>
1875  TINLINE V1 &_vvusetsup(V1 &rv1, const V2 &rv2)
1876 #if(CXSC_INDEX_CHECK)
1877  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
1878 #else
1879  throw()
1880 #endif
1881  {
1882 #if(CXSC_INDEX_CHECK)
1883  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &UncheckedSetSup("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1884 #endif
1885  for(int i=0;i<rv1.size;i++)
1886  UncheckedSetSup(rv1.dat[i],rv2.dat[i]);
1887  return rv1;
1888  }
1889 
1890  template <class V,class VS>
1891  TINLINE V &_vvsusetsup(V &rv, const VS &sl)
1892 #if(CXSC_INDEX_CHECK)
1893  throw(ERROR__OP_WITH_WRONG_DIM<V>)
1894 #else
1895  throw()
1896 #endif
1897  {
1898 #if(CXSC_INDEX_CHECK)
1899  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &UncheckedSetSup("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
1900 #endif
1901  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1902  UncheckedSetSup(rv.dat[i],sl.dat[j]);
1903  return rv;
1904  }
1905 
1906  template <class VS,class V>
1907  TINLINE VS &_vsvusetsup(VS &sl, const V &rv)
1908 #if(CXSC_INDEX_CHECK)
1909  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
1910 #else
1911  throw()
1912 #endif
1913  {
1914 #if(CXSC_INDEX_CHECK)
1915  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" &UncheckedSetSup("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
1916 #endif
1917  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1918  UncheckedSetSup(sl.dat[j],rv.dat[i]);
1919  return sl;
1920  }
1921 
1922  template <class VS1,class VS2>
1923  TINLINE VS1 &_vsvsusetsup(VS1 &sl1, const VS2 &sl2)
1924 #if(CXSC_INDEX_CHECK)
1925  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
1926 #else
1927  throw()
1928 #endif
1929  {
1930 #if(CXSC_INDEX_CHECK)
1931  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &UncheckedSetSup("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
1932 #endif
1933  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
1934  UncheckedSetSup(sl1.dat[j],sl2.dat[k]);
1935  return sl1;
1936  }
1937 
1938  template <class V1,class V2>
1939  TINLINE V1 &_vvsetim(V1 &rv1, const V2 &rv2)
1940 #if(CXSC_INDEX_CHECK)
1941  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
1942 #else
1943  throw()
1944 #endif
1945  {
1946 #if(CXSC_INDEX_CHECK)
1947  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &SetIm("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
1948 #endif
1949  for(int i=0;i<rv1.size;i++)
1950  SetIm(rv1.dat[i],rv2.dat[i]);
1951  return rv1;
1952  }
1953 
1954  template <class V,class VS>
1955  TINLINE V &_vvssetim(V &rv, const VS &sl)
1956 #if(CXSC_INDEX_CHECK)
1957  throw(ERROR__OP_WITH_WRONG_DIM<V>)
1958 #else
1959  throw()
1960 #endif
1961  {
1962 #if(CXSC_INDEX_CHECK)
1963  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &SetIm("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
1964 #endif
1965  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1966  SetIm(rv.dat[i],sl.dat[j]);
1967  return rv;
1968  }
1969 
1970  template <class VS,class V>
1971  TINLINE VS &_vsvsetim(VS &sl, const V &rv)
1972 #if(CXSC_INDEX_CHECK)
1973  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
1974 #else
1975  throw()
1976 #endif
1977  {
1978 #if(CXSC_INDEX_CHECK)
1979  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>("SetIm("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
1980 #endif
1981  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1982  SetIm(sl.dat[j],rv.dat[i]);
1983  return sl;
1984  }
1985 
1986  template <class VS1,class VS2>
1987  TINLINE VS1 &_vsvssetim(VS1 &sl1, const VS2 &sl2)
1988 #if(CXSC_INDEX_CHECK)
1989  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
1990 #else
1991  throw()
1992 #endif
1993  {
1994 #if(CXSC_INDEX_CHECK)
1995  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &SetIm("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
1996 #endif
1997  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
1998  SetIm(sl1.dat[j],sl2.dat[k]);
1999  return sl1;
2000  }
2001 
2002  template <class V1,class V2>
2003  TINLINE V1 &_vvsetre(V1 &rv1, const V2 &rv2)
2004 #if(CXSC_INDEX_CHECK)
2005  throw(ERROR__OP_WITH_WRONG_DIM<V1>)
2006 #else
2007  throw()
2008 #endif
2009  {
2010 #if(CXSC_INDEX_CHECK)
2011  if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &SetRe("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
2012 #endif
2013  for(int i=0;i<rv1.size;i++)
2014  SetRe(rv1.dat[i],rv2.dat[i]);
2015  return rv1;
2016  }
2017 
2018  template <class V,class VS>
2019  TINLINE V &_vvssetre(V &rv, const VS &sl)
2020 #if(CXSC_INDEX_CHECK)
2021  throw(ERROR__OP_WITH_WRONG_DIM<V>)
2022 #else
2023  throw()
2024 #endif
2025  {
2026 #if(CXSC_INDEX_CHECK)
2027  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &SetRe("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
2028 #endif
2029  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
2030  SetRe(rv.dat[i],sl.dat[j]);
2031  return rv;
2032  }
2033 
2034  template <class VS,class V>
2035  TINLINE VS &_vsvsetre(VS &sl, const V &rv)
2036 #if(CXSC_INDEX_CHECK)
2037  throw(ERROR__OP_WITH_WRONG_DIM<VS>)
2038 #else
2039  throw()
2040 #endif
2041  {
2042 #if(CXSC_INDEX_CHECK)
2043  if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" &SetRe("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
2044 #endif
2045  for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
2046  SetRe(sl.dat[j],rv.dat[i]);
2047  return sl;
2048  }
2049 
2050  template <class VS1,class VS2>
2051  TINLINE VS1 &_vsvssetre(VS1 &sl1, const VS2 &sl2)
2052 #if(CXSC_INDEX_CHECK)
2053  throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
2054 #else
2055  throw()
2056 #endif
2057  {
2058 #if(CXSC_INDEX_CHECK)
2059  if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &SetRe("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
2060 #endif
2061  for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
2062  SetRe(sl1.dat[j],sl2.dat[k]);
2063  return sl1;
2064  }
2065 
2066  template <class DP,class VS1,class VS2>
2067  TINLINE void _vsvsaccu(DP &dp, const VS1 & sl1, const VS2 &sl2)
2068 #if(CXSC_INDEX_CHECK)
2069  throw(OP_WITH_WRONG_DIM)
2070 #else
2071  throw()
2072 #endif
2073  {
2074 #if(CXSC_INDEX_CHECK)
2075  if(sl1.size!=sl2.size) cxscthrow(OP_WITH_WRONG_DIM("void accumulate("+nameof(dp)+" &, const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
2076 #endif
2077  for(int i=sl1.start-sl1.l,j=sl2.start-sl2.l,k=0;k<sl1.size;k++,i++,j++)
2078  accumulate(dp,sl1.dat[i],sl2.dat[j]);
2079  }
2080 
2081  template <class VS1,class VS2>
2082  TINLINE bool _vsvseq(const VS1 &sl1, const VS2 &sl2) throw()
2083  {
2084  if(sl1.size!=sl2.size)
2085  return(false);
2086 
2087  int i,j,k;
2088  for (i=sl1.start-sl1.l,j=sl2.start-sl2.l,k=0;k<sl1.size && sl1.dat[i]==sl2.dat[j];k++,j++,i++);
2089 
2090  return (k==sl1.size);
2091  }
2092 
2093  template <class VS1,class VS2>
2094  TINLINE bool _vsvsneq(const VS1 &sl1, const VS2 &sl2) throw()
2095  {
2096  if(sl1.size!=sl2.size)
2097  return(true);
2098 
2099  int i,j,k;
2100  for (i=sl1.start-sl1.l,j=sl2.start-sl2.l,k=0;k<sl1.size && sl1.dat[i]==sl2.dat[j];i++,j++,k++);
2101 
2102  return (k!=sl1.size);
2103  }
2104 
2105  template <class VS1,class VS2>
2106  TINLINE bool _vsvsless(const VS1 &sl1, const VS2 &sl2) throw()
2107  {
2108  if(sl1.size!=sl2.size)
2109  return(false);
2110 
2111  int i,j,k;
2112  for (i=sl1.start-sl1.l,j=sl2.start-sl2.l,k=0;k<sl1.size && sl1.dat[i]<sl2.dat[j];k++,j++,i++);
2113 
2114  return (k==sl1.size);
2115  }
2116 
2117  template <class VS1,class VS2>
2118  TINLINE bool _vsvsleq(const VS1 &sl1, const VS2 &sl2) throw()
2119  {
2120  if(sl1.size!=sl2.size)
2121  return(true);
2122 
2123  int i,j,k;
2124  for (i=sl1.start-sl1.l,j=sl2.start-sl2.l,k=0;k<sl1.size && sl1.dat[i]<=sl2.dat[j];i++,j++,k++);
2125 
2126  return (k==sl1.size);
2127  }
2128 
2129  template <class VS>
2130  TINLINE bool _vsnot(const VS &sl) throw()
2131  {
2132  for(int i=sl.start-sl.l,k=0;k<sl.size;i++,k++)
2133  {
2134  if(!!sl.dat[i])
2135  return(false);
2136  }
2137 
2138  return true;
2139  }
2140 
2141  template <class VS>
2142  TINLINE void *_vsvoid(const VS &sl) throw()
2143  {
2144  for(int i=sl.start-sl.l,k=0;i<sl.size;i++,k++)
2145  {
2146  if(!!sl.dat[i])
2147  return (void *)1;
2148  }
2149 
2150  return (void *)0;
2151  }
2152 
2153  template <class V>
2154  std::ostream &_vout(std::ostream &s, const V &rv) throw()
2155  {
2156  for(int j=0;j<rv.size;j++)
2157  s<<rv.dat[j]<<std::endl;
2158  return s;
2159  }
2160 
2161  template <class V>
2162  std::istream &_vin(std::istream &s, V &rv) throw()
2163  {
2164  for(int j=0;j<rv.size;j++)
2165  s>>rv.dat[j];
2166  return s;
2167  }
2168 
2169 
2170  template <class V>
2171  std::ostream &_vsout(std::ostream &s, const V &rv) throw()
2172  {
2173  for(int j=rv.start;j<=rv.end;j++)
2174  s<<rv[j]<<std::endl;
2175  return s;
2176  }
2177 
2178  template <class V>
2179  std::istream &_vsin(std::istream &s, V &rv) throw()
2180  {
2181  for(int j=rv.start;j<=rv.end;j++)
2182  s>>rv[j];
2183  return s;
2184  }
2185 
2186 } // namespace cxsc
2187 
2188 #endif
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
cvector mid(const cimatrix_subv &mv)
Returns the middle of the matrix.
Definition: cimatrix.inl:739
cimatrix & SetLb(cimatrix &m, const int &i, const int &j)
Sets the lower bound index.
Definition: cimatrix.inl:1184
void accumulate_approx(cdotprecision &dp, const cmatrix_subv &rv1, const cmatrix_subv &rv2)
The accurate scalar product of the last two arguments added to the value of the first argument (witho...
Definition: cmatrix.cpp:99
cimatrix & SetUb(cimatrix &m, const int &i, const int &j)
Sets the upper bound index.
Definition: cimatrix.inl:1191
cvector diam(const cimatrix_subv &mv)
Returns the diameter of the matrix.
Definition: cimatrix.inl:738
ivector abs(const cimatrix_subv &mv)
Returns the absolute value of the matrix.
Definition: cimatrix.inl:737