00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _CXSC_VECTOR_INL_INCLUDED
00027 #define _CXSC_VECTOR_INL_INCLUDED
00028
00029 #include "except.hpp"
00030
00031 #ifdef CXSC_USE_BLAS
00032 #include "cxsc_blas.hpp"
00033 #endif
00034
00035 namespace cxsc {
00036 int abs(int a);
00037
00038 template <class V>
00039 TINLINE void _vresize(V &rv) throw()
00040 {
00041 rv.size=rv.u=0;
00042 rv.l=1;
00043 delete [] rv.dat;
00044 rv.dat=NULL;
00045 }
00046
00047 template <class V,class S>
00048 TINLINE void _vresize(V &rv, const int &len)
00049 #if(CXSC_INDEX_CHECK)
00050 throw(ERROR__WRONG_BOUNDARIES<V>)
00051 #else
00052 throw()
00053 #endif
00054 {
00055 if(rv.size==len)
00056 SetLb(rv,1);
00057 else
00058 {
00059 #if(CXSC_INDEX_CHECK)
00060 if(len<0) cxscthrow(ERROR__WRONG_BOUNDARIES<V>(" Resize("+nameof(rv)+" &, const int &)"));
00061 #endif
00062 S *ndat=new S[len];
00063 int beg,end;
00064 beg=(rv.l>1)?rv.l:1;
00065 end=(rv.u<len)?rv.u:len;
00066 for(int i=beg-1;i<end;i++)
00067 ndat[i]=rv.dat[i-rv.l+1];
00068 delete [] rv.dat;
00069 rv.dat=ndat;
00070 rv.size=rv.u=len;
00071 rv.l=1;
00072 }
00073 }
00074
00075 template <class V,class S>
00076 TINLINE void _vresize(V &rv, const int &lb, const int &ub)
00077 #if(CXSC_INDEX_CHECK)
00078 throw(ERROR__WRONG_BOUNDARIES<V>)
00079 #else
00080 throw()
00081 #endif
00082 {
00083 if(rv.size==ub-lb+1)
00084 SetUb(rv,ub);
00085 else
00086 {
00087 rv.size=ub-lb+1;
00088 #if(CXSC_INDEX_CHECK)
00089 if(rv.size<0) cxscthrow(ERROR__WRONG_BOUNDARIES<V>("void Resize("+nameof(rv)+" &, const int &, const int &)"));
00090 #endif
00091 S *ndat=new S[rv.size];
00092 int beg,end;
00093 beg=(rv.l>lb)?rv.l:lb;
00094 end=(rv.u<ub)?rv.u:ub;
00095 for(int i=beg;i<=end;i++)
00096 ndat[i-lb]=rv.dat[i-rv.l];
00097 delete [] rv.dat;
00098 rv.dat=ndat;
00099 rv.l=lb;
00100 rv.u=ub;
00101 }
00102 }
00103
00104 template <class V1,class V2,class S>
00105 TINLINE V1 &_vvassign(V1 &rv1,const V2 &rv2) throw()
00106 {
00107 S *ndat=new S[rv2.size];
00108 rv1.l=rv2.l;
00109 rv1.u=rv2.u;
00110 rv1.size=rv2.size;
00111
00112 for (int i=0;i<rv2.size;i++)
00113 ndat[i]=rv2.dat[i];
00114 delete [] rv1.dat;
00115 rv1.dat=ndat;
00116
00117 return rv1;
00118 }
00119
00120 template <class V,class S>
00121 TINLINE V & _vsassign(V &rv,const S &r) throw()
00122 {
00123 for (int i=0;i<rv.size;i++)
00124 rv.dat[i]=r;
00125
00126 return rv;
00127 }
00128
00129 template <class VS1,class VS2>
00130 TINLINE VS1 & _vsvsassign(VS1 &sl1,const VS2 &sl2)
00131 #if(CXSC_INDEX_CHECK)
00132 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00133 #else
00134 throw()
00135 #endif
00136 {
00137 #if(CXSC_INDEX_CHECK)
00138 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" "+nameof(sl1)+"::operator =(const "+nameof(sl2)+" &)"));
00139 #endif
00140 for (int i=sl1.start-sl1.l, j=sl2.start-sl2.l;i<=sl1.end-sl1.l;i++,j++)
00141 sl1.dat[i]=sl2.dat[j];
00142 return sl1;
00143 }
00144
00145 template <class V,class VS,class S>
00146 TINLINE V & _vvsassign(V &rv,const VS &sl) throw()
00147 {
00148 S *ndat=new S[sl.size];
00149 rv.l=sl.start;
00150 rv.u=sl.end;
00151 rv.size=sl.size;
00152 for (int i=sl.start-sl.l, j=0;j<rv.size;i++,j++)
00153 ndat[j]=sl.dat[i];
00154 delete [] rv.dat;
00155 rv.dat=ndat;
00156 return rv;
00157 }
00158
00159 template <class VS,class V>
00160 TINLINE VS & _vsvassign(VS &sl,const V &rv)
00161 #if(CXSC_INDEX_CHECK)
00162 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
00163 #else
00164 throw()
00165 #endif
00166 {
00167 #if(CXSC_INDEX_CHECK)
00168 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" "+nameof(sl)+"::operator =(const "+nameof(rv)+" &)"));
00169 #endif
00170 for (int i=sl.start-sl.l, j=0;j<sl.size;i++,j++)
00171 sl.dat[i]=rv.dat[j];
00172 return sl;
00173 }
00174
00175 template <class VS,class S>
00176 TINLINE VS & _vssassign(VS &sl,const S &r) throw()
00177 {
00178 for (int i=sl.start-sl.l;i<=sl.end-sl.l;i++)
00179 sl.dat[i]=r;
00180 return sl;
00181 }
00182
00183 template <class DP,class V1,class V2>
00184 TINLINE void _vvaccu(DP &dp, const V1 & rv1, const V2 &rv2)
00185 #if(CXSC_INDEX_CHECK)
00186 throw(OP_WITH_WRONG_DIM)
00187 #else
00188 throw()
00189 #endif
00190 {
00191 #if(CXSC_INDEX_CHECK)
00192 if(rv1.size!=rv2.size) cxscthrow(OP_WITH_WRONG_DIM("void accumulate("+nameof(dp)+" &, const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00193 #endif
00194 for(int i=0;i<rv1.size;i++)
00195 accumulate(dp,rv1.dat[i],rv2.dat[i]);
00196 }
00197
00198 template <class DP,class VS,class V>
00199 TINLINE void _vsvaccu(DP &dp, const VS & sl, const V &rv)
00200 #if(CXSC_INDEX_CHECK)
00201 throw(OP_WITH_WRONG_DIM)
00202 #else
00203 throw()
00204 #endif
00205 {
00206 #if(CXSC_INDEX_CHECK)
00207 if(sl.size!=rv.size) cxscthrow(OP_WITH_WRONG_DIM("void accumulate("+nameof(dp)+" &, const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00208 #endif
00209 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
00210 accumulate(dp,sl.dat[j],rv.dat[i]);
00211 }
00212
00213 template <class V,class S,class E>
00214 TINLINE E _vsdiv(const V &rv, const S &s) throw()
00215 {
00216 E p(rv.l,rv.u);
00217
00218 for(int i=0;i<rv.size;i++)
00219 p.dat[i]=rv.dat[i]/s;
00220
00221 return p;
00222 }
00223
00224 template <class V,class S>
00225 TINLINE V &_vsdivassign(V &rv,const S &r) throw()
00226 {
00227 for(int i=0;i<rv.size;i++)
00228 rv.dat[i]/=r;
00229 return rv;
00230 }
00231
00232 template <class VS,class S,class E>
00233 TINLINE E _vssdiv(const VS &sl, const S &s) throw()
00234 {
00235 E p(sl.start,sl.end);
00236
00237 for(int i=sl.start-sl.l;i<sl.size;i++)
00238 p.dat[i]=sl.dat[i]/s;
00239
00240 return p;
00241 }
00242
00243 template <class V,class S,class E>
00244 TINLINE E _vsmult(const V &rv, const S &s) throw()
00245 {
00246 E p(rv.l,rv.u);
00247
00248 for(int i=0;i<rv.size;i++)
00249 p.dat[i]=rv.dat[i]*s;
00250
00251 return p;
00252 }
00253
00254 template <class VS,class S,class E>
00255 TINLINE E _vssmult(const VS &sl, const S &s) throw()
00256 {
00257 E p(sl.start,sl.end);
00258
00259 for(int i=sl.start-sl.l,k=0;k<sl.size;i++,k++)
00260 p.dat[k]=sl.dat[i]*s;
00261
00262 return p;
00263 }
00264
00265 template <class V1,class V2,class E>
00266 TINLINE E _vvlmult(const V1 & rv1, const V2 &rv2)
00267 #if(CXSC_INDEX_CHECK)
00268 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00269 #else
00270 throw()
00271 #endif
00272 {
00273 #if(CXSC_INDEX_CHECK)
00274 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00275 #endif
00276 dotprecision dot(0.0);
00277 accumulate(dot,rv1,rv2);
00278
00279
00280
00281 return E(dot);
00282 }
00283
00284 template <class VS,class V,class E>
00285 TINLINE E _vsvlmult(const VS & sl, const V &rv)
00286 #if(CXSC_INDEX_CHECK)
00287 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00288 #else
00289 throw()
00290 #endif
00291 {
00292 #if(CXSC_INDEX_CHECK)
00293 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00294 #endif
00295 dotprecision dot(0.0);
00296 accumulate(dot,sl,rv);
00297
00298
00299
00300 return E(dot);
00301 }
00302
00303 template <class VS1,class VS2,class E>
00304 TINLINE E _vsvslmult(const VS1 & sl1, const VS2 &sl2)
00305 #if(CXSC_INDEX_CHECK)
00306 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00307 #else
00308 throw()
00309 #endif
00310 {
00311 #if(CXSC_INDEX_CHECK)
00312 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
00313 #endif
00314 dotprecision dot(0.0);
00315 accumulate(dot,sl1,sl2);
00316
00317
00318
00319 return E(dot);
00320 }
00321
00322 template <class V1,class V2,class E>
00323 TINLINE E _vvlimult(const V1 & rv1, const V2 &rv2)
00324 #if(CXSC_INDEX_CHECK)
00325 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00326 #else
00327 throw()
00328 #endif
00329 {
00330 #if(CXSC_INDEX_CHECK)
00331 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00332 #endif
00333 idotprecision idot(0.0);
00334 accumulate(idot,rv1,rv2);
00335
00336 return E(idot);
00337 }
00338
00339 template <class VS,class V,class E>
00340 TINLINE E _vsvlimult(const VS & sl, const V &rv)
00341 #if(CXSC_INDEX_CHECK)
00342 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00343 #else
00344 throw()
00345 #endif
00346 {
00347 #if(CXSC_INDEX_CHECK)
00348 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00349 #endif
00350 idotprecision idot(0.0);
00351 accumulate(idot,sl,rv);
00352
00353 return E(idot);
00354 }
00355
00356 template <class VS1,class VS2,class E>
00357 TINLINE E _vsvslimult(const VS1 & sl1, const VS2 &sl2)
00358 #if(CXSC_INDEX_CHECK)
00359 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00360 #else
00361 throw()
00362 #endif
00363 {
00364 #if(CXSC_INDEX_CHECK)
00365 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
00366 #endif
00367 idotprecision idot(0.0);
00368 accumulate(idot,sl1,sl2);
00369
00370 return E(idot);
00371 }
00372
00373 template <class V1,class V2,class E>
00374 TINLINE E _vvmult(const V1 & rv1, const V2 &rv2)
00375 #if(CXSC_INDEX_CHECK)
00376 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00377 #else
00378 throw()
00379 #endif
00380 {
00381 #if(CXSC_INDEX_CHECK)
00382 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00383 #endif
00384
00385 #ifdef CXSC_USE_BLAS
00386 if(opdotprec == 1)
00387 {
00388 E ret;
00389 blasdot(rv1,rv2,ret);
00390 return ret;
00391 }
00392 else
00393 #endif
00394 {
00395 dotprecision dot(0.0);
00396 dot.set_k(opdotprec);
00397 accumulate_approx(dot,rv1,rv2);
00398 return rnd(dot);
00399 }
00400
00401
00402
00403 }
00404
00405 template <class VS,class V,class E>
00406 TINLINE E _vsvmult(const VS & sl, const V &rv)
00407 #if(CXSC_INDEX_CHECK)
00408 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00409 #else
00410 throw()
00411 #endif
00412 {
00413 #if(CXSC_INDEX_CHECK)
00414 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00415 #endif
00416 #ifdef CXSC_USE_BLAS
00417 if(opdotprec == 1)
00418 {
00419 E ret;
00420 blasdot(sl,rv,ret);
00421 return ret;
00422 }
00423 else
00424 #endif
00425 {
00426 dotprecision dot(0.0);
00427 dot.set_k(opdotprec);
00428 accumulate_approx(dot,sl,rv);
00429 return rnd(dot);
00430 }
00431
00432
00433
00434 }
00435
00436 template <class VS1,class VS2,class E>
00437 TINLINE E _vsvsmult(const VS1 & sl1, const VS2 &sl2)
00438 #if(CXSC_INDEX_CHECK)
00439 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00440 #else
00441 throw()
00442 #endif
00443 {
00444 #if(CXSC_INDEX_CHECK)
00445 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
00446 #endif
00447 #ifdef CXSC_USE_BLAS
00448 if(opdotprec == 1)
00449 {
00450 E ret;
00451 blasdot(sl1,sl2,ret);
00452 return ret;
00453 }
00454 else
00455 #endif
00456 {
00457 dotprecision dot(0.0);
00458 dot.set_k(opdotprec);
00459 accumulate_approx(dot,sl1,sl2);
00460 return rnd(dot);
00461 }
00462
00463
00464
00465 }
00466
00467 template <class V1,class V2,class E>
00468 TINLINE E _vvimult(const V1 & rv1, const V2 &rv2)
00469 #if(CXSC_INDEX_CHECK)
00470 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00471 #else
00472 throw()
00473 #endif
00474 {
00475 #if(CXSC_INDEX_CHECK)
00476 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00477 #endif
00478 #ifdef CXSC_USE_BLAS
00479 if(opdotprec == 1)
00480 {
00481 E ret;
00482 blasdot(rv1,rv2,ret);
00483 return ret;
00484 }
00485 else
00486 #endif
00487 {
00488 idotprecision idot(0.0);
00489 idot.set_k(opdotprec);
00490 accumulate(idot,rv1,rv2);
00491 return rnd(idot);
00492 }
00493
00494 }
00495
00496 template <class VS,class V,class E>
00497 TINLINE E _vsvimult(const VS & sl, const V &rv)
00498 #if(CXSC_INDEX_CHECK)
00499 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00500 #else
00501 throw()
00502 #endif
00503 {
00504 #if(CXSC_INDEX_CHECK)
00505 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00506 #endif
00507 #ifdef CXSC_USE_BLAS
00508 if(opdotprec == 1)
00509 {
00510 E ret;
00511 blasdot(sl,rv,ret);
00512 return ret;
00513 }
00514 else
00515 #endif
00516 {
00517 idotprecision idot(0.0);
00518 idot.set_k(opdotprec);
00519 accumulate(idot,sl,rv);
00520 return rnd(idot);
00521 }
00522
00523 }
00524
00525 template <class VS1,class VS2,class E>
00526 TINLINE E _vsvsimult(const VS1 & sl1, const VS2 &sl2)
00527 #if(CXSC_INDEX_CHECK)
00528 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00529 #else
00530 throw()
00531 #endif
00532 {
00533 #if(CXSC_INDEX_CHECK)
00534 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
00535 #endif
00536 #ifdef CXSC_USE_BLAS
00537 if(opdotprec == 1)
00538 {
00539 E ret;
00540 blasdot(sl1,sl2,ret);
00541 return ret;
00542 }
00543 else
00544 #endif
00545 {
00546 idotprecision idot(0.0);
00547 idot.set_k(opdotprec);
00548 accumulate(idot,sl1,sl2);
00549 return rnd(idot);
00550 }
00551
00552 }
00553
00554 template <class V1,class V2,class E>
00555 TINLINE E _vvcmult(const V1 & rv1, const V2 &rv2)
00556 #if(CXSC_INDEX_CHECK)
00557 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00558 #else
00559 throw()
00560 #endif
00561 {
00562 #if(CXSC_INDEX_CHECK)
00563 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00564 #endif
00565 #ifdef CXSC_USE_BLAS
00566 if(opdotprec == 1)
00567 {
00568 E ret;
00569 blasdot(rv1,rv2,ret);
00570 return ret;
00571 }
00572 else
00573 #endif
00574 {
00575 cdotprecision cdot(0.0);
00576 cdot.set_k(opdotprec);
00577 accumulate_approx(cdot,rv1,rv2);
00578 return rnd(cdot);
00579 }
00580
00581 }
00582
00583 template <class VS,class V,class E>
00584 TINLINE E _vsvcmult(const VS & sl, const V &rv)
00585 #if(CXSC_INDEX_CHECK)
00586 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00587 #else
00588 throw()
00589 #endif
00590 {
00591 #if(CXSC_INDEX_CHECK)
00592 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00593 #endif
00594 #ifdef CXSC_USE_BLAS
00595 if(opdotprec == 1)
00596 {
00597 E ret;
00598 blasdot(sl,rv,ret);
00599 return ret;
00600 }
00601 else
00602 #endif
00603 {
00604 cdotprecision cdot(0.0);
00605 cdot.set_k(opdotprec);
00606 accumulate_approx(cdot,sl,rv);
00607 return rnd(cdot);
00608 }
00609
00610 }
00611
00612 template <class VS1,class VS2,class E>
00613 TINLINE E _vsvscmult(const VS1 & sl1, const VS2 &sl2)
00614 #if(CXSC_INDEX_CHECK)
00615 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00616 #else
00617 throw()
00618 #endif
00619 {
00620 #if(CXSC_INDEX_CHECK)
00621 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
00622 #endif
00623 #ifdef CXSC_USE_BLAS
00624 if(opdotprec == 1)
00625 {
00626 E ret;
00627 blasdot(sl1,sl2,ret);
00628 return ret;
00629 }
00630 else
00631 #endif
00632 {
00633 cdotprecision cdot(0.0);
00634 cdot.set_k(opdotprec);
00635 accumulate_approx(cdot,sl1,sl2);
00636 return rnd(cdot);
00637 }
00638
00639 }
00640
00641 template <class V1,class V2,class E>
00642 TINLINE E _vvcimult(const V1 & rv1, const V2 &rv2)
00643 #if(CXSC_INDEX_CHECK)
00644 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00645 #else
00646 throw()
00647 #endif
00648 {
00649 #if(CXSC_INDEX_CHECK)
00650 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+" operator *(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00651 #endif
00652 #ifdef CXSC_USE_BLAS
00653 if(opdotprec == 1)
00654 {
00655 E ret;
00656 blasdot(rv1,rv2,ret);
00657 return ret;
00658 }
00659 else
00660 #endif
00661 {
00662 cidotprecision cidot(0.0);
00663 cidot.set_k(opdotprec);
00664 accumulate(cidot,rv1,rv2);
00665 return rnd(cidot);
00666 }
00667
00668 }
00669
00670 template <class VS,class V,class E>
00671 TINLINE E _vsvcimult(const VS & sl, const V &rv)
00672 #if(CXSC_INDEX_CHECK)
00673 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00674 #else
00675 throw()
00676 #endif
00677 {
00678 #if(CXSC_INDEX_CHECK)
00679 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+" operator *(const "+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00680 #endif
00681 #ifdef CXSC_USE_BLAS
00682 if(opdotprec == 1)
00683 {
00684 E ret;
00685 blasdot(sl,rv,ret);
00686 return ret;
00687 }
00688 else
00689 #endif
00690 {
00691 cidotprecision cidot(0.0);
00692 cidot.set_k(opdotprec);
00693 accumulate(cidot,sl,rv);
00694 return rnd(cidot);
00695 }
00696
00697 }
00698
00699 template <class VS1,class VS2,class E>
00700 TINLINE E _vsvscimult(const VS1 & sl1, const VS2 &sl2)
00701 #if(CXSC_INDEX_CHECK)
00702 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00703 #else
00704 throw()
00705 #endif
00706 {
00707 #if(CXSC_INDEX_CHECK)
00708 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+" operator *(const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
00709 #endif
00710 #ifdef CXSC_USE_BLAS
00711 if(opdotprec == 1)
00712 {
00713 E ret;
00714 blasdot(sl1,sl2,ret);
00715 return ret;
00716 }
00717 else
00718 #endif
00719 {
00720 cidotprecision cidot(0.0);
00721 cidot.set_k(opdotprec);
00722 accumulate(cidot,sl1,sl2);
00723 return rnd(cidot);
00724 }
00725
00726 }
00727
00728 template <class V,class S>
00729 TINLINE V &_vsmultassign(V &rv,const S &r) throw()
00730 {
00731 for(int i=0;i<rv.size;i++)
00732 rv.dat[i]*=r;
00733 return rv;
00734 }
00735
00736 template <class VS,class S>
00737 TINLINE VS &_vssmultassign(VS &rv,const S &r) throw()
00738 {
00739 for(int i=rv.start-rv.l;i<=rv.end-rv.l;i++)
00740 rv.dat[i]*=r;
00741 return rv;
00742 }
00743
00744 template <class VS,class S>
00745 TINLINE VS &_vssdivassign(VS &rv,const S &r) throw()
00746 {
00747 for(int i=rv.start-rv.l;i<=rv.end-rv.l;i++)
00748 rv.dat[i]/=r;
00749 return rv;
00750 }
00751
00752 template <class V1,class V2,class E>
00753 TINLINE E _vvplus(const V1 &rv1, const V2 &rv2)
00754 #if(CXSC_INDEX_CHECK)
00755 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00756 #else
00757 throw()
00758 #endif
00759 {
00760 E sum(rv1.l,rv1.u);
00761
00762 #if(CXSC_INDEX_CHECK)
00763 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" operator +(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00764 #endif
00765 for (int i=0;i<rv1.size;i++)
00766 sum.dat[i]=rv1.dat[i]+rv2.dat[i];
00767 return sum;
00768 }
00769
00770 template <class V,class VS,class E>
00771 TINLINE E _vvsplus(const V &rv,const VS &sl)
00772 #if(CXSC_INDEX_CHECK)
00773 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00774 #else
00775 throw()
00776 #endif
00777 {
00778 E sum(rv.l,rv.u);
00779
00780 #if(CXSC_INDEX_CHECK)
00781 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(sum)+" operator +(const "+nameof(rv)+" &,const "+nameof(sl)+" &)"));
00782 #endif
00783 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
00784 sum.dat[i]=rv.dat[i]+sl.dat[j];
00785 return sum;
00786 }
00787
00788 template <class VS1,class VS2,class E>
00789 TINLINE E _vsvsplus(const VS1 &s1,const VS2 &s2)
00790 #if(CXSC_INDEX_CHECK)
00791 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00792 #else
00793 throw()
00794 #endif
00795 {
00796 E sum(s1.start,s1.end);
00797
00798 #if(CXSC_INDEX_CHECK)
00799 if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sum)+" operator +(const "+nameof(s1)+" &,const "+nameof(s2)+" &)"));
00800 #endif
00801 for(int i=s1.start-s1.l,j=s2.start-s2.l,k=0;k<s1.size;i++,j++,k++)
00802 sum.dat[k]=s1.dat[i]+s2.dat[j];
00803 return sum;
00804 }
00805
00806 template <class VS1,class VS2,class E>
00807 TINLINE E _vsvsminus(const VS1 &s1,const VS2 &s2)
00808 #if(CXSC_INDEX_CHECK)
00809 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00810 #else
00811 throw()
00812 #endif
00813 {
00814 E sum(s1.start,s1.end);
00815
00816 #if(CXSC_INDEX_CHECK)
00817 if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sum)+" operator -(const "+nameof(s1)+" &,const "+nameof(s2)+" &)"));
00818 #endif
00819 for(int i=s1.start-s1.l,j=s2.start-s2.l,k=0;k<s1.size;i++,j++,k++)
00820 sum.dat[k]=s1.dat[i]-s2.dat[j];
00821 return sum;
00822 }
00823
00824 template <class V1,class V2>
00825 TINLINE V1 &_vvplusassign(V1 &rv1, const V2 &rv2)
00826 #if(CXSC_INDEX_CHECK)
00827 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00828 #else
00829 throw()
00830 #endif
00831 {
00832 #if(CXSC_INDEX_CHECK)
00833 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & operator +=("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00834 #endif
00835 for(int i=0;i<rv1.size;i++)
00836 rv1.dat[i]+=rv2.dat[i];
00837 return rv1;
00838 }
00839
00840 template <class V,class VS>
00841 TINLINE V &_vvsplusassign(V &rv, const VS &sl)
00842 #if(CXSC_INDEX_CHECK)
00843 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00844 #else
00845 throw()
00846 #endif
00847 {
00848 #if(CXSC_INDEX_CHECK)
00849 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & operator +=("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
00850 #endif
00851 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
00852 rv.dat[i]+=sl.dat[j];
00853 return rv;
00854 }
00855
00856 template <class VS,class V>
00857 TINLINE VS &_vsvplusassign(VS &sl, const V &rv)
00858 #if(CXSC_INDEX_CHECK)
00859 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
00860 #else
00861 throw()
00862 #endif
00863 {
00864 #if(CXSC_INDEX_CHECK)
00865 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & operator +=("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00866 #endif
00867 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
00868 sl.dat[j]+=rv.dat[i];
00869 return sl;
00870 }
00871
00872 template <class VS1,class VS2>
00873 TINLINE VS1 &_vsvsplusassign(VS1 &sl1, const VS2 &sl2)
00874 #if(CXSC_INDEX_CHECK)
00875 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00876 #else
00877 throw()
00878 #endif
00879 {
00880 #if(CXSC_INDEX_CHECK)
00881 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" & operator +=("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
00882 #endif
00883 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
00884 sl1.dat[j]+=sl2.dat[k];
00885 return sl1;
00886 }
00887
00888 template <class VS1,class VS2>
00889 TINLINE VS1 &_vsvsminusassign(VS1 &sl1, const VS2 &sl2)
00890 #if(CXSC_INDEX_CHECK)
00891 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
00892 #else
00893 throw()
00894 #endif
00895 {
00896 #if(CXSC_INDEX_CHECK)
00897 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" & operator +=("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
00898 #endif
00899 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
00900 sl1.dat[j]-=sl2.dat[k];
00901 return sl1;
00902 }
00903
00904 template <class V1,class V2>
00905 TINLINE V1 &_vvminusassign(V1 &rv1, const V2 &rv2)
00906 #if(CXSC_INDEX_CHECK)
00907 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
00908 #else
00909 throw()
00910 #endif
00911 {
00912 #if(CXSC_INDEX_CHECK)
00913 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & operator -=("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00914 #endif
00915 for(int i=0;i<rv1.size;i++)
00916 rv1.dat[i]-=rv2.dat[i];
00917 return rv1;
00918 }
00919
00920 template <class V,class VS>
00921 TINLINE V &_vvsminusassign(V &rv, const VS &sl)
00922 #if(CXSC_INDEX_CHECK)
00923 throw(ERROR__OP_WITH_WRONG_DIM<V>)
00924 #else
00925 throw()
00926 #endif
00927 {
00928 #if(CXSC_INDEX_CHECK)
00929 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & operator -=("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
00930 #endif
00931 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
00932 rv.dat[i]-=sl.dat[j];
00933 return rv;
00934 }
00935
00936 template <class VS,class V>
00937 TINLINE VS &_vsvminusassign(VS &sl, const V &rv)
00938 #if(CXSC_INDEX_CHECK)
00939 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
00940 #else
00941 throw()
00942 #endif
00943 {
00944 #if(CXSC_INDEX_CHECK)
00945 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & operator -=("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
00946 #endif
00947 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
00948 sl.dat[j]-=rv.dat[i];
00949 return sl;
00950 }
00951
00952 template <class V>
00953 TINLINE V _vminus(const V &rv) throw()
00954 {
00955 V sum(rv.l,rv.u);
00956
00957 for (int i=0;i<rv.size;i++)
00958 sum.dat[i]= -rv.dat[i];
00959
00960 return sum;
00961 }
00962
00963 template <class VS,class V>
00964 TINLINE V _vsminus(const VS &sl) throw()
00965 {
00966 V sum(sl.start,sl.end);
00967
00968 for (int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
00969 sum.dat[i]= -sl.dat[j];
00970
00971 return sum;
00972 }
00973
00974 template <class V1,class V2,class E>
00975 TINLINE E _vvminus(const V1 &rv1, const V2 &rv2)
00976 #if(CXSC_INDEX_CHECK)
00977 throw(ERROR__OP_WITH_WRONG_DIM<E>)
00978 #else
00979 throw()
00980 #endif
00981 {
00982 E sum(rv1.l,rv1.u);
00983
00984 #if(CXSC_INDEX_CHECK)
00985 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator -(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
00986 #endif
00987 for (int i=0;i<rv1.size;i++)
00988 sum.dat[i]=rv1.dat[i]-rv2.dat[i];
00989 return sum;
00990 }
00991
00992 template <class V,class VS,class E>
00993 TINLINE E _vvsminus(const V &rv, const VS &sl)
00994 #if(CXSC_INDEX_CHECK)
00995 throw(ERROR__OP_WITH_WRONG_DIM<E>)
00996 #else
00997 throw()
00998 #endif
00999 {
01000 E sum(rv.l,rv.u);
01001
01002 #if(CXSC_INDEX_CHECK)
01003 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator -(const "+nameof(rv)+" &, const "+nameof(sl)+" &)"));
01004 #endif
01005 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01006 sum.dat[i]=rv.dat[i]-sl.dat[j];
01007
01008 return sum;
01009 }
01010
01011 template <class VS,class V,class E>
01012 TINLINE E _vsvminus(const VS &sl,const V &rv)
01013 #if(CXSC_INDEX_CHECK)
01014 throw(ERROR__OP_WITH_WRONG_DIM<E>)
01015 #else
01016 throw()
01017 #endif
01018 {
01019 E sum(sl.start,sl.end);
01020
01021 #if(CXSC_INDEX_CHECK)
01022 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator -(const "+nameof(sl)+" &,const "+nameof(rv)+" &)"));
01023 #endif
01024 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01025 sum.dat[i]=sl.dat[j]-rv.dat[i];
01026 return sum;
01027 }
01028
01029 template <class V1,class V2,class E>
01030 TINLINE E _vvconv(const V1 &rv1, const V2 &rv2)
01031 #if(CXSC_INDEX_CHECK)
01032 throw(ERROR__OP_WITH_WRONG_DIM<E>)
01033 #else
01034 throw()
01035 #endif
01036 {
01037 E sum(rv1.l,rv1.u);
01038
01039 #if(CXSC_INDEX_CHECK)
01040 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01041 #endif
01042 for (int i=0;i<rv1.size;i++)
01043 sum.dat[i]=rv1.dat[i]|rv2.dat[i];
01044 return sum;
01045 }
01046
01047 template <class V,class VS,class E>
01048 TINLINE E _vvsconv(const V &rv,const VS &sl)
01049 #if(CXSC_INDEX_CHECK)
01050 throw(ERROR__OP_WITH_WRONG_DIM<E>)
01051 #else
01052 throw()
01053 #endif
01054 {
01055 E sum(rv.l,rv.u);
01056
01057 #if(CXSC_INDEX_CHECK)
01058 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(rv)+" &,const "+nameof(sl)+" &)"));
01059 #endif
01060 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01061 sum.dat[i]=rv.dat[i]|sl.dat[j];
01062 return sum;
01063 }
01064
01065 template <class VS1,class VS2,class E>
01066 TINLINE E _vsvsconv(const VS1 &s1,const VS2 &s2)
01067 #if(CXSC_INDEX_CHECK)
01068 throw(ERROR__OP_WITH_WRONG_DIM<E>)
01069 #else
01070 throw()
01071 #endif
01072 {
01073 E sum(s1.start,s1.end);
01074
01075 #if(CXSC_INDEX_CHECK)
01076 if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(s1)+" &,const "+nameof(s2)+" &)"));
01077 #endif
01078 for(int i=s1.start-s1.l,j=s2.start-s2.l,k=0;k<s1.size;i++,j++,k++)
01079 sum.dat[k]=s1.dat[i]|s2.dat[j];
01080 return sum;
01081 }
01082
01083 template <class V1,class V2>
01084 TINLINE V1 &_vvconvassign(V1 &rv1, const V2 &rv2)
01085 #if(CXSC_INDEX_CHECK)
01086 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
01087 #else
01088 throw()
01089 #endif
01090 {
01091 #if(CXSC_INDEX_CHECK)
01092 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & operator +=("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01093 #endif
01094 for(int i=0;i<rv1.size;i++)
01095 rv1.dat[i]|=rv2.dat[i];
01096 return rv1;
01097 }
01098
01099 template <class V,class VS>
01100 TINLINE V &_vvsconvassign(V &rv, const VS &sl)
01101 #if(CXSC_INDEX_CHECK)
01102 throw(ERROR__OP_WITH_WRONG_DIM<V>)
01103 #else
01104 throw()
01105 #endif
01106 {
01107 #if(CXSC_INDEX_CHECK)
01108 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & operator +=("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
01109 #endif
01110 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01111 rv.dat[i]|=sl.dat[j];
01112 return rv;
01113 }
01114
01115 template <class VS,class V>
01116 TINLINE VS &_vsvconvassign(VS &sl, const V &rv)
01117 #if(CXSC_INDEX_CHECK)
01118 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
01119 #else
01120 throw()
01121 #endif
01122 {
01123 #if(CXSC_INDEX_CHECK)
01124 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & operator +=("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
01125 #endif
01126 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01127 sl.dat[j]|=rv.dat[i];
01128 return sl;
01129 }
01130
01131 template <class VS1,class VS2>
01132 TINLINE VS1 &_vsvsconvassign(VS1 &sl1, const VS2 &sl2)
01133 #if(CXSC_INDEX_CHECK)
01134 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
01135 #else
01136 throw()
01137 #endif
01138 {
01139 #if(CXSC_INDEX_CHECK)
01140 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" & operator +=("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
01141 #endif
01142 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
01143 sl1.dat[j]|=sl2.dat[k];
01144 return sl1;
01145 }
01146
01147 template <class V1,class V2,class E>
01148 TINLINE E _vvsect(const V1 &rv1, const V2 &rv2)
01149 #if(CXSC_INDEX_CHECK)
01150 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
01151 #else
01152 throw()
01153 #endif
01154 {
01155 E sum(rv1.l,rv1.u);
01156
01157 #if(CXSC_INDEX_CHECK)
01158 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(sum)+" operator +(const "+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01159 #endif
01160 for (int i=0;i<rv1.size;i++)
01161 sum.dat[i]=rv1.dat[i]&rv2.dat[i];
01162 return sum;
01163 }
01164
01165 template <class V,class VS,class E>
01166 TINLINE E _vvssect(const V &rv,const VS &sl)
01167 #if(CXSC_INDEX_CHECK)
01168 throw(ERROR__OP_WITH_WRONG_DIM<E>)
01169 #else
01170 throw()
01171 #endif
01172 {
01173 E sum(rv.l,rv.u);
01174
01175 #if(CXSC_INDEX_CHECK)
01176 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(rv)+" &,const "+nameof(sl)+" &)"));
01177 #endif
01178 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01179 sum.dat[i]=rv.dat[i]&sl.dat[j];
01180 return sum;
01181 }
01182
01183 template <class VS1,class VS2,class E>
01184 TINLINE E _vsvssect(const VS1 &s1,const VS2 &s2)
01185 #if(CXSC_INDEX_CHECK)
01186 throw(ERROR__OP_WITH_WRONG_DIM<E>)
01187 #else
01188 throw()
01189 #endif
01190 {
01191 E sum(s1.start,s1.end);
01192
01193 #if(CXSC_INDEX_CHECK)
01194 if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+" operator +(const "+nameof(s1)+" &,const "+nameof(s2)+" &)"));
01195 #endif
01196 for(int i=s1.start-s1.l,j=s2.start-s2.l,k=0;k<s1.size;i++,j++,k++)
01197 sum.dat[k]=s1.dat[i]&s2.dat[j];
01198 return sum;
01199 }
01200
01201 template <class V1,class V2>
01202 TINLINE V1 &_vvsectassign(V1 &rv1, const V2 &rv2)
01203 #if(CXSC_INDEX_CHECK)
01204 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
01205 #else
01206 throw()
01207 #endif
01208 {
01209 #if(CXSC_INDEX_CHECK)
01210 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & operator +=("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01211 #endif
01212 for(int i=0;i<rv1.size;i++)
01213 rv1.dat[i]&=rv2.dat[i];
01214 return rv1;
01215 }
01216
01217 template <class V,class VS>
01218 TINLINE V &_vvssectassign(V &rv, const VS &sl)
01219 #if(CXSC_INDEX_CHECK)
01220 throw(ERROR__OP_WITH_WRONG_DIM<V>)
01221 #else
01222 throw()
01223 #endif
01224 {
01225 #if(CXSC_INDEX_CHECK)
01226 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & operator +=("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
01227 #endif
01228 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01229 rv.dat[i]&=sl.dat[j];
01230 return rv;
01231 }
01232
01233 template <class VS,class V>
01234 TINLINE VS &_vsvsectassign(VS &sl, const V &rv)
01235 #if(CXSC_INDEX_CHECK)
01236 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
01237 #else
01238 throw()
01239 #endif
01240 {
01241 #if(CXSC_INDEX_CHECK)
01242 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & operator +=("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
01243 #endif
01244 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01245 sl.dat[j]&=rv.dat[i];
01246 return sl;
01247 }
01248
01249 template <class VS1,class VS2>
01250 TINLINE VS1 &_vsvssectassign(VS1 &sl1, const VS2 &sl2)
01251 #if(CXSC_INDEX_CHECK)
01252 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
01253 #else
01254 throw()
01255 #endif
01256 {
01257 #if(CXSC_INDEX_CHECK)
01258 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" & operator +=("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
01259 #endif
01260 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
01261 sl1.dat[j]&=sl2.dat[k];
01262 return sl1;
01263 }
01264
01265 template <class V1,class V2>
01266 TINLINE bool _vveq(const V1 &rv1, const V2 &rv2) throw()
01267 {
01268 if(rv1.size!=rv2.size)
01269 return(false);
01270
01271 int i;
01272 for (i=0;i<rv1.size && rv1.dat[i]==rv2.dat[i];i++);
01273
01274 return (i==rv1.size);
01275 }
01276
01277 template <class VS,class V>
01278 TINLINE bool _vsveq(const VS &sl, const V &rv) throw()
01279 {
01280 if(sl.size!=rv.size)
01281 return(false);
01282
01283 int i,j;
01284 for (i=0,j=sl.start-sl.l;i<rv.size && sl.dat[j]==rv.dat[i];i++,j++);
01285
01286 return (i==rv.size);
01287 }
01288
01289 template <class V1,class V2>
01290 TINLINE bool _vvneq(const V1 &rv1, const V2 &rv2) throw()
01291 {
01292 if(rv1.size!=rv2.size)
01293 return(true);
01294
01295 int i;
01296 for (i=0;i<rv1.size && rv1.dat[i]==rv2.dat[i];i++);
01297
01298 return (i!=rv1.size);
01299 }
01300
01301 template <class VS,class V>
01302 TINLINE bool _vsvneq(const VS &sl, const V &rv) throw()
01303 {
01304 if(sl.size!=rv.size)
01305 return(true);
01306
01307 int i,j;
01308 for (i=0,j=sl.start-sl.l;i<rv.size && sl.dat[j]==rv.dat[i];i++,j++);
01309
01310 return (i!=rv.size);
01311 }
01312
01313 template <class V1,class V2>
01314 TINLINE bool _vvless(const V1 &rv1, const V2 &rv2) throw()
01315 {
01316 if(rv1.size!=rv2.size)
01317 return(false);
01318
01319 int i;
01320 for(i=0;i<rv1.size&&(rv1.dat[i]<rv2.dat[i]);i++);
01321
01322 return (i==rv1.size);
01323 }
01324
01325 template <class VS,class V>
01326 TINLINE bool _vsvless(const VS &sl, const V &rv) throw()
01327 {
01328 if(sl.size!=rv.size)
01329 return(false);
01330
01331 int i,j;
01332 for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]<rv.dat[j]);i++,j++);
01333
01334 return (j==sl.size);
01335 }
01336
01337 template <class V1,class V2>
01338 TINLINE bool _vvleq(const V1 &rv1, const V2 &rv2) throw()
01339 {
01340 if(rv1.size!=rv2.size)
01341 return(false);
01342
01343 int i;
01344 for(i=0;i<rv1.size&&(rv1.dat[i]<=rv2.dat[i]);i++);
01345
01346 return (i==rv1.size);
01347 }
01348
01349 template <class VS,class V>
01350 TINLINE bool _vsvleq(const VS &sl, const V &rv) throw()
01351 {
01352 if(sl.size!=rv.size)
01353 return(false);
01354
01355 int i,j;
01356 for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]<=rv.dat[j]);i++,j++);
01357
01358 return (j==sl.size);
01359 }
01360
01361 template <class V,class VS>
01362 TINLINE bool _vvsless(const V &rv, const VS &sl) throw()
01363 {
01364 if(sl.size!=rv.size)
01365 return(false);
01366
01367 int i,j;
01368 for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]>rv.dat[j]);i++,j++);
01369
01370 return (j==sl.size);
01371 }
01372
01373 template <class V,class VS>
01374 TINLINE bool _vvsleq(const V &rv, const VS &sl) throw()
01375 {
01376 if(sl.size!=rv.size)
01377 return(false);
01378
01379 int i,j;
01380 for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]>=rv.dat[j]);i++,j++);
01381
01382 return (j==sl.size);
01383 }
01384
01385 template <class V>
01386 TINLINE bool _vnot(const V &rv) throw()
01387 {
01388 int i;
01389 for(i=0;i<rv.size;i++)
01390 {
01391 if(!!rv.dat[i])
01392 return(false);
01393 }
01394
01395 return true;
01396 }
01397
01398 template <class V>
01399 TINLINE void *_vvoid(const V &rv) throw()
01400 {
01401 for(int i=0;i<rv.size;i++)
01402 {
01403 if(!!rv.dat[i])
01404 return (void *)1;
01405 }
01406
01407 return (void *)0;
01408 }
01409
01410 template <class V>
01411 TINLINE V _vconj(const V &rv) throw()
01412 {
01413 V erg(rv.l,rv.u);
01414
01415 for(int i=0;i<rv.size;i++)
01416 erg.dat[i]=conj(rv.dat[i]);
01417
01418 return erg;
01419 }
01420
01421 template <class VS,class E>
01422 TINLINE E _vsconj(const VS &sl) throw()
01423 {
01424 E erg(sl.start,sl.end);
01425
01426 for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
01427 erg.dat[i]=conj(sl.dat[j]);
01428
01429 return erg;
01430 }
01431
01432 template <class V,class E>
01433 TINLINE E _vabs(const V &rv) throw()
01434 {
01435 E erg(rv.l,rv.u);
01436
01437 for(int i=0;i<rv.size;i++)
01438 erg.dat[i]=abs(rv.dat[i]);
01439
01440 return erg;
01441 }
01442
01443 template <class VS,class E>
01444 TINLINE E _vsabs(const VS &sl) throw()
01445 {
01446 E erg(sl.start,sl.end);
01447
01448 for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
01449 erg.dat[i]=abs(sl.dat[j]);
01450
01451 return erg;
01452 }
01453
01454 template <class V,class E>
01455 TINLINE E _vdiam(const V &rv) throw()
01456 {
01457 E erg(rv.l,rv.u);
01458
01459 for(int i=0;i<rv.size;i++)
01460 erg.dat[i]=diam(rv.dat[i]);
01461
01462 return erg;
01463 }
01464
01465 template <class VS,class E>
01466 TINLINE E _vsdiam(const VS &sl) throw()
01467 {
01468 E erg(sl.start,sl.end);
01469
01470 for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
01471 erg.dat[i]=diam(sl.dat[j]);
01472
01473 return erg;
01474 }
01475
01476 template <class V,class E>
01477 TINLINE E _vmid(const V &rv) throw()
01478 {
01479 E erg(rv.l,rv.u);
01480
01481 for(int i=0;i<rv.size;i++)
01482 erg.dat[i]=mid(rv.dat[i]);
01483
01484 return erg;
01485 }
01486
01487 template <class VS,class E>
01488 TINLINE E _vsmid(const VS &sl) throw()
01489 {
01490 E erg(sl.start,sl.end);
01491
01492 for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
01493 erg.dat[i]=mid(sl.dat[j]);
01494
01495 return erg;
01496 }
01497
01498 template <class V,class E>
01499 TINLINE E _vinf(const V &rv) throw()
01500 {
01501 E erg(rv.l,rv.u);
01502
01503 for(int i=0;i<rv.size;i++)
01504 erg.dat[i]=Inf(rv.dat[i]);
01505
01506 return erg;
01507 }
01508
01509 template <class VS,class E>
01510 TINLINE E _vsinf(const VS &sl) throw()
01511 {
01512 E erg(sl.start,sl.end);
01513
01514 for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
01515 erg.dat[i]=Inf(sl.dat[j]);
01516
01517 return erg;
01518 }
01519
01520 template <class V,class E>
01521 TINLINE E _vsup(const V &rv) throw()
01522 {
01523 E erg(rv.l,rv.u);
01524
01525 for(int i=0;i<rv.size;i++)
01526 erg.dat[i]=Sup(rv.dat[i]);
01527
01528 return erg;
01529 }
01530
01531 template <class VS,class E>
01532 TINLINE E _vssup(const VS &sl) throw()
01533 {
01534 E erg(sl.start,sl.end);
01535
01536 for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
01537 erg.dat[i]=Sup(sl.dat[j]);
01538
01539 return erg;
01540 }
01541
01542 template <class V,class E>
01543 TINLINE E _vre(const V &rv) throw()
01544 {
01545 E erg(rv.l,rv.u);
01546
01547 for(int i=0;i<rv.size;i++)
01548 erg.dat[i]=Re(rv.dat[i]);
01549
01550 return erg;
01551 }
01552
01553 template <class VS,class E>
01554 TINLINE E _vsre(const VS &sl) throw()
01555 {
01556 E erg(sl.start,sl.end);
01557
01558 for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
01559 erg.dat[i]=Re(sl.dat[j]);
01560
01561 return erg;
01562 }
01563
01564 template <class V,class E>
01565 TINLINE E _vim(const V &rv) throw()
01566 {
01567 E erg(rv.l,rv.u);
01568
01569 for(int i=0;i<rv.size;i++)
01570 erg.dat[i]=Im(rv.dat[i]);
01571
01572 return erg;
01573 }
01574
01575 template <class VS,class E>
01576 TINLINE E _vsim(const VS &sl) throw()
01577 {
01578 E erg(sl.start,sl.end);
01579
01580 for(int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
01581 erg.dat[i]=Im(sl.dat[j]);
01582
01583 return erg;
01584 }
01585
01586 template <class V,class S>
01587 TINLINE V &_vsusetsup(V &v, const S &s) throw()
01588 {
01589 for(int i=0;i<v.size;i++)
01590 UncheckedSetInf(v.dat[i],s);
01591 return v;
01592 }
01593
01594 template <class V,class S>
01595 TINLINE V &_vsusetinf(V &v, const S &s) throw()
01596 {
01597 for(int i=0;i<v.size;i++)
01598 UncheckedSetInf(v.dat[i],s);
01599 return v;
01600 }
01601
01602 template <class V,class S>
01603 TINLINE V &_vssetinf(V &v, const S &s) throw()
01604 {
01605 for(int i=0;i<v.size;i++)
01606 SetInf(v.dat[i],s);
01607 return v;
01608 }
01609
01610 template <class V,class S>
01611 TINLINE V &_vssetsup(V &v, const S &s) throw()
01612 {
01613 for(int i=0;i<v.size;i++)
01614 SetSup(v.dat[i],s);
01615 return v;
01616 }
01617
01618 template <class V,class S>
01619 TINLINE V &_vssetre(V &v, const S &s) throw()
01620 {
01621 for(int i=0;i<v.size;i++)
01622 SetRe(v.dat[i],s);
01623 return v;
01624 }
01625
01626 template <class V,class S>
01627 TINLINE V &_vssetim(V &v, const S &s) throw()
01628 {
01629 for(int i=0;i<v.size;i++)
01630 SetIm(v.dat[i],s);
01631 return v;
01632 }
01633
01634 template <class VS,class S>
01635 TINLINE VS &_vssusetsup(VS &vs, const S &s) throw()
01636 {
01637 for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
01638 UncheckedSetInf(vs.dat[i],s);
01639 return vs;
01640 }
01641
01642 template <class VS,class S>
01643 TINLINE VS &_vssusetinf(VS &vs, const S &s) throw()
01644 {
01645 for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
01646 UncheckedSetInf(vs.dat[i],s);
01647 return vs;
01648 }
01649
01650 template <class VS,class S>
01651 TINLINE VS &_vsssetinf(VS &vs, const S &s) throw()
01652 {
01653 for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
01654 SetInf(vs.dat[i],s);
01655 return vs;
01656 }
01657
01658 template <class VS,class S>
01659 TINLINE VS &_vsssetsup(VS &vs, const S &s) throw()
01660 {
01661 for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
01662 SetSup(vs.dat[i],s);
01663 return vs;
01664 }
01665
01666 template <class VS,class S>
01667 TINLINE VS &_vsssetre(VS &vs, const S &s) throw()
01668 {
01669 for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
01670 SetRe(vs.dat[i],s);
01671 return vs;
01672 }
01673
01674 template <class VS,class S>
01675 TINLINE VS &_vsssetim(VS &vs, const S &s) throw()
01676 {
01677 for(int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
01678 SetIm(vs.dat[i],s);
01679 return vs;
01680 }
01681
01682 template <class V1,class V2>
01683 TINLINE V1 &_vvsetinf(V1 &rv1, const V2 &rv2)
01684 #if(CXSC_INDEX_CHECK)
01685 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
01686 #else
01687 throw()
01688 #endif
01689 {
01690 #if(CXSC_INDEX_CHECK)
01691 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" & SetInf("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01692 #endif
01693 for(int i=0;i<rv1.size;i++)
01694 SetInf(rv1.dat[i],rv2.dat[i]);
01695 return rv1;
01696 }
01697
01698 template <class V,class VS>
01699 TINLINE V &_vvssetinf(V &rv, const VS &sl)
01700 #if(CXSC_INDEX_CHECK)
01701 throw(ERROR__OP_WITH_WRONG_DIM<V>)
01702 #else
01703 throw()
01704 #endif
01705 {
01706 #if(CXSC_INDEX_CHECK)
01707 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" & SetInf("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
01708 #endif
01709 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01710 SetInf(rv.dat[i],sl.dat[j]);
01711 return rv;
01712 }
01713
01714 template <class VS,class V>
01715 TINLINE VS &_vsvsetinf(VS &sl, const V &rv)
01716 #if(CXSC_INDEX_CHECK)
01717 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
01718 #else
01719 throw()
01720 #endif
01721 {
01722 #if(CXSC_INDEX_CHECK)
01723 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" & SetInf("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
01724 #endif
01725 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01726 SetInf(sl.dat[j],rv.dat[i]);
01727 return sl;
01728 }
01729
01730 template <class VS1,class VS2>
01731 TINLINE VS1 &_vsvssetinf(VS1 &sl1, const VS2 &sl2)
01732 #if(CXSC_INDEX_CHECK)
01733 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
01734 #else
01735 throw()
01736 #endif
01737 {
01738 #if(CXSC_INDEX_CHECK)
01739 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &SetInf("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
01740 #endif
01741 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
01742 SetInf(sl1.dat[j],sl2.dat[k]);
01743 return sl1;
01744 }
01745
01746 template <class V1,class V2>
01747 TINLINE V1 &_vvsetsup(V1 &rv1, const V2 &rv2)
01748 #if(CXSC_INDEX_CHECK)
01749 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
01750 #else
01751 throw()
01752 #endif
01753 {
01754 #if(CXSC_INDEX_CHECK)
01755 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &SetSup("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01756 #endif
01757 for(int i=0;i<rv1.size;i++)
01758 SetSup(rv1.dat[i],rv2.dat[i]);
01759 return rv1;
01760 }
01761
01762 template <class V,class VS>
01763 TINLINE V &_vvssetsup(V &rv, const VS &sl)
01764 #if(CXSC_INDEX_CHECK)
01765 throw(ERROR__OP_WITH_WRONG_DIM<V>)
01766 #else
01767 throw()
01768 #endif
01769 {
01770 #if(CXSC_INDEX_CHECK)
01771 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &SetSup("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
01772 #endif
01773 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01774 SetSup(rv.dat[i],sl.dat[j]);
01775 return rv;
01776 }
01777
01778 template <class VS,class V>
01779 TINLINE VS &_vsvsetsup(VS &sl, const V &rv)
01780 #if(CXSC_INDEX_CHECK)
01781 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
01782 #else
01783 throw()
01784 #endif
01785 {
01786 #if(CXSC_INDEX_CHECK)
01787 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" &SetSup("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
01788 #endif
01789 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01790 SetSup(sl.dat[j],rv.dat[i]);
01791 return sl;
01792 }
01793
01794 template <class VS1,class VS2>
01795 TINLINE VS1 &_vsvssetsup(VS1 &sl1, const VS2 &sl2)
01796 #if(CXSC_INDEX_CHECK)
01797 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
01798 #else
01799 throw()
01800 #endif
01801 {
01802 #if(CXSC_INDEX_CHECK)
01803 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &SetSup("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
01804 #endif
01805 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
01806 SetSup(sl1.dat[j],sl2.dat[k]);
01807 return sl1;
01808 }
01809
01810 template <class V1,class V2>
01811 TINLINE V1 &_vvusetinf(V1 &rv1, const V2 &rv2)
01812 #if(CXSC_INDEX_CHECK)
01813 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
01814 #else
01815 throw()
01816 #endif
01817 {
01818 #if(CXSC_INDEX_CHECK)
01819 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &UncheckedSetInf("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01820 #endif
01821 for(int i=0;i<rv1.size;i++)
01822 UncheckedSetInf(rv1.dat[i],rv2.dat[i]);
01823 return rv1;
01824 }
01825
01826 template <class V,class VS>
01827 TINLINE V &_vvsusetinf(V &rv, const VS &sl)
01828 #if(CXSC_INDEX_CHECK)
01829 throw(ERROR__OP_WITH_WRONG_DIM<V>)
01830 #else
01831 throw()
01832 #endif
01833 {
01834 #if(CXSC_INDEX_CHECK)
01835 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &UncheckedSetInf("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
01836 #endif
01837 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01838 UncheckedSetInf(rv.dat[i],sl.dat[j]);
01839 return rv;
01840 }
01841
01842 template <class VS,class V>
01843 TINLINE VS &_vsvusetinf(VS &sl, const V &rv)
01844 #if(CXSC_INDEX_CHECK)
01845 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
01846 #else
01847 throw()
01848 #endif
01849 {
01850 #if(CXSC_INDEX_CHECK)
01851 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" &UncheckedSetInf("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
01852 #endif
01853 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01854 UncheckedSetInf(sl.dat[j],rv.dat[i]);
01855 return sl;
01856 }
01857
01858 template <class VS1,class VS2>
01859 TINLINE VS1 &_vsvsusetinf(VS1 &sl1, const VS2 &sl2)
01860 #if(CXSC_INDEX_CHECK)
01861 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
01862 #else
01863 throw()
01864 #endif
01865 {
01866 #if(CXSC_INDEX_CHECK)
01867 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &UncheckedSetInf("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
01868 #endif
01869 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
01870 UncheckedSetInf(sl1.dat[j],sl2.dat[k]);
01871 return sl1;
01872 }
01873
01874 template <class V1,class V2>
01875 TINLINE V1 &_vvusetsup(V1 &rv1, const V2 &rv2)
01876 #if(CXSC_INDEX_CHECK)
01877 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
01878 #else
01879 throw()
01880 #endif
01881 {
01882 #if(CXSC_INDEX_CHECK)
01883 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &UncheckedSetSup("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01884 #endif
01885 for(int i=0;i<rv1.size;i++)
01886 UncheckedSetSup(rv1.dat[i],rv2.dat[i]);
01887 return rv1;
01888 }
01889
01890 template <class V,class VS>
01891 TINLINE V &_vvsusetsup(V &rv, const VS &sl)
01892 #if(CXSC_INDEX_CHECK)
01893 throw(ERROR__OP_WITH_WRONG_DIM<V>)
01894 #else
01895 throw()
01896 #endif
01897 {
01898 #if(CXSC_INDEX_CHECK)
01899 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &UncheckedSetSup("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
01900 #endif
01901 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01902 UncheckedSetSup(rv.dat[i],sl.dat[j]);
01903 return rv;
01904 }
01905
01906 template <class VS,class V>
01907 TINLINE VS &_vsvusetsup(VS &sl, const V &rv)
01908 #if(CXSC_INDEX_CHECK)
01909 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
01910 #else
01911 throw()
01912 #endif
01913 {
01914 #if(CXSC_INDEX_CHECK)
01915 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" &UncheckedSetSup("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
01916 #endif
01917 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01918 UncheckedSetSup(sl.dat[j],rv.dat[i]);
01919 return sl;
01920 }
01921
01922 template <class VS1,class VS2>
01923 TINLINE VS1 &_vsvsusetsup(VS1 &sl1, const VS2 &sl2)
01924 #if(CXSC_INDEX_CHECK)
01925 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
01926 #else
01927 throw()
01928 #endif
01929 {
01930 #if(CXSC_INDEX_CHECK)
01931 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &UncheckedSetSup("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
01932 #endif
01933 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
01934 UncheckedSetSup(sl1.dat[j],sl2.dat[k]);
01935 return sl1;
01936 }
01937
01938 template <class V1,class V2>
01939 TINLINE V1 &_vvsetim(V1 &rv1, const V2 &rv2)
01940 #if(CXSC_INDEX_CHECK)
01941 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
01942 #else
01943 throw()
01944 #endif
01945 {
01946 #if(CXSC_INDEX_CHECK)
01947 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &SetIm("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
01948 #endif
01949 for(int i=0;i<rv1.size;i++)
01950 SetIm(rv1.dat[i],rv2.dat[i]);
01951 return rv1;
01952 }
01953
01954 template <class V,class VS>
01955 TINLINE V &_vvssetim(V &rv, const VS &sl)
01956 #if(CXSC_INDEX_CHECK)
01957 throw(ERROR__OP_WITH_WRONG_DIM<V>)
01958 #else
01959 throw()
01960 #endif
01961 {
01962 #if(CXSC_INDEX_CHECK)
01963 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &SetIm("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
01964 #endif
01965 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01966 SetIm(rv.dat[i],sl.dat[j]);
01967 return rv;
01968 }
01969
01970 template <class VS,class V>
01971 TINLINE VS &_vsvsetim(VS &sl, const V &rv)
01972 #if(CXSC_INDEX_CHECK)
01973 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
01974 #else
01975 throw()
01976 #endif
01977 {
01978 #if(CXSC_INDEX_CHECK)
01979 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>("SetIm("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
01980 #endif
01981 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
01982 SetIm(sl.dat[j],rv.dat[i]);
01983 return sl;
01984 }
01985
01986 template <class VS1,class VS2>
01987 TINLINE VS1 &_vsvssetim(VS1 &sl1, const VS2 &sl2)
01988 #if(CXSC_INDEX_CHECK)
01989 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
01990 #else
01991 throw()
01992 #endif
01993 {
01994 #if(CXSC_INDEX_CHECK)
01995 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &SetIm("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
01996 #endif
01997 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
01998 SetIm(sl1.dat[j],sl2.dat[k]);
01999 return sl1;
02000 }
02001
02002 template <class V1,class V2>
02003 TINLINE V1 &_vvsetre(V1 &rv1, const V2 &rv2)
02004 #if(CXSC_INDEX_CHECK)
02005 throw(ERROR__OP_WITH_WRONG_DIM<V1>)
02006 #else
02007 throw()
02008 #endif
02009 {
02010 #if(CXSC_INDEX_CHECK)
02011 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+" &SetRe("+nameof(rv1)+" &, const "+nameof(rv2)+" &)"));
02012 #endif
02013 for(int i=0;i<rv1.size;i++)
02014 SetRe(rv1.dat[i],rv2.dat[i]);
02015 return rv1;
02016 }
02017
02018 template <class V,class VS>
02019 TINLINE V &_vvssetre(V &rv, const VS &sl)
02020 #if(CXSC_INDEX_CHECK)
02021 throw(ERROR__OP_WITH_WRONG_DIM<V>)
02022 #else
02023 throw()
02024 #endif
02025 {
02026 #if(CXSC_INDEX_CHECK)
02027 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+" &SetRe("+nameof(rv)+" &, const "+nameof(sl)+" &)"));
02028 #endif
02029 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
02030 SetRe(rv.dat[i],sl.dat[j]);
02031 return rv;
02032 }
02033
02034 template <class VS,class V>
02035 TINLINE VS &_vsvsetre(VS &sl, const V &rv)
02036 #if(CXSC_INDEX_CHECK)
02037 throw(ERROR__OP_WITH_WRONG_DIM<VS>)
02038 #else
02039 throw()
02040 #endif
02041 {
02042 #if(CXSC_INDEX_CHECK)
02043 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+" &SetRe("+nameof(sl)+" &, const "+nameof(rv)+" &)"));
02044 #endif
02045 for(int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
02046 SetRe(sl.dat[j],rv.dat[i]);
02047 return sl;
02048 }
02049
02050 template <class VS1,class VS2>
02051 TINLINE VS1 &_vsvssetre(VS1 &sl1, const VS2 &sl2)
02052 #if(CXSC_INDEX_CHECK)
02053 throw(ERROR__OP_WITH_WRONG_DIM<VS1>)
02054 #else
02055 throw()
02056 #endif
02057 {
02058 #if(CXSC_INDEX_CHECK)
02059 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+" &SetRe("+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
02060 #endif
02061 for(int i=0,j=sl1.start-sl1.l,k=sl2.start-sl2.l;i<sl2.size;i++,j++,k++)
02062 SetRe(sl1.dat[j],sl2.dat[k]);
02063 return sl1;
02064 }
02065
02066 template <class DP,class VS1,class VS2>
02067 TINLINE void _vsvsaccu(DP &dp, const VS1 & sl1, const VS2 &sl2)
02068 #if(CXSC_INDEX_CHECK)
02069 throw(OP_WITH_WRONG_DIM)
02070 #else
02071 throw()
02072 #endif
02073 {
02074 #if(CXSC_INDEX_CHECK)
02075 if(sl1.size!=sl2.size) cxscthrow(OP_WITH_WRONG_DIM("void accumulate("+nameof(dp)+" &, const "+nameof(sl1)+" &, const "+nameof(sl2)+" &)"));
02076 #endif
02077 for(int i=sl1.start-sl1.l,j=sl2.start-sl2.l,k=0;k<sl1.size;k++,i++,j++)
02078 accumulate(dp,sl1.dat[i],sl2.dat[j]);
02079 }
02080
02081 template <class VS1,class VS2>
02082 TINLINE bool _vsvseq(const VS1 &sl1, const VS2 &sl2) throw()
02083 {
02084 if(sl1.size!=sl2.size)
02085 return(false);
02086
02087 int i,j,k;
02088 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++);
02089
02090 return (k==sl1.size);
02091 }
02092
02093 template <class VS1,class VS2>
02094 TINLINE bool _vsvsneq(const VS1 &sl1, const VS2 &sl2) throw()
02095 {
02096 if(sl1.size!=sl2.size)
02097 return(true);
02098
02099 int i,j,k;
02100 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++);
02101
02102 return (k!=sl1.size);
02103 }
02104
02105 template <class VS1,class VS2>
02106 TINLINE bool _vsvsless(const VS1 &sl1, const VS2 &sl2) throw()
02107 {
02108 if(sl1.size!=sl2.size)
02109 return(false);
02110
02111 int i,j,k;
02112 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++);
02113
02114 return (k==sl1.size);
02115 }
02116
02117 template <class VS1,class VS2>
02118 TINLINE bool _vsvsleq(const VS1 &sl1, const VS2 &sl2) throw()
02119 {
02120 if(sl1.size!=sl2.size)
02121 return(true);
02122
02123 int i,j,k;
02124 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++);
02125
02126 return (k==sl1.size);
02127 }
02128
02129 template <class VS>
02130 TINLINE bool _vsnot(const VS &sl) throw()
02131 {
02132 for(int i=sl.start-sl.l,k=0;k<sl.size;i++,k++)
02133 {
02134 if(!!sl.dat[i])
02135 return(false);
02136 }
02137
02138 return true;
02139 }
02140
02141 template <class VS>
02142 TINLINE void *_vsvoid(const VS &sl) throw()
02143 {
02144 for(int i=sl.start-sl.l,k=0;i<sl.size;i++,k++)
02145 {
02146 if(!!sl.dat[i])
02147 return (void *)1;
02148 }
02149
02150 return (void *)0;
02151 }
02152
02153 template <class V>
02154 std::ostream &_vout(std::ostream &s, const V &rv) throw()
02155 {
02156 for(int j=0;j<rv.size;j++)
02157 s<<rv.dat[j]<<std::endl;
02158 return s;
02159 }
02160
02161 template <class V>
02162 std::istream &_vin(std::istream &s, V &rv) throw()
02163 {
02164 for(int j=0;j<rv.size;j++)
02165 s>>rv.dat[j];
02166 return s;
02167 }
02168
02169
02170 template <class V>
02171 std::ostream &_vsout(std::ostream &s, const V &rv) throw()
02172 {
02173 for(int j=rv.start;j<=rv.end;j++)
02174 s<<rv[j]<<std::endl;
02175 return s;
02176 }
02177
02178 template <class V>
02179 std::istream &_vsin(std::istream &s, V &rv) throw()
02180 {
02181 for(int j=rv.start;j<=rv.end;j++)
02182 s>>rv[j];
02183 return s;
02184 }
02185
02186 }
02187
02188 #endif