26#ifndef _CXSC_VECTOR_INL_INCLUDED
27#define _CXSC_VECTOR_INL_INCLUDED
32#include "cxsc_blas.hpp"
39 TINLINE
void _vresize(V &rv)
noexcept
47 template <
class V,
class S>
48 TINLINE
void _vresize(V &rv,
const int &len)
60 if(len<0) cxscthrow(ERROR__WRONG_BOUNDARIES<V>(
" Resize("+nameof(rv)+
" &, const int &)"));
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];
75 template <
class V,
class S>
76 TINLINE
void _vresize(V &rv,
const int &lb,
const int &ub)
89 if(rv.size<0) cxscthrow(ERROR__WRONG_BOUNDARIES<V>(
"void Resize("+nameof(rv)+
" &, const int &, const int &)"));
91 S *ndat=
new S[rv.size];
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];
104 template <
class V1,
class V2,
class S>
105 TINLINE V1 &_vvassign(V1 &rv1,
const V2 &rv2)
noexcept
107 S *ndat=
new S[rv2.size];
112 for (
int i=0;i<rv2.size;i++)
120 template <
class V,
class S>
121 TINLINE V & _vsassign(V &rv,
const S &r)
noexcept
123 for (
int i=0;i<rv.size;i++)
129 template <
class VS1,
class VS2>
130 TINLINE VS1 & _vsvsassign(VS1 &sl1,
const VS2 &sl2)
138 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+
" "+nameof(sl1)+
"::operator =(const "+nameof(sl2)+
" &)"));
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];
145 template <
class V,
class VS,
class S>
146 TINLINE V & _vvsassign(V &rv,
const VS &sl)
noexcept
148 S *ndat=
new S[sl.size];
152 for (
int i=sl.start-sl.l, j=0;j<rv.size;i++,j++)
159 template <
class VS,
class V>
160 TINLINE VS & _vsvassign(VS &sl,
const V &rv)
168 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+
" "+nameof(sl)+
"::operator =(const "+nameof(rv)+
" &)"));
170 for (
int i=sl.start-sl.l, j=0;j<sl.size;i++,j++)
175 template <
class VS,
class S>
176 TINLINE VS & _vssassign(VS &sl,
const S &r)
noexcept
178 for (
int i=sl.start-sl.l;i<=sl.end-sl.l;i++)
183 template <
class DP,
class V1,
class V2>
184 TINLINE
void _vvaccu(DP &dp,
const V1 & rv1,
const V2 &rv2)
192 if(rv1.size!=rv2.size) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate("+nameof(dp)+
" &, const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
194 for(
int i=0;i<rv1.size;i++)
195 accumulate(dp,rv1.dat[i],rv2.dat[i]);
198 template <
class DP,
class VS,
class V>
199 TINLINE
void _vsvaccu(DP &dp,
const VS & sl,
const V &rv)
207 if(sl.size!=rv.size) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate("+nameof(dp)+
" &, const "+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
209 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
210 accumulate(dp,sl.dat[j],rv.dat[i]);
213 template <
class V,
class S,
class E>
214 TINLINE E _vsdiv(
const V &rv,
const S &s)
noexcept
218 for(
int i=0;i<rv.size;i++)
219 p.dat[i]=rv.dat[i]/s;
224 template <
class V,
class S>
225 TINLINE V &_vsdivassign(V &rv,
const S &r)
noexcept
227 for(
int i=0;i<rv.size;i++)
232 template <
class VS,
class S,
class E>
233 TINLINE E _vssdiv(
const VS &sl,
const S &s)
noexcept
235 E p(sl.start,sl.end);
237 for(
int i=sl.start-sl.l;i<sl.size;i++)
238 p.dat[i]=sl.dat[i]/s;
243 template <
class V,
class S,
class E>
244 TINLINE E _vsmult(
const V &rv,
const S &s)
noexcept
248 for(
int i=0;i<rv.size;i++)
249 p.dat[i]=rv.dat[i]*s;
254 template <
class VS,
class S,
class E>
255 TINLINE E _vssmult(
const VS &sl,
const S &s)
noexcept
257 E p(sl.start,sl.end);
259 for(
int i=sl.start-sl.l,k=0;k<sl.size;i++,k++)
260 p.dat[k]=sl.dat[i]*s;
265 template <
class V1,
class V2,
class E>
266 TINLINE E _vvlmult(
const V1 & rv1,
const V2 &rv2)
274 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+
" operator *(const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
276 dotprecision dot(0.0);
277 accumulate(dot,rv1,rv2);
284 template <
class VS,
class V,
class E>
285 TINLINE E _vsvlmult(
const VS & sl,
const V &rv)
293 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+
" operator *(const "+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
295 dotprecision dot(0.0);
296 accumulate(dot,sl,rv);
303 template <
class VS1,
class VS2,
class E>
304 TINLINE E _vsvslmult(
const VS1 & sl1,
const VS2 &sl2)
312 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+
" operator *(const "+nameof(sl1)+
" &, const "+nameof(sl2)+
" &)"));
314 dotprecision dot(0.0);
315 accumulate(dot,sl1,sl2);
322 template <
class V1,
class V2,
class E>
323 TINLINE E _vvlimult(
const V1 & rv1,
const V2 &rv2)
331 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+
" operator *(const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
333 idotprecision idot(0.0);
334 accumulate(idot,rv1,rv2);
339 template <
class VS,
class V,
class E>
340 TINLINE E _vsvlimult(
const VS & sl,
const V &rv)
348 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+
" operator *(const "+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
350 idotprecision idot(0.0);
351 accumulate(idot,sl,rv);
356 template <
class VS1,
class VS2,
class E>
357 TINLINE E _vsvslimult(
const VS1 & sl1,
const VS2 &sl2)
365 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+
" operator *(const "+nameof(sl1)+
" &, const "+nameof(sl2)+
" &)"));
367 idotprecision idot(0.0);
368 accumulate(idot,sl1,sl2);
373 template <
class V1,
class V2,
class E>
374 TINLINE E _vvmult(
const V1 & rv1,
const V2 &rv2)
382 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+
" operator *(const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
389 blasdot(rv1,rv2,ret);
395 dotprecision dot(0.0);
396 dot.set_k(opdotprec);
405 template <
class VS,
class V,
class E>
406 TINLINE E _vsvmult(
const VS & sl,
const V &rv)
414 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+
" operator *(const "+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
426 dotprecision dot(0.0);
427 dot.set_k(opdotprec);
436 template <
class VS1,
class VS2,
class E>
437 TINLINE E _vsvsmult(
const VS1 & sl1,
const VS2 &sl2)
445 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+
" operator *(const "+nameof(sl1)+
" &, const "+nameof(sl2)+
" &)"));
451 blasdot(sl1,sl2,ret);
457 dotprecision dot(0.0);
458 dot.set_k(opdotprec);
467 template <
class V1,
class V2,
class E>
468 TINLINE E _vvimult(
const V1 & rv1,
const V2 &rv2)
476 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+
" operator *(const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
482 blasdot(rv1,rv2,ret);
488 idotprecision idot(0.0);
489 idot.set_k(opdotprec);
490 accumulate(idot,rv1,rv2);
496 template <
class VS,
class V,
class E>
497 TINLINE E _vsvimult(
const VS & sl,
const V &rv)
505 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+
" operator *(const "+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
517 idotprecision idot(0.0);
518 idot.set_k(opdotprec);
519 accumulate(idot,sl,rv);
525 template <
class VS1,
class VS2,
class E>
526 TINLINE E _vsvsimult(
const VS1 & sl1,
const VS2 &sl2)
534 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+
" operator *(const "+nameof(sl1)+
" &, const "+nameof(sl2)+
" &)"));
540 blasdot(sl1,sl2,ret);
546 idotprecision idot(0.0);
547 idot.set_k(opdotprec);
548 accumulate(idot,sl1,sl2);
554 template <
class V1,
class V2,
class E>
555 TINLINE E _vvcmult(
const V1 & rv1,
const V2 &rv2)
563 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+
" operator *(const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
569 blasdot(rv1,rv2,ret);
575 cdotprecision cdot(0.0);
576 cdot.set_k(opdotprec);
583 template <
class VS,
class V,
class E>
584 TINLINE E _vsvcmult(
const VS & sl,
const V &rv)
592 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+
" operator *(const "+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
604 cdotprecision cdot(0.0);
605 cdot.set_k(opdotprec);
612 template <
class VS1,
class VS2,
class E>
613 TINLINE E _vsvscmult(
const VS1 & sl1,
const VS2 &sl2)
621 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+
" operator *(const "+nameof(sl1)+
" &, const "+nameof(sl2)+
" &)"));
627 blasdot(sl1,sl2,ret);
633 cdotprecision cdot(0.0);
634 cdot.set_k(opdotprec);
641 template <
class V1,
class V2,
class E>
642 TINLINE E _vvcimult(
const V1 & rv1,
const V2 &rv2)
650 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(E())+
" operator *(const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
656 blasdot(rv1,rv2,ret);
662 cidotprecision cidot(0.0);
663 cidot.set_k(opdotprec);
664 accumulate(cidot,rv1,rv2);
670 template <
class VS,
class V,
class E>
671 TINLINE E _vsvcimult(
const VS & sl,
const V &rv)
679 if(sl.size!=rv.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(E())+
" operator *(const "+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
691 cidotprecision cidot(0.0);
692 cidot.set_k(opdotprec);
693 accumulate(cidot,sl,rv);
699 template <
class VS1,
class VS2,
class E>
700 TINLINE E _vsvscimult(
const VS1 & sl1,
const VS2 &sl2)
708 if(sl1.size!=sl2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(E())+
" operator *(const "+nameof(sl1)+
" &, const "+nameof(sl2)+
" &)"));
714 blasdot(sl1,sl2,ret);
720 cidotprecision cidot(0.0);
721 cidot.set_k(opdotprec);
722 accumulate(cidot,sl1,sl2);
728 template <
class V,
class S>
729 TINLINE V &_vsmultassign(V &rv,
const S &r)
noexcept
731 for(
int i=0;i<rv.size;i++)
736 template <
class VS,
class S>
737 TINLINE VS &_vssmultassign(VS &rv,
const S &r)
noexcept
739 for(
int i=rv.start-rv.l;i<=rv.end-rv.l;i++)
744 template <
class VS,
class S>
745 TINLINE VS &_vssdivassign(VS &rv,
const S &r)
noexcept
747 for(
int i=rv.start-rv.l;i<=rv.end-rv.l;i++)
752 template <
class V1,
class V2,
class E>
753 TINLINE E _vvplus(
const V1 &rv1,
const V2 &rv2)
763 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+
" operator +(const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
765 for (
int i=0;i<rv1.size;i++)
766 sum.dat[i]=rv1.dat[i]+rv2.dat[i];
770 template <
class V,
class VS,
class E>
771 TINLINE E _vvsplus(
const V &rv,
const VS &sl)
781 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(sum)+
" operator +(const "+nameof(rv)+
" &,const "+nameof(sl)+
" &)"));
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];
788 template <
class VS1,
class VS2,
class E>
789 TINLINE E _vsvsplus(
const VS1 &s1,
const VS2 &s2)
796 E sum(s1.start,s1.end);
799 if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sum)+
" operator +(const "+nameof(s1)+
" &,const "+nameof(s2)+
" &)"));
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];
806 template <
class VS1,
class VS2,
class E>
807 TINLINE E _vsvsminus(
const VS1 &s1,
const VS2 &s2)
814 E sum(s1.start,s1.end);
817 if(s1.size!=s2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sum)+
" operator -(const "+nameof(s1)+
" &,const "+nameof(s2)+
" &)"));
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];
824 template <
class V1,
class V2>
825 TINLINE V1 &_vvplusassign(V1 &rv1,
const V2 &rv2)
833 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+
" & operator +=("+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
835 for(
int i=0;i<rv1.size;i++)
836 rv1.dat[i]+=rv2.dat[i];
840 template <
class V,
class VS>
841 TINLINE V &_vvsplusassign(V &rv,
const VS &sl)
849 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+
" & operator +=("+nameof(rv)+
" &, const "+nameof(sl)+
" &)"));
851 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
852 rv.dat[i]+=sl.dat[j];
856 template <
class VS,
class V>
857 TINLINE VS &_vsvplusassign(VS &sl,
const V &rv)
865 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+
" & operator +=("+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
867 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
868 sl.dat[j]+=rv.dat[i];
872 template <
class VS1,
class VS2>
873 TINLINE VS1 &_vsvsplusassign(VS1 &sl1,
const VS2 &sl2)
881 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+
" & operator +=("+nameof(sl1)+
" &, const "+nameof(sl2)+
" &)"));
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];
888 template <
class VS1,
class VS2>
889 TINLINE VS1 &_vsvsminusassign(VS1 &sl1,
const VS2 &sl2)
897 if(sl2.size!=sl1.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS1>(nameof(sl1)+
" & operator +=("+nameof(sl1)+
" &, const "+nameof(sl2)+
" &)"));
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];
904 template <
class V1,
class V2>
905 TINLINE V1 &_vvminusassign(V1 &rv1,
const V2 &rv2)
913 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V1>(nameof(rv1)+
" & operator -=("+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
915 for(
int i=0;i<rv1.size;i++)
916 rv1.dat[i]-=rv2.dat[i];
920 template <
class V,
class VS>
921 TINLINE V &_vvsminusassign(V &rv,
const VS &sl)
929 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<V>(nameof(rv)+
" & operator -=("+nameof(rv)+
" &, const "+nameof(sl)+
" &)"));
931 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
932 rv.dat[i]-=sl.dat[j];
936 template <
class VS,
class V>
937 TINLINE VS &_vsvminusassign(VS &sl,
const V &rv)
945 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(nameof(sl)+
" & operator -=("+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
947 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
948 sl.dat[j]-=rv.dat[i];
953 TINLINE V _vminus(
const V &rv)
noexcept
957 for (
int i=0;i<rv.size;i++)
958 sum.dat[i]= -rv.dat[i];
963 template <
class VS,
class V>
964 TINLINE V _vsminus(
const VS &sl)
noexcept
966 V sum(sl.start,sl.end);
968 for (
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
969 sum.dat[i]= -sl.dat[j];
974 template <
class V1,
class V2,
class E>
975 TINLINE E _vvminus(
const V1 &rv1,
const V2 &rv2)
985 if(rv1.size!=rv2.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<E>(nameof(sum)+
" operator -(const "+nameof(rv1)+
" &, const "+nameof(rv2)+
" &)"));
987 for (
int i=0;i<rv1.size;i++)
988 sum.dat[i]=rv1.dat[i]-rv2.dat[i];
992 template <
class V,
class VS,
class E>
993 TINLINE E _vvsminus(
const V &rv,
const VS &sl)
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)+
" &)"));
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];
1011 template <
class VS,
class V,
class E>
1012 TINLINE E _vsvminus(
const VS &sl,
const V &rv)
1013#if(CXSC_INDEX_CHECK)
1019 E sum(sl.start,sl.end);
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)+
" &)"));
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];
1029 template <
class V1,
class V2,
class E>
1030 TINLINE E _vvconv(
const V1 &rv1,
const V2 &rv2)
1031#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1042 for (
int i=0;i<rv1.size;i++)
1043 sum.dat[i]=rv1.dat[i]|rv2.dat[i];
1047 template <
class V,
class VS,
class E>
1048 TINLINE E _vvsconv(
const V &rv,
const VS &sl)
1049#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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];
1065 template <
class VS1,
class VS2,
class E>
1066 TINLINE E _vsvsconv(
const VS1 &s1,
const VS2 &s2)
1067#if(CXSC_INDEX_CHECK)
1073 E sum(s1.start,s1.end);
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)+
" &)"));
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];
1083 template <
class V1,
class V2>
1084 TINLINE V1 &_vvconvassign(V1 &rv1,
const V2 &rv2)
1085#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1094 for(
int i=0;i<rv1.size;i++)
1095 rv1.dat[i]|=rv2.dat[i];
1099 template <
class V,
class VS>
1100 TINLINE V &_vvsconvassign(V &rv,
const VS &sl)
1101#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1110 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1111 rv.dat[i]|=sl.dat[j];
1115 template <
class VS,
class V>
1116 TINLINE VS &_vsvconvassign(VS &sl,
const V &rv)
1117#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1126 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1127 sl.dat[j]|=rv.dat[i];
1131 template <
class VS1,
class VS2>
1132 TINLINE VS1 &_vsvsconvassign(VS1 &sl1,
const VS2 &sl2)
1133#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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];
1147 template <
class V1,
class V2,
class E>
1148 TINLINE E _vvsect(
const V1 &rv1,
const V2 &rv2)
1149#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1160 for (
int i=0;i<rv1.size;i++)
1161 sum.dat[i]=rv1.dat[i]&rv2.dat[i];
1165 template <
class V,
class VS,
class E>
1166 TINLINE E _vvssect(
const V &rv,
const VS &sl)
1167#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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];
1183 template <
class VS1,
class VS2,
class E>
1184 TINLINE E _vsvssect(
const VS1 &s1,
const VS2 &s2)
1185#if(CXSC_INDEX_CHECK)
1191 E sum(s1.start,s1.end);
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)+
" &)"));
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];
1201 template <
class V1,
class V2>
1202 TINLINE V1 &_vvsectassign(V1 &rv1,
const V2 &rv2)
1203#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1212 for(
int i=0;i<rv1.size;i++)
1213 rv1.dat[i]&=rv2.dat[i];
1217 template <
class V,
class VS>
1218 TINLINE V &_vvssectassign(V &rv,
const VS &sl)
1219#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1228 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1229 rv.dat[i]&=sl.dat[j];
1233 template <
class VS,
class V>
1234 TINLINE VS &_vsvsectassign(VS &sl,
const V &rv)
1235#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1244 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1245 sl.dat[j]&=rv.dat[i];
1249 template <
class VS1,
class VS2>
1250 TINLINE VS1 &_vsvssectassign(VS1 &sl1,
const VS2 &sl2)
1251#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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];
1265 template <
class V1,
class V2>
1266 TINLINE
bool _vveq(
const V1 &rv1,
const V2 &rv2)
noexcept
1268 if(rv1.size!=rv2.size)
1272 for (i=0;i<rv1.size && rv1.dat[i]==rv2.dat[i];i++);
1274 return (i==rv1.size);
1277 template <
class VS,
class V>
1278 TINLINE
bool _vsveq(
const VS &sl,
const V &rv)
noexcept
1280 if(sl.size!=rv.size)
1284 for (i=0,j=sl.start-sl.l;i<rv.size && sl.dat[j]==rv.dat[i];i++,j++);
1286 return (i==rv.size);
1289 template <
class V1,
class V2>
1290 TINLINE
bool _vvneq(
const V1 &rv1,
const V2 &rv2)
noexcept
1292 if(rv1.size!=rv2.size)
1296 for (i=0;i<rv1.size && rv1.dat[i]==rv2.dat[i];i++);
1298 return (i!=rv1.size);
1301 template <
class VS,
class V>
1302 TINLINE
bool _vsvneq(
const VS &sl,
const V &rv)
noexcept
1304 if(sl.size!=rv.size)
1308 for (i=0,j=sl.start-sl.l;i<rv.size && sl.dat[j]==rv.dat[i];i++,j++);
1310 return (i!=rv.size);
1313 template <
class V1,
class V2>
1314 TINLINE
bool _vvless(
const V1 &rv1,
const V2 &rv2)
noexcept
1316 if(rv1.size!=rv2.size)
1320 for(i=0;i<rv1.size&&(rv1.dat[i]<rv2.dat[i]);i++);
1322 return (i==rv1.size);
1325 template <
class VS,
class V>
1326 TINLINE
bool _vsvless(
const VS &sl,
const V &rv)
noexcept
1328 if(sl.size!=rv.size)
1332 for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]<rv.dat[j]);i++,j++);
1334 return (j==sl.size);
1337 template <
class V1,
class V2>
1338 TINLINE
bool _vvleq(
const V1 &rv1,
const V2 &rv2)
noexcept
1340 if(rv1.size!=rv2.size)
1344 for(i=0;i<rv1.size&&(rv1.dat[i]<=rv2.dat[i]);i++);
1346 return (i==rv1.size);
1349 template <
class VS,
class V>
1350 TINLINE
bool _vsvleq(
const VS &sl,
const V &rv)
noexcept
1352 if(sl.size!=rv.size)
1356 for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]<=rv.dat[j]);i++,j++);
1358 return (j==sl.size);
1361 template <
class V,
class VS>
1362 TINLINE
bool _vvsless(
const V &rv,
const VS &sl)
noexcept
1364 if(sl.size!=rv.size)
1368 for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]>rv.dat[j]);i++,j++);
1370 return (j==sl.size);
1373 template <
class V,
class VS>
1374 TINLINE
bool _vvsleq(
const V &rv,
const VS &sl)
noexcept
1376 if(sl.size!=rv.size)
1380 for(i=sl.start-sl.l,j=0;j<sl.size&&(sl.dat[i]>=rv.dat[j]);i++,j++);
1382 return (j==sl.size);
1386 TINLINE
bool _vnot(
const V &rv)
noexcept
1389 for(i=0;i<rv.size;i++)
1399 TINLINE
void *_vvoid(
const V &rv)
noexcept
1401 for(
int i=0;i<rv.size;i++)
1411 TINLINE V _vconj(
const V &rv)
noexcept
1415 for(
int i=0;i<rv.size;i++)
1416 erg.dat[i]=conj(rv.dat[i]);
1421 template <
class VS,
class E>
1422 TINLINE E _vsconj(
const VS &sl)
noexcept
1424 E erg(sl.start,sl.end);
1426 for(
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1427 erg.dat[i]=conj(sl.dat[j]);
1432 template <
class V,
class E>
1433 TINLINE E _vabs(
const V &rv)
noexcept
1437 for(
int i=0;i<rv.size;i++)
1438 erg.dat[i]=
abs(rv.dat[i]);
1443 template <
class VS,
class E>
1444 TINLINE E _vsabs(
const VS &sl)
noexcept
1446 E erg(sl.start,sl.end);
1448 for(
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1449 erg.dat[i]=
abs(sl.dat[j]);
1454 template <
class V,
class E>
1455 TINLINE E _vdiam(
const V &rv)
noexcept
1459 for(
int i=0;i<rv.size;i++)
1460 erg.dat[i]=
diam(rv.dat[i]);
1465 template <
class VS,
class E>
1466 TINLINE E _vsdiam(
const VS &sl)
noexcept
1468 E erg(sl.start,sl.end);
1470 for(
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1471 erg.dat[i]=
diam(sl.dat[j]);
1476 template <
class V,
class E>
1477 TINLINE E _vmid(
const V &rv)
noexcept
1481 for(
int i=0;i<rv.size;i++)
1482 erg.dat[i]=
mid(rv.dat[i]);
1487 template <
class VS,
class E>
1488 TINLINE E _vsmid(
const VS &sl)
noexcept
1490 E erg(sl.start,sl.end);
1492 for(
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1493 erg.dat[i]=
mid(sl.dat[j]);
1498 template <
class V,
class E>
1499 TINLINE E _vinf(
const V &rv)
noexcept
1503 for(
int i=0;i<rv.size;i++)
1504 erg.dat[i]=Inf(rv.dat[i]);
1509 template <
class VS,
class E>
1510 TINLINE E _vsinf(
const VS &sl)
noexcept
1512 E erg(sl.start,sl.end);
1514 for(
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1515 erg.dat[i]=Inf(sl.dat[j]);
1520 template <
class V,
class E>
1521 TINLINE E _vsup(
const V &rv)
noexcept
1525 for(
int i=0;i<rv.size;i++)
1526 erg.dat[i]=Sup(rv.dat[i]);
1531 template <
class VS,
class E>
1532 TINLINE E _vssup(
const VS &sl)
noexcept
1534 E erg(sl.start,sl.end);
1536 for(
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1537 erg.dat[i]=Sup(sl.dat[j]);
1542 template <
class V,
class E>
1543 TINLINE E _vre(
const V &rv)
noexcept
1547 for(
int i=0;i<rv.size;i++)
1548 erg.dat[i]=Re(rv.dat[i]);
1553 template <
class VS,
class E>
1554 TINLINE E _vsre(
const VS &sl)
noexcept
1556 E erg(sl.start,sl.end);
1558 for(
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1559 erg.dat[i]=Re(sl.dat[j]);
1564 template <
class V,
class E>
1565 TINLINE E _vim(
const V &rv)
noexcept
1569 for(
int i=0;i<rv.size;i++)
1570 erg.dat[i]=Im(rv.dat[i]);
1575 template <
class VS,
class E>
1576 TINLINE E _vsim(
const VS &sl)
noexcept
1578 E erg(sl.start,sl.end);
1580 for(
int i=0,j=sl.start-sl.l;i<sl.size;i++,j++)
1581 erg.dat[i]=Im(sl.dat[j]);
1586 template <
class V,
class S>
1587 TINLINE V &_vsusetsup(V &v,
const S &s)
noexcept
1589 for(
int i=0;i<v.size;i++)
1590 UncheckedSetInf(v.dat[i],s);
1594 template <
class V,
class S>
1595 TINLINE V &_vsusetinf(V &v,
const S &s)
noexcept
1597 for(
int i=0;i<v.size;i++)
1598 UncheckedSetInf(v.dat[i],s);
1602 template <
class V,
class S>
1603 TINLINE V &_vssetinf(V &v,
const S &s)
noexcept
1605 for(
int i=0;i<v.size;i++)
1610 template <
class V,
class S>
1611 TINLINE V &_vssetsup(V &v,
const S &s)
noexcept
1613 for(
int i=0;i<v.size;i++)
1618 template <
class V,
class S>
1619 TINLINE V &_vssetre(V &v,
const S &s)
noexcept
1621 for(
int i=0;i<v.size;i++)
1626 template <
class V,
class S>
1627 TINLINE V &_vssetim(V &v,
const S &s)
noexcept
1629 for(
int i=0;i<v.size;i++)
1634 template <
class VS,
class S>
1635 TINLINE VS &_vssusetsup(VS &vs,
const S &s)
noexcept
1637 for(
int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1638 UncheckedSetInf(vs.dat[i],s);
1642 template <
class VS,
class S>
1643 TINLINE VS &_vssusetinf(VS &vs,
const S &s)
noexcept
1645 for(
int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1646 UncheckedSetInf(vs.dat[i],s);
1650 template <
class VS,
class S>
1651 TINLINE VS &_vsssetinf(VS &vs,
const S &s)
noexcept
1653 for(
int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1654 SetInf(vs.dat[i],s);
1658 template <
class VS,
class S>
1659 TINLINE VS &_vsssetsup(VS &vs,
const S &s)
noexcept
1661 for(
int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1662 SetSup(vs.dat[i],s);
1666 template <
class VS,
class S>
1667 TINLINE VS &_vsssetre(VS &vs,
const S &s)
noexcept
1669 for(
int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1674 template <
class VS,
class S>
1675 TINLINE VS &_vsssetim(VS &vs,
const S &s)
noexcept
1677 for(
int i=vs.start-vs.l;i<=vs.end-vs.l;i++)
1682 template <
class V1,
class V2>
1683 TINLINE V1 &_vvsetinf(V1 &rv1,
const V2 &rv2)
1684#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1693 for(
int i=0;i<rv1.size;i++)
1694 SetInf(rv1.dat[i],rv2.dat[i]);
1698 template <
class V,
class VS>
1699 TINLINE V &_vvssetinf(V &rv,
const VS &sl)
1700#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1709 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1710 SetInf(rv.dat[i],sl.dat[j]);
1714 template <
class VS,
class V>
1715 TINLINE VS &_vsvsetinf(VS &sl,
const V &rv)
1716#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1725 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1726 SetInf(sl.dat[j],rv.dat[i]);
1730 template <
class VS1,
class VS2>
1731 TINLINE VS1 &_vsvssetinf(VS1 &sl1,
const VS2 &sl2)
1732#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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]);
1746 template <
class V1,
class V2>
1747 TINLINE V1 &_vvsetsup(V1 &rv1,
const V2 &rv2)
1748#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1757 for(
int i=0;i<rv1.size;i++)
1758 SetSup(rv1.dat[i],rv2.dat[i]);
1762 template <
class V,
class VS>
1763 TINLINE V &_vvssetsup(V &rv,
const VS &sl)
1764#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1773 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1774 SetSup(rv.dat[i],sl.dat[j]);
1778 template <
class VS,
class V>
1779 TINLINE VS &_vsvsetsup(VS &sl,
const V &rv)
1780#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1789 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1790 SetSup(sl.dat[j],rv.dat[i]);
1794 template <
class VS1,
class VS2>
1795 TINLINE VS1 &_vsvssetsup(VS1 &sl1,
const VS2 &sl2)
1796#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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]);
1810 template <
class V1,
class V2>
1811 TINLINE V1 &_vvusetinf(V1 &rv1,
const V2 &rv2)
1812#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1821 for(
int i=0;i<rv1.size;i++)
1822 UncheckedSetInf(rv1.dat[i],rv2.dat[i]);
1826 template <
class V,
class VS>
1827 TINLINE V &_vvsusetinf(V &rv,
const VS &sl)
1828#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1837 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1838 UncheckedSetInf(rv.dat[i],sl.dat[j]);
1842 template <
class VS,
class V>
1843 TINLINE VS &_vsvusetinf(VS &sl,
const V &rv)
1844#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1853 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1854 UncheckedSetInf(sl.dat[j],rv.dat[i]);
1858 template <
class VS1,
class VS2>
1859 TINLINE VS1 &_vsvsusetinf(VS1 &sl1,
const VS2 &sl2)
1860#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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]);
1874 template <
class V1,
class V2>
1875 TINLINE V1 &_vvusetsup(V1 &rv1,
const V2 &rv2)
1876#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1885 for(
int i=0;i<rv1.size;i++)
1886 UncheckedSetSup(rv1.dat[i],rv2.dat[i]);
1890 template <
class V,
class VS>
1891 TINLINE V &_vvsusetsup(V &rv,
const VS &sl)
1892#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1901 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1902 UncheckedSetSup(rv.dat[i],sl.dat[j]);
1906 template <
class VS,
class V>
1907 TINLINE VS &_vsvusetsup(VS &sl,
const V &rv)
1908#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1917 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1918 UncheckedSetSup(sl.dat[j],rv.dat[i]);
1922 template <
class VS1,
class VS2>
1923 TINLINE VS1 &_vsvsusetsup(VS1 &sl1,
const VS2 &sl2)
1924#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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]);
1938 template <
class V1,
class V2>
1939 TINLINE V1 &_vvsetim(V1 &rv1,
const V2 &rv2)
1940#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1949 for(
int i=0;i<rv1.size;i++)
1950 SetIm(rv1.dat[i],rv2.dat[i]);
1954 template <
class V,
class VS>
1955 TINLINE V &_vvssetim(V &rv,
const VS &sl)
1956#if(CXSC_INDEX_CHECK)
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)+
" &)"));
1965 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1966 SetIm(rv.dat[i],sl.dat[j]);
1970 template <
class VS,
class V>
1971 TINLINE VS &_vsvsetim(VS &sl,
const V &rv)
1972#if(CXSC_INDEX_CHECK)
1978#if(CXSC_INDEX_CHECK)
1979 if(rv.size!=sl.size) cxscthrow(ERROR__OP_WITH_WRONG_DIM<VS>(
"SetIm("+nameof(sl)+
" &, const "+nameof(rv)+
" &)"));
1981 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
1982 SetIm(sl.dat[j],rv.dat[i]);
1986 template <
class VS1,
class VS2>
1987 TINLINE VS1 &_vsvssetim(VS1 &sl1,
const VS2 &sl2)
1988#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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]);
2002 template <
class V1,
class V2>
2003 TINLINE V1 &_vvsetre(V1 &rv1,
const V2 &rv2)
2004#if(CXSC_INDEX_CHECK)
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)+
" &)"));
2013 for(
int i=0;i<rv1.size;i++)
2014 SetRe(rv1.dat[i],rv2.dat[i]);
2018 template <
class V,
class VS>
2019 TINLINE V &_vvssetre(V &rv,
const VS &sl)
2020#if(CXSC_INDEX_CHECK)
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)+
" &)"));
2029 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
2030 SetRe(rv.dat[i],sl.dat[j]);
2034 template <
class VS,
class V>
2035 TINLINE VS &_vsvsetre(VS &sl,
const V &rv)
2036#if(CXSC_INDEX_CHECK)
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)+
" &)"));
2045 for(
int i=0,j=sl.start-sl.l;i<rv.size;i++,j++)
2046 SetRe(sl.dat[j],rv.dat[i]);
2050 template <
class VS1,
class VS2>
2051 TINLINE VS1 &_vsvssetre(VS1 &sl1,
const VS2 &sl2)
2052#if(CXSC_INDEX_CHECK)
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)+
" &)"));
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]);
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)
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)+
" &)"));
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]);
2081 template <
class VS1,
class VS2>
2082 TINLINE
bool _vsvseq(
const VS1 &sl1,
const VS2 &sl2)
noexcept
2084 if(sl1.size!=sl2.size)
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++);
2090 return (k==sl1.size);
2093 template <
class VS1,
class VS2>
2094 TINLINE
bool _vsvsneq(
const VS1 &sl1,
const VS2 &sl2)
noexcept
2096 if(sl1.size!=sl2.size)
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++);
2102 return (k!=sl1.size);
2105 template <
class VS1,
class VS2>
2106 TINLINE
bool _vsvsless(
const VS1 &sl1,
const VS2 &sl2)
noexcept
2108 if(sl1.size!=sl2.size)
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++);
2114 return (k==sl1.size);
2117 template <
class VS1,
class VS2>
2118 TINLINE
bool _vsvsleq(
const VS1 &sl1,
const VS2 &sl2)
noexcept
2120 if(sl1.size!=sl2.size)
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++);
2126 return (k==sl1.size);
2130 TINLINE
bool _vsnot(
const VS &sl)
noexcept
2132 for(
int i=sl.start-sl.l,k=0;k<sl.size;i++,k++)
2142 TINLINE
void *_vsvoid(
const VS &sl)
noexcept
2144 for(
int i=sl.start-sl.l,k=0;i<sl.size;i++,k++)
2154 std::ostream &_vout(std::ostream &s,
const V &rv)
noexcept
2156 for(
int j=0;j<rv.size;j++)
2157 s<<rv.dat[j]<<std::endl;
2162 std::istream &_vin(std::istream &s, V &rv)
noexcept
2164 for(
int j=0;j<rv.size;j++)
2171 std::ostream &_vsout(std::ostream &s,
const V &rv)
noexcept
2173 for(
int j=rv.start;j<=rv.end;j++)
2174 s<<rv[j]<<std::endl;
2179 std::istream &_vsin(std::istream &s, V &rv)
noexcept
2181 for(
int j=rv.start;j<=rv.end;j++)
The namespace cxsc, providing all functionality of the class library C-XSC.
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...
cvector diam(const cimatrix_subv &mv) noexcept
Returns the diameter of the matrix.
cimatrix & SetLb(cimatrix &m, const int &i, const int &j) noexcept
Sets the lower bound index.
ivector abs(const cimatrix_subv &mv) noexcept
Returns the absolute value of the matrix.
cvector mid(const cimatrix_subv &mv) noexcept
Returns the middle of the matrix.
cimatrix & SetUb(cimatrix &m, const int &i, const int &j) noexcept
Sets the upper bound index.