26 #ifndef _CXSC_RMATRIX_INL_INCLUDED 27 #define _CXSC_RMATRIX_INL_INCLUDED 29 #include "intmatrix.hpp" 33 INLINE
rmatrix::rmatrix() throw():dat(NULL),lb1(1),ub1(0),lb2(1),ub2(0),xsize(0),ysize(0)
43 INLINE
rmatrix::rmatrix(
const rmatrix &rm)
throw():lb1(rm.lb1),ub1(rm.ub1),lb2(rm.lb2),ub2(rm.ub2),xsize(rm.xsize),ysize(rm.ysize)
45 dat=
new real[xsize*ysize];
46 for(
int i=0;i<xsize*ysize;i++)
52 throw(ERROR_RMATRIX_WRONG_BOUNDARIES):lb1(1),ub1(m),lb2(1),ub2(n),xsize(n),ysize(m)
54 throw():lb1(1),ub1(m),lb2(1),ub2(n),xsize(n),ysize(m)
58 if((n<0)||(m<0)) cxscthrow(ERROR_RMATRIX_WRONG_BOUNDARIES(
"rmatrix::rmatrix(const int &m, const int &n)"));
65 throw(ERROR_RMATRIX_WRONG_BOUNDARIES):lb1(m1),ub1(m2),lb2(n1),ub2(n2),xsize(n2-n1+1),ysize(m2-m1+1)
67 throw():lb1(m1),ub1(m2),lb2(n1),ub2(n2),xsize(n2-n1+1),ysize(m2-m1+1)
71 if((m2<m1)||(n2<n1)) cxscthrow(ERROR_RMATRIX_WRONG_BOUNDARIES(
"rmatrix::rmatrix(const int &m1, const int &n1, const int &m2, const int &n2)"));
73 dat=
new real[xsize*ysize];
79 for (
int i=0, j=v.start;i<v.size;i++,j+=v.offset)
86 for(
int i=0;i<v.size;i++)
93 for(
int i=0,j=v.start-v.l;i<v.size;i++,j++)
102 dat=
new real[xsize*ysize];
103 for (i=0;i<ysize;i++)
107 dat[i*xsize+j]=sl.dat[(sl.offset1+i)*sl.mxsize+sl.offset2+j];
113 dat=
new real[xsize*ysize];
114 for(
int i=0 ; i<ysize ; i++)
115 for(
int j=0 ; j<xsize ; j++)
116 dat[i*xsize+j] = I[i+lb1][j+lb2];
120 #if(CXSC_INDEX_CHECK) 121 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
131 #if(CXSC_INDEX_CHECK) 132 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
141 #if(CXSC_INDEX_CHECK) 142 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
152 #if(CXSC_INDEX_CHECK) 153 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
163 #if(CXSC_INDEX_CHECK) 164 throw(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC)
169 #if(CXSC_INDEX_CHECK) 170 if((i<lb)||(i>ub)) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC(
"real &rmatrix_subv::operator [](const int &i) const"));
172 return dat[start+((i-lb)*offset)];
176 #if(CXSC_INDEX_CHECK) 177 throw(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC)
182 #if(CXSC_INDEX_CHECK) 183 if((i<lb)||(i>ub)) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC(
"real &rmatrix_subv::operator [](const int &i)"));
185 return dat[start+((i-lb)*offset)];
191 #if(CXSC_INDEX_CHECK) 192 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
197 #if(CXSC_INDEX_CHECK) 198 if((i<lb1)||(i>ub1)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT(
"rmatrix_subv rmatrix::operator [](const int &i)"));
200 return rmatrix_subv(dat, lb2, ub2, xsize, xsize*(i-lb1),1);
204 #if(CXSC_INDEX_CHECK) 205 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
210 #if(CXSC_INDEX_CHECK) 211 if((i.col()<lb2)||(i.col()>ub2)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT(
"rmatrix_subv rmatrix::operator [](const cxscmatrix_column &i)"));
213 return rmatrix_subv(dat, lb1, ub1, ysize, i.col()-lb2, xsize);
217 #if(CXSC_INDEX_CHECK) 218 throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
223 #if(CXSC_INDEX_CHECK) 224 if((m<1)||(n<1)||(m<lb1)||(n<lb2)||(m>ub1)||(n>ub2)) cxscthrow(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG(
"rmatrix_slice rmatrix::operator ()(const int &m, const int &n)"));
230 #if(CXSC_INDEX_CHECK) 231 throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
236 #if(CXSC_INDEX_CHECK) 237 if((m1<lb1)||(n1<lb2)||(m2>ub1)||(n2>ub2)) cxscthrow(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG(
"rmatrix_slice rmatrix::operator ()(const int &m1, const int &n1, const int &m2, const int &n2)"));
243 #if(CXSC_INDEX_CHECK) 244 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
249 #if(CXSC_INDEX_CHECK) 250 if((i<start1)||(i>end1)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT(
"rmatrix_subv rmatrix_slice::operator [](const int &i)"));
252 return rmatrix_subv(dat, start2, end2, sxsize, mxsize*(i-start1+offset1)+offset2,1);
256 #if(CXSC_INDEX_CHECK) 257 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
262 #if(CXSC_INDEX_CHECK) 263 if((i.col()<start2)||(i.col()>end2)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT(
"rmatrix_subv rmatrix_slice::operator [](const cxscmatrix_column &i)"));
265 return rmatrix_subv(dat, start1, end1, sysize, offset1*mxsize+i.col()-start2+offset2, mxsize);
269 #if(CXSC_INDEX_CHECK) 270 throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
275 #if(CXSC_INDEX_CHECK) 276 if((m<1)||(n<1)||(m<start1)||(n<start2)||(m>end1)||(n>end2)) cxscthrow(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG(
"rmatrix_slice rmatrix_slice::operator ()(const int &m, const int &n)"));
282 #if(CXSC_INDEX_CHECK) 283 throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
288 #if(CXSC_INDEX_CHECK) 289 if((m1<start1)||(n1<start2)||(m2>end1)||(n2>end2)) cxscthrow(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG(
"rmatrix_slice rmatrix_slice::operator ()(const int &m1, const int &m2, const int &n1, const int &n2)"));
295 #if(CXSC_INDEX_CHECK) 296 throw(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG)
301 #if(CXSC_INDEX_CHECK) 302 if(1<lb||i>ub) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG(
"rmatrix_subv rmatrix_subv::operator ()(const int &i)"));
304 return rmatrix_subv(dat,1,i,i,start+(1-lb)*offset,offset);
308 #if(CXSC_INDEX_CHECK) 309 throw(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG)
314 #if(CXSC_INDEX_CHECK) 315 if(i1<lb||i2>ub) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG(
"rmatrix_subv rmatrix_subv::operator ()(const int &i1,const int &i2)"));
317 return rmatrix_subv(dat,i1,i2,i2-i1+1,start+(i1-lb)*offset,offset);
325 #if(CXSC_INDEX_CHECK) 326 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
330 {
return _mvvassign(*
this,v); }
332 #if(CXSC_INDEX_CHECK) 333 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
337 {
return _mvvassign(*
this,
rvector(v)); }
342 INLINE rmatrix::operator
void*()
throw() {
return _mvoid(*
this); }
344 #if(CXSC_INDEX_CHECK) 345 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
349 {
return _msmassign(*
this,m); }
351 #if(CXSC_INDEX_CHECK) 352 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
356 {
return _msmsassign(*
this,ms); }
359 #if(CXSC_INDEX_CHECK) 360 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
364 {
return _msmassign(*
this,
rmatrix(v)); }
366 #if(CXSC_INDEX_CHECK) 367 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
373 #if(CXSC_INDEX_CHECK) 374 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
380 #if(CXSC_INDEX_CHECK) 381 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
385 {
return _msmplusassign(*
this,m1); }
387 #if(CXSC_INDEX_CHECK) 388 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
392 {
return _msmsplusassign(*
this,ms2); }
394 #if(CXSC_INDEX_CHECK) 395 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
399 {
return _msmminusassign(*
this,m1); }
401 #if(CXSC_INDEX_CHECK) 402 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
406 {
return _msmsminusassign(*
this,ms2); }
408 #if(CXSC_INDEX_CHECK) 409 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
413 {
return (*
this=*
this*m); }
415 #if(CXSC_INDEX_CHECK) 416 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
420 {
return (*
this=*
this*m); }
423 INLINE rmatrix_slice::operator
void*()
throw() {
return _msvoid(*
this); }
437 #if(CXSC_INDEX_CHECK) 438 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
442 {
return _mvmvmult<rmatrix_subv,rmatrix_subv,real>(rv1,rv2); }
444 #if(CXSC_INDEX_CHECK) 445 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
449 {
return _vmvmult<rvector,rmatrix_subv,real>(rv1,rv2); }
451 #if(CXSC_INDEX_CHECK) 452 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
456 {
return _vmvmult<rvector,rmatrix_subv,real>(rv2,rv1); }
458 #if(CXSC_INDEX_CHECK) 459 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
463 {
return _vmvmult<rvector,rmatrix_subv,real>(
rvector(sl),sv); }
465 #if(CXSC_INDEX_CHECK) 466 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
470 {
return _vmvmult<rvector,rmatrix_subv,real>(
rvector(vs),mv); }
472 #if(CXSC_INDEX_CHECK) 473 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
477 {
return _mvmvplus<rmatrix_subv,rmatrix_subv,rvector>(rv1,rv2); }
479 #if(CXSC_INDEX_CHECK) 480 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
484 {
return _mvvplus<rmatrix_subv,rvector,rvector>(rv1,rv2); }
486 #if(CXSC_INDEX_CHECK) 487 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
491 {
return _mvvplus<rmatrix_subv,rvector,rvector>(rv2,rv1); }
493 #if(CXSC_INDEX_CHECK) 494 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
498 {
return _mvvplus<rmatrix_subv,rvector,rvector>(mv,
rvector(sl)); }
500 #if(CXSC_INDEX_CHECK) 501 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
505 {
return _mvvplus<rmatrix_subv,rvector,rvector>(mv,
rvector(sl)); }
507 #if(CXSC_INDEX_CHECK) 508 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
512 {
return _mvvplusassign(*
this,rv); }
514 #if(CXSC_INDEX_CHECK) 515 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
519 {
return _mvvplusassign(*
this,
rvector(rv)); }
521 #if(CXSC_INDEX_CHECK) 522 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
526 {
return _mvmvminus<rmatrix_subv,rmatrix_subv,rvector>(rv1,rv2); }
528 #if(CXSC_INDEX_CHECK) 529 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
533 {
return _vmvminus<rvector,rmatrix_subv,rvector>(rv1,rv2); }
535 #if(CXSC_INDEX_CHECK) 536 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
540 {
return _mvvminus<rmatrix_subv,rvector,rvector>(rv1,rv2); }
542 #if(CXSC_INDEX_CHECK) 543 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
547 {
return _vmvminus<rvector,rmatrix_subv,rvector>(
rvector(sl),mv); }
549 #if(CXSC_INDEX_CHECK) 550 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
554 {
return _mvvminus<rmatrix_subv,rvector,rvector>(mv,
rvector(sl)); }
556 #if(CXSC_INDEX_CHECK) 557 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
561 {
return _mvvminusassign(*
this,rv); }
563 #if(CXSC_INDEX_CHECK) 564 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
568 {
return _mvvminusassign(*
this,
rvector(rv)); }
595 #if(CXSC_INDEX_CHECK) 596 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
600 {
return _mlb(rm,i); }
602 #if(CXSC_INDEX_CHECK) 603 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
607 {
return _mub(rm,i); }
609 #if(CXSC_INDEX_CHECK) 610 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
614 {
return _mslb(rm,i); }
616 #if(CXSC_INDEX_CHECK) 617 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
621 {
return _msub(rm,i); }
623 #if(CXSC_INDEX_CHECK) 624 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
628 {
return _msetlb(m,i,j); }
630 #if(CXSC_INDEX_CHECK) 631 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
635 {
return _msetub(m,i,j); }
639 {
return Ub(A,2)-
Lb(A,2)+1; }
642 {
return Ub(A,1)-
Lb(A,1)+1; }
645 {
return Ub(A,2)-
Lb(A,2)+1; }
648 {
return Ub(A,1)-
Lb(A,1)+1; }
652 #if(CXSC_INDEX_CHECK) 653 throw(ERROR_RMATRIX_WRONG_BOUNDARIES)
657 { _mresize<rmatrix,real>(A,m,n); }
658 INLINE
void Resize(
rmatrix &A,
const int &m1,
const int &m2,
const int &n1,
const int &n2)
659 #if(CXSC_INDEX_CHECK) 660 throw(ERROR_RMATRIX_WRONG_BOUNDARIES)
664 { _mresize<rmatrix,real>(A,m1,m2,n1,n2); }
668 #if(CXSC_INDEX_CHECK) 669 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_RMATRIX_USE_OF_UNINITIALIZED_OBJ)
673 { _smconstr(*
this,m); }
684 #if(CXSC_INDEX_CHECK) 685 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
689 { _vmconstr<rvector,rmatrix,real>(*
this,sl); }
691 #if(CXSC_INDEX_CHECK) 692 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
696 { _vmsconstr<rvector,rmatrix_slice,real>(*
this,sl); }
698 #if(CXSC_INDEX_CHECK) 699 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
703 {
return _vmassign<rvector,rmatrix,real>(*
this,m); }
705 #if(CXSC_INDEX_CHECK) 706 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
710 {
return _vmassign<rvector,rmatrix,real>(*
this,
rmatrix(m)); }
712 #if(CXSC_INDEX_CHECK) 713 throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
717 {
return _vsvassign(*
this,
rvector(m)); }
719 #if(CXSC_INDEX_CHECK) 720 throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
726 #if(CXSC_INDEX_CHECK) 727 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
731 {
return _mvvassign(*
this,
rvector(m)); }
733 #if(CXSC_INDEX_CHECK) 734 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
740 #if(CXSC_INDEX_CHECK) 741 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
745 {
return _mvmult<rmatrix,rvector,rvector>(m,v); };
747 #if(CXSC_INDEX_CHECK) 748 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
752 {
return _msvmult<rmatrix_slice,rvector,rvector>(ms,v); }
754 #if(CXSC_INDEX_CHECK) 755 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
759 {
return _vmmult<rvector,rmatrix,rvector>(v,m); }
761 #if(CXSC_INDEX_CHECK) 762 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
766 {
return _vmsmult<rvector,rmatrix_slice,rvector>(v,ms); }
768 #if(CXSC_INDEX_CHECK) 769 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
773 {
return _vmmultassign<rvector,rmatrix,real>(v,m); }
775 #if(CXSC_INDEX_CHECK) 776 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
780 {
return _vmsmultassign<rvector,rmatrix_slice,real>(v,ms); }
782 #if(CXSC_INDEX_CHECK) 783 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
787 {
return _vsmmultassign<rvector_slice,rmatrix,real>(*
this,m); }
789 #if(CXSC_INDEX_CHECK) 790 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
794 {
return _vmmult<rvector,rmatrix,rvector>(
rvector(v),m); }
799 #if(CXSC_INDEX_CHECK) 800 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
804 {
return _mmplus<rmatrix,rmatrix,rmatrix>(m1,m2); }
806 #if(CXSC_INDEX_CHECK) 807 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
811 {
return _mmsplus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
813 #if(CXSC_INDEX_CHECK) 814 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
818 {
return _mmsplus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
820 #if(CXSC_INDEX_CHECK) 821 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
825 {
return _msmsplus<rmatrix_slice,rmatrix_slice,rmatrix>(m1,m2); }
827 #if(CXSC_INDEX_CHECK) 828 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
832 {
return _mmplusassign(m1,m2); }
834 #if(CXSC_INDEX_CHECK) 835 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
839 {
return _mmsplusassign(m1,ms); }
843 #if(CXSC_INDEX_CHECK) 844 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
848 {
return _mmminus<rmatrix,rmatrix,rmatrix>(m1,m2); }
850 #if(CXSC_INDEX_CHECK) 851 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
855 {
return _mmsminus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
857 #if(CXSC_INDEX_CHECK) 858 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
862 {
return _msmminus<rmatrix_slice,rmatrix,rmatrix>(ms,m); }
864 #if(CXSC_INDEX_CHECK) 865 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
869 {
return _msmsminus<rmatrix_slice,rmatrix_slice,rmatrix>(ms1,ms2); }
871 #if(CXSC_INDEX_CHECK) 872 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
876 {
return _mmminusassign(m1,m2); }
878 #if(CXSC_INDEX_CHECK) 879 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
883 {
return _mmsminusassign(m1,ms); }
885 #if(CXSC_INDEX_CHECK) 886 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
890 {
return _mmmult<rmatrix,rmatrix,rmatrix>(m1,m2); }
892 #if(CXSC_INDEX_CHECK) 893 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
897 {
return _mmsmult<rmatrix,rmatrix_slice,rmatrix>(m1,ms); }
899 #if(CXSC_INDEX_CHECK) 900 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
904 {
return _msmmult<rmatrix_slice,rmatrix,rmatrix>(ms,m1); }
906 #if(CXSC_INDEX_CHECK) 907 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
911 {
return _msmsmult<rmatrix_slice,rmatrix_slice,rmatrix>(ms1,ms2); }
913 #if(CXSC_INDEX_CHECK) 914 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
918 {
return _mmmultassign<rmatrix,rmatrix,real>(m1,m2); }
920 #if(CXSC_INDEX_CHECK) 921 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
925 {
return _mmsmultassign<rmatrix,rmatrix_slice,real>(m1,ms); }
926 INLINE
bool operator ==(
const rmatrix &m1,
const rmatrix &m2)
throw() {
return _mmeq(m1,m2); }
927 INLINE
bool operator !=(
const rmatrix &m1,
const rmatrix &m2)
throw() {
return _mmneq(m1,m2); }
928 INLINE
bool operator <(
const rmatrix &m1,
const rmatrix &m2)
throw() {
return _mmless(m1,m2); }
929 INLINE
bool operator <=(
const rmatrix &m1,
const rmatrix &m2)
throw() {
return _mmleq(m1,m2); }
930 INLINE
bool operator >(
const rmatrix &m1,
const rmatrix &m2)
throw() {
return _mmless(m2,m1); }
931 INLINE
bool operator >=(
const rmatrix &m1,
const rmatrix &m2)
throw() {
return _mmleq(m2,m1); }
944 INLINE
bool operator !(
const rmatrix &ms)
throw() {
return _mnot(ms); }
945 INLINE
bool operator !(
const rmatrix_slice &ms)
throw() {
return _msnot(ms); }
946 INLINE std::ostream &operator <<(std::ostream &s,
const rmatrix &r)
throw() {
return _mout(s,r); }
947 INLINE std::ostream &operator <<(std::ostream &s,
const rmatrix_slice &r)
throw() {
return _msout(s,r); }
948 INLINE std::istream &operator >>(std::istream &s,
rmatrix &r)
throw() {
return _min(s,r); }
949 INLINE std::istream &operator >>(std::istream &s,
rmatrix_slice &r)
throw() {
return _msin(s,r); }
954 for(
int i=0 ; i<
ColLen(A) ; i++)
955 for(
int j=0 ; j<
RowLen(A) ; j++)
956 A[i+
Lb(A,1)][j+
Lb(A,2)] = (*this)[p[i+
Lb(p)]+
Lb(A,1)][q[j+
Lb(q)]+
Lb(A,2)];
963 for(
int i=0 ; i<
ColLen(A) ; i++)
964 A[i+
Lb(A,1)] = (*this)[p[i+
Lb(p)]+
Lb(A,1)];
rmatrix_subv & operator=(const rmatrix_subv &rv)
Implementation of standard assigning operator.
rmatrix_slice & operator/=(const real &c)
Implementation of division and allocation operation.
The Data Type rmatrix_slice.
cimatrix & operator/=(cimatrix &m, const cinterval &c)
Implementation of division and allocation operation.
rvector & operator=(const rvector &rv)
Implementation of standard assigning operator.
rvector & operator()()
Operator for accessing the whole vector.
int Lb(const cimatrix &rm, const int &i)
Returns the lower bound index.
The namespace cxsc, providing all functionality of the class library C-XSC.
rmatrix _rmatrix(const rmatrix &rm)
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
cimatrix_subv Col(cimatrix &m, const int &i)
Returns one column of the matrix as a vector.
cimatrix & SetLb(cimatrix &m, const int &i, const int &j)
Sets the lower bound index.
rmatrix_subv & operator -=(const real &c)
Implementation of subtraction and allocation operation.
rmatrix & operator()()
Operator for accessing the whole matrix.
rmatrix_subv operator [](const int &i) const
Operator for accessing a single row of the matrix.
rmatrix_subv & operator/=(const real &c)
Implementation of division and allocation operation.
cimatrix & operator *=(cimatrix &m, const cinterval &c)
Implementation of multiplication and allocation operation.
The Data Type rvector_slice.
cimatrix & SetUb(cimatrix &m, const int &i, const int &j)
Sets the upper bound index.
The Data Type rmatrix_subv.
rvector_slice & operator=(const rvector_slice &sl)
Implementation of standard assigning operator.
civector operator *(const cimatrix_subv &rv, const cinterval &s)
Implementation of multiplication operation.
rmatrix_slice & operator -=(const srmatrix &m)
Implementation of multiplication and allocation operation.
rmatrix_slice & operator+=(const srmatrix &m)
Implementation of multiplication and allocation operation.
rvector_slice & operator *=(const real &r)
Implementation of multiplication and allocation operation.
void Resize(cimatrix &A)
Resizes the matrix.
real & operator [](const int &i) const
Operator for accessing the single elements of the vector (read-only)
rmatrix_subv operator [](const int &i) const
Operator for accessing a single row of the matrix.
int ColLen(const cimatrix &)
Returns the column dimension.
rmatrix_subv & operator+=(const real &c)
Implementation of addition and allocation operation.
rmatrix_slice & operator=(const srmatrix &m)
Implementation of standard assigning operator.
rmatrix_subv & operator()()
Operator for accessing the whole vector.
cimatrix_subv Row(cimatrix &m, const int &i)
Returns one row of the matrix as a vector.
int RowLen(const cimatrix &)
Returns the row dimension.
real(void)
Constructor of class real.
cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc)
Implementation of standard algebraic addition and allocation operation.
rmatrix_slice & operator()()
Operator for accessing the whole matrix.
rmatrix_slice & operator *=(const srmatrix &m)
Implementation of multiplication and allocation operation.
rvector()
Constructor of class rvector.
int Ub(const cimatrix &rm, const int &i)
Returns the upper bound index.
rmatrix()
Constructor of class rmatrix.
rmatrix & operator=(const real &r)
Implementation of standard assigning operator.
civector operator/(const cimatrix_subv &rv, const cinterval &s)
Implementation of division operation.
rmatrix_subv & operator *=(const real &c)
Implementation of multiplication and allocation operation.
ivector abs(const cimatrix_subv &mv)
Returns the absolute value of the matrix.