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_RMATRIX_INL_INCLUDED
00027 #define _CXSC_RMATRIX_INL_INCLUDED
00028
00029 #include "intmatrix.hpp"
00030
00031 namespace cxsc {
00032
00033 INLINE rmatrix::rmatrix() throw():dat(NULL),lb1(1),ub1(0),lb2(1),ub2(0),xsize(0),ysize(0)
00034 {
00035 }
00036
00037 INLINE rmatrix::rmatrix(const real &r) throw():lb1(1),ub1(1),lb2(1),ub2(1),xsize(1),ysize(1)
00038 {
00039 dat=new real[1];
00040 *dat=r;
00041 }
00042
00043 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)
00044 {
00045 dat=new real[xsize*ysize];
00046 for(int i=0;i<xsize*ysize;i++)
00047 dat[i]=rm.dat[i];
00048 }
00049
00050 INLINE rmatrix::rmatrix(const int &m, const int &n)
00051 #if(CXSC_INDEX_CHECK)
00052 throw(ERROR_RMATRIX_WRONG_BOUNDARIES):lb1(1),ub1(m),lb2(1),ub2(n),xsize(n),ysize(m)
00053 #else
00054 throw():lb1(1),ub1(m),lb2(1),ub2(n),xsize(n),ysize(m)
00055 #endif
00056 {
00057 #if(CXSC_INDEX_CHECK)
00058 if((n<0)||(m<0)) cxscthrow(ERROR_RMATRIX_WRONG_BOUNDARIES("rmatrix::rmatrix(const int &m, const int &n)"));
00059 #endif
00060 dat=new real[m*n];
00061 }
00062
00063 INLINE rmatrix::rmatrix(const int &m1, const int &m2, const int &n1, const int &n2)
00064 #if(CXSC_INDEX_CHECK)
00065 throw(ERROR_RMATRIX_WRONG_BOUNDARIES):lb1(m1),ub1(m2),lb2(n1),ub2(n2),xsize(n2-n1+1),ysize(m2-m1+1)
00066 #else
00067 throw():lb1(m1),ub1(m2),lb2(n1),ub2(n2),xsize(n2-n1+1),ysize(m2-m1+1)
00068 #endif
00069 {
00070 #if(CXSC_INDEX_CHECK)
00071 if((m2<m1)||(n2<n1)) cxscthrow(ERROR_RMATRIX_WRONG_BOUNDARIES("rmatrix::rmatrix(const int &m1, const int &n1, const int &m2, const int &n2)"));
00072 #endif
00073 dat=new real[xsize*ysize];
00074 }
00075
00076 INLINE rvector::rvector(const rmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size)
00077 {
00078 dat=new real[size];
00079 for (int i=0, j=v.start;i<v.size;i++,j+=v.offset)
00080 dat[i]=v.dat[j];
00081 }
00082
00083 INLINE rmatrix::rmatrix(const rvector &v) throw():lb1(v.l),ub1(v.u),lb2(1),ub2(1),xsize(1),ysize(v.size)
00084 {
00085 dat=new real[v.size];
00086 for(int i=0;i<v.size;i++)
00087 dat[i]=v.dat[i];
00088 }
00089
00090 INLINE rmatrix::rmatrix(const rvector_slice &v) throw():lb1(v.start),ub1(v.end),lb2(1),ub2(1),xsize(1),ysize(v.size)
00091 {
00092 dat=new real[v.size];
00093 for(int i=0,j=v.start-v.l;i<v.size;i++,j++)
00094 dat[i]=v.dat[j];
00095 }
00096
00097
00098 INLINE rmatrix::rmatrix(const rmatrix_slice &sl) throw():lb1(sl.start1),ub1(sl.end1),lb2(sl.start2),ub2(sl.end2),xsize(sl.sxsize),ysize(sl.sysize)
00099 {
00100 int i,j;
00101
00102 dat=new real[xsize*ysize];
00103 for (i=0;i<ysize;i++)
00104 {
00105 for(j=0;j<xsize;j++)
00106 {
00107 dat[i*xsize+j]=sl.dat[(sl.offset1+i)*sl.mxsize+sl.offset2+j];
00108 }
00109 }
00110 }
00111
00112 INLINE rmatrix::rmatrix(const intmatrix& I) : lb1(Lb(I,1)),ub1(Ub(I,1)),lb2(Lb(I,2)),ub2(Ub(I,2)),xsize(RowLen(I)),ysize(ColLen(I)) {
00113 dat=new real[xsize*ysize];
00114 for(int i=0 ; i<ysize ; i++)
00115 for(int j=0 ; j<xsize ; j++)
00116 dat[i*xsize+j] = I[i+lb1][j+lb2];
00117 }
00118
00119 INLINE rmatrix_subv Row(rmatrix &m,const int &i)
00120 #if(CXSC_INDEX_CHECK)
00121 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
00122 #else
00123 throw()
00124 #endif
00125
00126 {
00127 return m[i];
00128 }
00129
00130 INLINE rmatrix_subv Col(rmatrix &m,const int &i)
00131 #if(CXSC_INDEX_CHECK)
00132 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
00133 #else
00134 throw()
00135 #endif
00136
00137 {
00138 return m[Col(i)];
00139 }
00140 INLINE rmatrix_subv Row(const rmatrix &m,const int &i)
00141 #if(CXSC_INDEX_CHECK)
00142 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
00143 #else
00144 throw()
00145 #endif
00146
00147 {
00148 return m[i];
00149 }
00150
00151 INLINE rmatrix_subv Col(const rmatrix &m,const int &i)
00152 #if(CXSC_INDEX_CHECK)
00153 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
00154 #else
00155 throw()
00156 #endif
00157
00158 {
00159 return m[Col(i)];
00160 }
00161
00162 INLINE real& rmatrix_subv::operator [](const int &i) const
00163 #if(CXSC_INDEX_CHECK)
00164 throw(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC)
00165 #else
00166 throw()
00167 #endif
00168 {
00169 #if(CXSC_INDEX_CHECK)
00170 if((i<lb)||(i>ub)) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC("real &rmatrix_subv::operator [](const int &i) const"));
00171 #endif
00172 return dat[start+((i-lb)*offset)];
00173 }
00174
00175 INLINE real& rmatrix_subv::operator [](const int &i)
00176 #if(CXSC_INDEX_CHECK)
00177 throw(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC)
00178 #else
00179 throw()
00180 #endif
00181 {
00182 #if(CXSC_INDEX_CHECK)
00183 if((i<lb)||(i>ub)) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC("real &rmatrix_subv::operator [](const int &i)"));
00184 #endif
00185 return dat[start+((i-lb)*offset)];
00186 }
00187
00188
00189
00190 INLINE rmatrix_subv rmatrix::operator [](const int &i) const
00191 #if(CXSC_INDEX_CHECK)
00192 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
00193 #else
00194 throw()
00195 #endif
00196 {
00197 #if(CXSC_INDEX_CHECK)
00198 if((i<lb1)||(i>ub1)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT("rmatrix_subv rmatrix::operator [](const int &i)"));
00199 #endif
00200 return rmatrix_subv(dat, lb2, ub2, xsize, xsize*(i-lb1),1);
00201 }
00202
00203 INLINE rmatrix_subv rmatrix::operator [](const cxscmatrix_column &i) const
00204 #if(CXSC_INDEX_CHECK)
00205 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
00206 #else
00207 throw()
00208 #endif
00209 {
00210 #if(CXSC_INDEX_CHECK)
00211 if((i.col()<lb2)||(i.col()>ub2)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT("rmatrix_subv rmatrix::operator [](const cxscmatrix_column &i)"));
00212 #endif
00213 return rmatrix_subv(dat, lb1, ub1, ysize, i.col()-lb2, xsize);
00214 }
00215
00216 INLINE rmatrix_slice rmatrix::operator ()(const int &m, const int &n)
00217 #if(CXSC_INDEX_CHECK)
00218 throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
00219 #else
00220 throw()
00221 #endif
00222 {
00223 #if(CXSC_INDEX_CHECK)
00224 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)"));
00225 #endif
00226 return rmatrix_slice(*this,1,m,1,n);
00227 }
00228
00229 INLINE rmatrix_slice rmatrix::operator ()(const int &m1, const int &m2, const int &n1, const int &n2)
00230 #if(CXSC_INDEX_CHECK)
00231 throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
00232 #else
00233 throw()
00234 #endif
00235 {
00236 #if(CXSC_INDEX_CHECK)
00237 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)"));
00238 #endif
00239 return rmatrix_slice(*this,m1,m2,n1,n2);
00240 }
00241
00242 INLINE rmatrix_subv rmatrix_slice::operator [](const int &i) const
00243 #if(CXSC_INDEX_CHECK)
00244 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
00245 #else
00246 throw()
00247 #endif
00248 {
00249 #if(CXSC_INDEX_CHECK)
00250 if((i<start1)||(i>end1)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT("rmatrix_subv rmatrix_slice::operator [](const int &i)"));
00251 #endif
00252 return rmatrix_subv(dat, start2, end2, sxsize, mxsize*(i-start1+offset1)+offset2,1);
00253 }
00254
00255 INLINE rmatrix_subv rmatrix_slice::operator [](const cxscmatrix_column &i) const
00256 #if(CXSC_INDEX_CHECK)
00257 throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
00258 #else
00259 throw()
00260 #endif
00261 {
00262 #if(CXSC_INDEX_CHECK)
00263 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)"));
00264 #endif
00265 return rmatrix_subv(dat, start1, end1, sysize, offset1*mxsize+i.col()-start2+offset2, mxsize);
00266 }
00267
00268 INLINE rmatrix_slice rmatrix_slice::operator ()(const int &m, const int &n)
00269 #if(CXSC_INDEX_CHECK)
00270 throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
00271 #else
00272 throw()
00273 #endif
00274 {
00275 #if(CXSC_INDEX_CHECK)
00276 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)"));
00277 #endif
00278 return rmatrix_slice(*this,1,m,1,n);
00279 }
00280
00281 INLINE rmatrix_slice rmatrix_slice::operator ()(const int &m1, const int &m2, const int &n1, const int &n2)
00282 #if(CXSC_INDEX_CHECK)
00283 throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
00284 #else
00285 throw()
00286 #endif
00287 {
00288 #if(CXSC_INDEX_CHECK)
00289 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)"));
00290 #endif
00291 return rmatrix_slice(*this,m1,m2,n1,n2);
00292 }
00293
00294 INLINE rmatrix_subv rmatrix_subv::operator ()(const int &i)
00295 #if(CXSC_INDEX_CHECK)
00296 throw(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG)
00297 #else
00298 throw()
00299 #endif
00300 {
00301 #if(CXSC_INDEX_CHECK)
00302 if(1<lb||i>ub) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG("rmatrix_subv rmatrix_subv::operator ()(const int &i)"));
00303 #endif
00304 return rmatrix_subv(dat,1,i,i,start+(1-lb)*offset,offset);
00305 }
00306
00307 INLINE rmatrix_subv rmatrix_subv::operator ()(const int &i1,const int &i2)
00308 #if(CXSC_INDEX_CHECK)
00309 throw(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG)
00310 #else
00311 throw()
00312 #endif
00313 {
00314 #if(CXSC_INDEX_CHECK)
00315 if(i1<lb||i2>ub) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG("rmatrix_subv rmatrix_subv::operator ()(const int &i1,const int &i2)"));
00316 #endif
00317 return rmatrix_subv(dat,i1,i2,i2-i1+1,start+(i1-lb)*offset,offset);
00318 }
00319
00320
00321
00322 INLINE rmatrix_subv &rmatrix_subv::operator =(const rmatrix_subv &rv) throw() { return _mvmvassign(*this,rv); }
00323 INLINE rmatrix_subv &rmatrix_subv::operator =(const real &r) throw() { return _mvsassign(*this,r); }
00324 INLINE rmatrix_subv &rmatrix_subv::operator =(const rvector &v)
00325 #if(CXSC_INDEX_CHECK)
00326 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00327 #else
00328 throw()
00329 #endif
00330 { return _mvvassign(*this,v); }
00331 INLINE rmatrix_subv &rmatrix_subv::operator =(const rvector_slice &v)
00332 #if(CXSC_INDEX_CHECK)
00333 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00334 #else
00335 throw()
00336 #endif
00337 { return _mvvassign(*this,rvector(v)); }
00338 INLINE rmatrix &rmatrix::operator =(const real &r) throw() { return _msassign(*this,r); }
00339 INLINE rmatrix &rmatrix::operator =(const rmatrix &m) throw() { return _mmassign<rmatrix,rmatrix,real>(*this,m,0); }
00340 INLINE rmatrix &rmatrix::operator =(const rvector &v) throw() { return _mvassign<rmatrix,rvector,real>(*this,v); }
00341 INLINE rmatrix &rmatrix::operator =(const rvector_slice &v) throw() { return _mvassign<rmatrix,rvector,real>(*this,rvector(v)); }
00342 INLINE rmatrix::operator void*() throw() { return _mvoid(*this); }
00343 INLINE rmatrix_slice &rmatrix_slice::operator =(const rmatrix &m)
00344 #if(CXSC_INDEX_CHECK)
00345 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00346 #else
00347 throw()
00348 #endif
00349 { return _msmassign(*this,m); }
00350 INLINE rmatrix_slice &rmatrix_slice::operator =(const rmatrix_slice &ms)
00351 #if(CXSC_INDEX_CHECK)
00352 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00353 #else
00354 throw()
00355 #endif
00356 { return _msmsassign(*this,ms); }
00357 INLINE rmatrix_slice &rmatrix_slice::operator =(const real &r) throw() { return _mssassign(*this,r); }
00358 INLINE rmatrix_slice &rmatrix_slice::operator =(const rvector &v)
00359 #if(CXSC_INDEX_CHECK)
00360 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00361 #else
00362 throw()
00363 #endif
00364 { return _msmassign(*this,rmatrix(v)); }
00365 INLINE rmatrix_slice &rmatrix_slice::operator =(const rvector_slice &v)
00366 #if(CXSC_INDEX_CHECK)
00367 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00368 #else
00369 throw()
00370 #endif
00371 { return _msmassign(*this,rmatrix(rvector(v))); }
00372 INLINE rmatrix_slice &rmatrix_slice::operator =(const rmatrix_subv &v)
00373 #if(CXSC_INDEX_CHECK)
00374 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00375 #else
00376 throw()
00377 #endif
00378 { return _msmassign(*this,rmatrix(rvector(v))); }
00379 INLINE rmatrix_slice &rmatrix_slice::operator +=(const rmatrix &m1)
00380 #if(CXSC_INDEX_CHECK)
00381 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00382 #else
00383 throw()
00384 #endif
00385 { return _msmplusassign(*this,m1); }
00386 INLINE rmatrix_slice &rmatrix_slice::operator +=(const rmatrix_slice &ms2)
00387 #if(CXSC_INDEX_CHECK)
00388 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00389 #else
00390 throw()
00391 #endif
00392 { return _msmsplusassign(*this,ms2); }
00393 INLINE rmatrix_slice &rmatrix_slice::operator -=(const rmatrix &m1)
00394 #if(CXSC_INDEX_CHECK)
00395 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00396 #else
00397 throw()
00398 #endif
00399 { return _msmminusassign(*this,m1); }
00400 INLINE rmatrix_slice &rmatrix_slice::operator -=(const rmatrix_slice &ms2)
00401 #if(CXSC_INDEX_CHECK)
00402 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00403 #else
00404 throw()
00405 #endif
00406 { return _msmsminusassign(*this,ms2); }
00407 INLINE rmatrix_slice &rmatrix_slice::operator *=(const rmatrix &m)
00408 #if(CXSC_INDEX_CHECK)
00409 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00410 #else
00411 throw()
00412 #endif
00413 { return (*this=*this*m); }
00414 INLINE rmatrix_slice &rmatrix_slice::operator *=(const rmatrix_slice &m)
00415 #if(CXSC_INDEX_CHECK)
00416 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00417 #else
00418 throw()
00419 #endif
00420 { return (*this=*this*m); }
00421 INLINE rmatrix_slice &rmatrix_slice::operator *=(const real &c) throw() { return _mssmultassign(*this,c); }
00422 INLINE rmatrix_slice &rmatrix_slice::operator /=(const real &c) throw() { return _mssdivassign(*this,c); }
00423 INLINE rmatrix_slice::operator void*() throw() { return _msvoid(*this); }
00424 INLINE rvector operator /(const rmatrix_subv &rv, const real &s) throw() { return _mvsdiv<rmatrix_subv,real,rvector>(rv,s); }
00425 INLINE rvector operator *(const rmatrix_subv &rv, const real &s) throw() { return _mvsmult<rmatrix_subv,real,rvector>(rv,s); }
00426 INLINE rvector operator *(const real &s, const rmatrix_subv &rv) throw() { return _mvsmult<rmatrix_subv,real,rvector>(rv,s); }
00427 INLINE rmatrix_subv &rmatrix_subv::operator *=(const real &c) throw() { return _mvsmultassign(*this,c); }
00428 INLINE rmatrix_subv &rmatrix_subv::operator +=(const real &c) throw() { return _mvsplusassign(*this,c); }
00429 INLINE rmatrix_subv &rmatrix_subv::operator -=(const real &c) throw() { return _mvsminusassign(*this,c); }
00430 INLINE rmatrix_subv &rmatrix_subv::operator /=(const real &c) throw() { return _mvsdivassign(*this,c); }
00431 INLINE rvector abs(const rmatrix_subv &mv) throw() { return _mvabs<rmatrix_subv,rvector>(mv); }
00432 INLINE rvector &rvector::operator =(const rmatrix_subv &mv) throw() { return _vmvassign<rvector,rmatrix_subv,real>(*this,mv); }
00433 INLINE rvector_slice &rvector_slice::operator =(const rmatrix_subv &mv) throw() { return _vsvassign(*this,rvector(mv)); }
00434
00435
00436 INLINE real operator *(const rmatrix_subv & rv1, const rmatrix_subv &rv2)
00437 #if(CXSC_INDEX_CHECK)
00438 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00439 #else
00440 throw()
00441 #endif
00442 { return _mvmvmult<rmatrix_subv,rmatrix_subv,real>(rv1,rv2); }
00443 INLINE real operator *(const rvector & rv1, const rmatrix_subv &rv2)
00444 #if(CXSC_INDEX_CHECK)
00445 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00446 #else
00447 throw()
00448 #endif
00449 { return _vmvmult<rvector,rmatrix_subv,real>(rv1,rv2); }
00450 INLINE real operator *(const rmatrix_subv &rv1,const rvector &rv2)
00451 #if(CXSC_INDEX_CHECK)
00452 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00453 #else
00454 throw()
00455 #endif
00456 { return _vmvmult<rvector,rmatrix_subv,real>(rv2,rv1); }
00457 INLINE real operator *(const rvector_slice &sl,const rmatrix_subv &sv)
00458 #if(CXSC_INDEX_CHECK)
00459 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00460 #else
00461 throw()
00462 #endif
00463 { return _vmvmult<rvector,rmatrix_subv,real>(rvector(sl),sv); }
00464 INLINE real operator *(const rmatrix_subv &mv,const rvector_slice &vs)
00465 #if(CXSC_INDEX_CHECK)
00466 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00467 #else
00468 throw()
00469 #endif
00470 { return _vmvmult<rvector,rmatrix_subv,real>(rvector(vs),mv); }
00471 INLINE rvector operator +(const rmatrix_subv & rv1, const rmatrix_subv &rv2)
00472 #if(CXSC_INDEX_CHECK)
00473 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00474 #else
00475 throw()
00476 #endif
00477 { return _mvmvplus<rmatrix_subv,rmatrix_subv,rvector>(rv1,rv2); }
00478 INLINE rvector operator +(const rmatrix_subv &rv1,const rvector &rv2)
00479 #if(CXSC_INDEX_CHECK)
00480 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00481 #else
00482 throw()
00483 #endif
00484 { return _mvvplus<rmatrix_subv,rvector,rvector>(rv1,rv2); }
00485 INLINE rvector operator +(const rvector & rv1, const rmatrix_subv &rv2)
00486 #if(CXSC_INDEX_CHECK)
00487 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00488 #else
00489 throw()
00490 #endif
00491 { return _mvvplus<rmatrix_subv,rvector,rvector>(rv2,rv1); }
00492 INLINE rvector operator +(const rvector_slice &sl,const rmatrix_subv &mv)
00493 #if(CXSC_INDEX_CHECK)
00494 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00495 #else
00496 throw()
00497 #endif
00498 { return _mvvplus<rmatrix_subv,rvector,rvector>(mv,rvector(sl)); }
00499 INLINE rvector operator +(const rmatrix_subv &mv,const rvector_slice &sl)
00500 #if(CXSC_INDEX_CHECK)
00501 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00502 #else
00503 throw()
00504 #endif
00505 { return _mvvplus<rmatrix_subv,rvector,rvector>(mv,rvector(sl)); }
00506 INLINE rmatrix_subv &rmatrix_subv::operator +=(const rvector &rv)
00507 #if(CXSC_INDEX_CHECK)
00508 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00509 #else
00510 throw()
00511 #endif
00512 { return _mvvplusassign(*this,rv); }
00513 INLINE rmatrix_subv &rmatrix_subv::operator +=(const rvector_slice &rv)
00514 #if(CXSC_INDEX_CHECK)
00515 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00516 #else
00517 throw()
00518 #endif
00519 { return _mvvplusassign(*this,rvector(rv)); }
00520 INLINE rvector operator -(const rmatrix_subv & rv1, const rmatrix_subv &rv2)
00521 #if(CXSC_INDEX_CHECK)
00522 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00523 #else
00524 throw()
00525 #endif
00526 { return _mvmvminus<rmatrix_subv,rmatrix_subv,rvector>(rv1,rv2); }
00527 INLINE rvector operator -(const rvector & rv1, const rmatrix_subv &rv2)
00528 #if(CXSC_INDEX_CHECK)
00529 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00530 #else
00531 throw()
00532 #endif
00533 { return _vmvminus<rvector,rmatrix_subv,rvector>(rv1,rv2); }
00534 INLINE rvector operator -(const rmatrix_subv &rv1,const rvector &rv2)
00535 #if(CXSC_INDEX_CHECK)
00536 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00537 #else
00538 throw()
00539 #endif
00540 { return _mvvminus<rmatrix_subv,rvector,rvector>(rv1,rv2); }
00541 INLINE rvector operator -(const rvector_slice &sl,const rmatrix_subv &mv)
00542 #if(CXSC_INDEX_CHECK)
00543 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00544 #else
00545 throw()
00546 #endif
00547 { return _vmvminus<rvector,rmatrix_subv,rvector>(rvector(sl),mv); }
00548 INLINE rvector operator -(const rmatrix_subv &mv,const rvector_slice &sl)
00549 #if(CXSC_INDEX_CHECK)
00550 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00551 #else
00552 throw()
00553 #endif
00554 { return _mvvminus<rmatrix_subv,rvector,rvector>(mv,rvector(sl)); }
00555 INLINE rmatrix_subv &rmatrix_subv::operator -=(const rvector &rv)
00556 #if(CXSC_INDEX_CHECK)
00557 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00558 #else
00559 throw()
00560 #endif
00561 { return _mvvminusassign(*this,rv); }
00562 INLINE rmatrix_subv &rmatrix_subv::operator -=(const rvector_slice &rv)
00563 #if(CXSC_INDEX_CHECK)
00564 throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
00565 #else
00566 throw()
00567 #endif
00568 { return _mvvminusassign(*this,rvector(rv)); }
00574 INLINE rmatrix _rmatrix(const rmatrix &rm) throw() { return rm; }
00580 INLINE rmatrix _rmatrix(const rvector &v) throw() { return rmatrix(v); }
00586 INLINE rmatrix _rmatrix(const rvector_slice &v) throw() { return rmatrix(v); }
00592 INLINE rmatrix _rmatrix(const real &r) throw() { return rmatrix(r); }
00593 INLINE rmatrix &rmatrix::operator =(const rmatrix_slice &ms) throw() { return _mmsassign<rmatrix,rmatrix_slice,real>(*this,ms); }
00594 INLINE int Lb(const rmatrix &rm, const int &i)
00595 #if(CXSC_INDEX_CHECK)
00596 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
00597 #else
00598 throw()
00599 #endif
00600 { return _mlb(rm,i); }
00601 INLINE int Ub(const rmatrix &rm, const int &i)
00602 #if(CXSC_INDEX_CHECK)
00603 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
00604 #else
00605 throw()
00606 #endif
00607 { return _mub(rm,i); }
00608 INLINE int Lb(const rmatrix_slice &rm, const int &i)
00609 #if(CXSC_INDEX_CHECK)
00610 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
00611 #else
00612 throw()
00613 #endif
00614 { return _mslb(rm,i); }
00615 INLINE int Ub(const rmatrix_slice &rm, const int &i)
00616 #if(CXSC_INDEX_CHECK)
00617 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
00618 #else
00619 throw()
00620 #endif
00621 { return _msub(rm,i); }
00622 INLINE rmatrix &SetLb(rmatrix &m, const int &i,const int &j)
00623 #if(CXSC_INDEX_CHECK)
00624 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
00625 #else
00626 throw()
00627 #endif
00628 { return _msetlb(m,i,j); }
00629 INLINE rmatrix &SetUb(rmatrix &m, const int &i,const int &j)
00630 #if(CXSC_INDEX_CHECK)
00631 throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
00632 #else
00633 throw()
00634 #endif
00635 { return _msetub(m,i,j); }
00636
00637
00638 INLINE int RowLen ( const rmatrix& A )
00639 { return Ub(A,2)-Lb(A,2)+1; }
00640
00641 INLINE int ColLen ( const rmatrix& A )
00642 { return Ub(A,1)-Lb(A,1)+1; }
00643
00644 INLINE int RowLen ( const rmatrix_slice& A )
00645 { return Ub(A,2)-Lb(A,2)+1; }
00646
00647 INLINE int ColLen ( const rmatrix_slice& A )
00648 { return Ub(A,1)-Lb(A,1)+1; }
00649
00650 INLINE void Resize(rmatrix &A) throw() { _mresize(A); }
00651 INLINE void Resize(rmatrix &A,const int &m, const int &n)
00652 #if(CXSC_INDEX_CHECK)
00653 throw(ERROR_RMATRIX_WRONG_BOUNDARIES)
00654 #else
00655 throw()
00656 #endif
00657 { _mresize<rmatrix,real>(A,m,n); }
00658 INLINE void Resize(rmatrix &A,const int &m1, const int &m2,const int &n1,const int &n2)
00659 #if(CXSC_INDEX_CHECK)
00660 throw(ERROR_RMATRIX_WRONG_BOUNDARIES)
00661 #else
00662 throw()
00663 #endif
00664 { _mresize<rmatrix,real>(A,m1,m2,n1,n2); }
00665 INLINE rmatrix abs(const rmatrix &m) throw() { return _mabs<rmatrix,rmatrix>(m); }
00666 INLINE rmatrix abs(const rmatrix_slice &ms) throw() { return _msabs<rmatrix_slice,rmatrix>(ms); }
00667 INLINE real::real(const rmatrix &m)
00668 #if(CXSC_INDEX_CHECK)
00669 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_RMATRIX_USE_OF_UNINITIALIZED_OBJ)
00670 #else
00671 throw()
00672 #endif
00673 { _smconstr(*this,m); }
00674
00675 INLINE rmatrix operator *(const real &c, const rmatrix &m) throw() { return _smmult<real,rmatrix,rmatrix>(c,m); }
00676 INLINE rmatrix operator *(const real &c, const rmatrix_slice &ms) throw() { return _smsmult<real,rmatrix_slice,rmatrix>(c,ms); }
00677 INLINE rmatrix operator *(const rmatrix &m,const real &c) throw() { return _smmult<real,rmatrix,rmatrix>(c,m); }
00678 INLINE rmatrix operator *(const rmatrix_slice &ms,const real &c) throw() { return _smsmult<real,rmatrix_slice,rmatrix>(c,ms); }
00679 INLINE rmatrix &operator *=(rmatrix &m,const real &c) throw() { return _msmultassign(m,c); }
00680 INLINE rmatrix operator /(const rmatrix &m,const real &c) throw() { return _msdiv<rmatrix,real,rmatrix>(m,c); }
00681 INLINE rmatrix operator /(const rmatrix_slice &ms, const real &c) throw() { return _mssdiv<rmatrix_slice,real,rmatrix>(ms,c); }
00682 INLINE rmatrix &operator /=(rmatrix &m,const real &c) throw() { return _msdivassign(m,c); }
00683 INLINE rvector::rvector(const rmatrix &sl)
00684 #if(CXSC_INDEX_CHECK)
00685 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00686 #else
00687 throw()
00688 #endif
00689 { _vmconstr<rvector,rmatrix,real>(*this,sl); }
00690 INLINE rvector::rvector(const rmatrix_slice &sl)
00691 #if(CXSC_INDEX_CHECK)
00692 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00693 #else
00694 throw()
00695 #endif
00696 { _vmsconstr<rvector,rmatrix_slice,real>(*this,sl); }
00697 INLINE rvector &rvector::operator =(const rmatrix &m)
00698 #if(CXSC_INDEX_CHECK)
00699 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00700 #else
00701 throw()
00702 #endif
00703 { return _vmassign<rvector,rmatrix,real>(*this,m); }
00704 INLINE rvector &rvector::operator =(const rmatrix_slice &m)
00705 #if(CXSC_INDEX_CHECK)
00706 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00707 #else
00708 throw()
00709 #endif
00710 { return _vmassign<rvector,rmatrix,real>(*this,rmatrix(m)); }
00711 INLINE rvector_slice &rvector_slice::operator =(const rmatrix &m)
00712 #if(CXSC_INDEX_CHECK)
00713 throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00714 #else
00715 throw()
00716 #endif
00717 { return _vsvassign(*this,rvector(m)); }
00718 INLINE rvector_slice & rvector_slice::operator =(const rmatrix_slice &m)
00719 #if(CXSC_INDEX_CHECK)
00720 throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00721 #else
00722 throw()
00723 #endif
00724 { return _vsvassign(*this,rvector(rmatrix(m))); }
00725 INLINE rmatrix_subv &rmatrix_subv::operator =(const rmatrix &m)
00726 #if(CXSC_INDEX_CHECK)
00727 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00728 #else
00729 throw()
00730 #endif
00731 { return _mvvassign(*this,rvector(m)); }
00732 INLINE rmatrix_subv &rmatrix_subv::operator =(const rmatrix_slice &m)
00733 #if(CXSC_INDEX_CHECK)
00734 throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00735 #else
00736 throw()
00737 #endif
00738 { return _mvvassign(*this,rvector(rmatrix(m))); }
00739 INLINE rvector operator *(const rmatrix &m,const rvector &v)
00740 #if(CXSC_INDEX_CHECK)
00741 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00742 #else
00743 throw()
00744 #endif
00745 { return _mvmult<rmatrix,rvector,rvector>(m,v); };
00746 INLINE rvector operator *(const rmatrix_slice &ms,const rvector &v)
00747 #if(CXSC_INDEX_CHECK)
00748 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00749 #else
00750 throw()
00751 #endif
00752 { return _msvmult<rmatrix_slice,rvector,rvector>(ms,v); }
00753 INLINE rvector operator *(const rvector &v,const rmatrix &m)
00754 #if(CXSC_INDEX_CHECK)
00755 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00756 #else
00757 throw()
00758 #endif
00759 { return _vmmult<rvector,rmatrix,rvector>(v,m); }
00760 INLINE rvector operator *(const rvector &v,const rmatrix_slice &ms)
00761 #if(CXSC_INDEX_CHECK)
00762 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00763 #else
00764 throw()
00765 #endif
00766 { return _vmsmult<rvector,rmatrix_slice,rvector>(v,ms); }
00767 INLINE rvector &operator *=(rvector &v,const rmatrix &m)
00768 #if(CXSC_INDEX_CHECK)
00769 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00770 #else
00771 throw()
00772 #endif
00773 { return _vmmultassign<rvector,rmatrix,real>(v,m); }
00774 INLINE rvector &operator *=(rvector &v,const rmatrix_slice &ms)
00775 #if(CXSC_INDEX_CHECK)
00776 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00777 #else
00778 throw()
00779 #endif
00780 { return _vmsmultassign<rvector,rmatrix_slice,real>(v,ms); }
00781 INLINE rvector_slice &rvector_slice::operator *=(const rmatrix &m)
00782 #if(CXSC_INDEX_CHECK)
00783 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00784 #else
00785 throw()
00786 #endif
00787 { return _vsmmultassign<rvector_slice,rmatrix,real>(*this,m); }
00788 INLINE rvector operator *(const rvector_slice &v,const rmatrix &m)
00789 #if(CXSC_INDEX_CHECK)
00790 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00791 #else
00792 throw()
00793 #endif
00794 { return _vmmult<rvector,rmatrix,rvector>(rvector(v),m); }
00795
00796 INLINE const rmatrix &operator +(const rmatrix &m) throw() { return m; }
00797 INLINE rmatrix operator +(const rmatrix_slice &m) throw() { return rmatrix(m); }
00798 INLINE rmatrix operator +(const rmatrix &m1,const rmatrix &m2)
00799 #if(CXSC_INDEX_CHECK)
00800 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00801 #else
00802 throw()
00803 #endif
00804 { return _mmplus<rmatrix,rmatrix,rmatrix>(m1,m2); }
00805 INLINE rmatrix operator +(const rmatrix &m,const rmatrix_slice &ms)
00806 #if(CXSC_INDEX_CHECK)
00807 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00808 #else
00809 throw()
00810 #endif
00811 { return _mmsplus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
00812 INLINE rmatrix operator +(const rmatrix_slice &ms,const rmatrix &m)
00813 #if(CXSC_INDEX_CHECK)
00814 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00815 #else
00816 throw()
00817 #endif
00818 { return _mmsplus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
00819 INLINE rmatrix operator +(const rmatrix_slice &m1,const rmatrix_slice &m2)
00820 #if(CXSC_INDEX_CHECK)
00821 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00822 #else
00823 throw()
00824 #endif
00825 { return _msmsplus<rmatrix_slice,rmatrix_slice,rmatrix>(m1,m2); }
00826 INLINE rmatrix &operator +=(rmatrix &m1,const rmatrix &m2)
00827 #if(CXSC_INDEX_CHECK)
00828 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00829 #else
00830 throw()
00831 #endif
00832 { return _mmplusassign(m1,m2); }
00833 INLINE rmatrix &operator +=(rmatrix &m1,const rmatrix_slice &ms)
00834 #if(CXSC_INDEX_CHECK)
00835 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00836 #else
00837 throw()
00838 #endif
00839 { return _mmsplusassign(m1,ms); }
00840 INLINE rmatrix operator -(const rmatrix &m) throw() { return _mminus(m); }
00841 INLINE rmatrix operator -(const rmatrix_slice &m) throw() { return _msminus<rmatrix_slice,rmatrix>(m); }
00842 INLINE rmatrix operator -(const rmatrix &m1,const rmatrix &m2)
00843 #if(CXSC_INDEX_CHECK)
00844 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00845 #else
00846 throw()
00847 #endif
00848 { return _mmminus<rmatrix,rmatrix,rmatrix>(m1,m2); }
00849 INLINE rmatrix operator -(const rmatrix &m,const rmatrix_slice &ms)
00850 #if(CXSC_INDEX_CHECK)
00851 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00852 #else
00853 throw()
00854 #endif
00855 { return _mmsminus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
00856 INLINE rmatrix operator -(const rmatrix_slice &ms,const rmatrix &m)
00857 #if(CXSC_INDEX_CHECK)
00858 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00859 #else
00860 throw()
00861 #endif
00862 { return _msmminus<rmatrix_slice,rmatrix,rmatrix>(ms,m); }
00863 INLINE rmatrix operator -(const rmatrix_slice &ms1,const rmatrix_slice &ms2)
00864 #if(CXSC_INDEX_CHECK)
00865 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00866 #else
00867 throw()
00868 #endif
00869 { return _msmsminus<rmatrix_slice,rmatrix_slice,rmatrix>(ms1,ms2); }
00870 INLINE rmatrix &operator -=(rmatrix &m1,const rmatrix &m2)
00871 #if(CXSC_INDEX_CHECK)
00872 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00873 #else
00874 throw()
00875 #endif
00876 { return _mmminusassign(m1,m2); }
00877 INLINE rmatrix &operator -=(rmatrix &m1,const rmatrix_slice &ms)
00878 #if(CXSC_INDEX_CHECK)
00879 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00880 #else
00881 throw()
00882 #endif
00883 { return _mmsminusassign(m1,ms); }
00884 INLINE rmatrix operator *(const rmatrix &m1, const rmatrix &m2)
00885 #if(CXSC_INDEX_CHECK)
00886 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00887 #else
00888 throw()
00889 #endif
00890 { return _mmmult<rmatrix,rmatrix,rmatrix>(m1,m2); }
00891 INLINE rmatrix operator *(const rmatrix &m1, const rmatrix_slice &ms)
00892 #if(CXSC_INDEX_CHECK)
00893 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00894 #else
00895 throw()
00896 #endif
00897 { return _mmsmult<rmatrix,rmatrix_slice,rmatrix>(m1,ms); }
00898 INLINE rmatrix operator *(const rmatrix_slice &ms, const rmatrix &m1)
00899 #if(CXSC_INDEX_CHECK)
00900 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00901 #else
00902 throw()
00903 #endif
00904 { return _msmmult<rmatrix_slice,rmatrix,rmatrix>(ms,m1); }
00905 INLINE rmatrix operator *(const rmatrix_slice &ms1, const rmatrix_slice &ms2)
00906 #if(CXSC_INDEX_CHECK)
00907 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00908 #else
00909 throw()
00910 #endif
00911 { return _msmsmult<rmatrix_slice,rmatrix_slice,rmatrix>(ms1,ms2); }
00912 INLINE rmatrix &operator *=(rmatrix &m1,const rmatrix &m2)
00913 #if(CXSC_INDEX_CHECK)
00914 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00915 #else
00916 throw()
00917 #endif
00918 { return _mmmultassign<rmatrix,rmatrix,real>(m1,m2); }
00919 INLINE rmatrix &operator *=(rmatrix &m1,const rmatrix_slice &ms)
00920 #if(CXSC_INDEX_CHECK)
00921 throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00922 #else
00923 throw()
00924 #endif
00925 { return _mmsmultassign<rmatrix,rmatrix_slice,real>(m1,ms); }
00926 INLINE bool operator ==(const rmatrix &m1,const rmatrix &m2) throw() { return _mmeq(m1,m2); }
00927 INLINE bool operator !=(const rmatrix &m1,const rmatrix &m2) throw() { return _mmneq(m1,m2); }
00928 INLINE bool operator <(const rmatrix &m1,const rmatrix &m2) throw() { return _mmless(m1,m2); }
00929 INLINE bool operator <=(const rmatrix &m1,const rmatrix &m2) throw() { return _mmleq(m1,m2); }
00930 INLINE bool operator >(const rmatrix &m1,const rmatrix &m2) throw() { return _mmless(m2,m1); }
00931 INLINE bool operator >=(const rmatrix &m1,const rmatrix &m2) throw() { return _mmleq(m2,m1); }
00932 INLINE bool operator ==(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _mmseq(m1,ms); }
00933 INLINE bool operator !=(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _mmsneq(m1,ms); }
00934 INLINE bool operator <(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _mmsless(m1,ms); }
00935 INLINE bool operator <=(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _mmsleq(m1,ms); }
00936 INLINE bool operator >(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _msmless(ms,m1); }
00937 INLINE bool operator >=(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _msmleq(ms,m1); }
00938 INLINE bool operator ==(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmseq(m1,m2); }
00939 INLINE bool operator !=(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsneq(m1,m2); }
00940 INLINE bool operator <(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsless(m1,m2); }
00941 INLINE bool operator <=(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsleq(m1,m2); }
00942 INLINE bool operator >(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsless(m2,m1); }
00943 INLINE bool operator >=(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsleq(m2,m1); }
00944 INLINE bool operator !(const rmatrix &ms) throw() { return _mnot(ms); }
00945 INLINE bool operator !(const rmatrix_slice &ms) throw() { return _msnot(ms); }
00946 INLINE std::ostream &operator <<(std::ostream &s,const rmatrix &r) throw() { return _mout(s,r); }
00947 INLINE std::ostream &operator <<(std::ostream &s,const rmatrix_slice &r) throw() { return _msout(s,r); }
00948 INLINE std::istream &operator >>(std::istream &s,rmatrix &r) throw() { return _min(s,r); }
00949 INLINE std::istream &operator >>(std::istream &s,rmatrix_slice &r) throw() { return _msin(s,r); }
00950
00952 INLINE rmatrix rmatrix::operator()(const intvector& p, const intvector& q) {
00953 rmatrix A(*this);
00954 for(int i=0 ; i<ColLen(A) ; i++)
00955 for(int j=0 ; j<RowLen(A) ; j++)
00956 A[i+Lb(A,1)][j+Lb(A,2)] = (*this)[p[i+Lb(p)]+Lb(A,1)][q[j+Lb(q)]+Lb(A,2)];
00957 return A;
00958 }
00959
00961 INLINE rmatrix rmatrix::operator()(const intvector& p) {
00962 rmatrix A(*this);
00963 for(int i=0 ; i<ColLen(A) ; i++)
00964 A[i+Lb(A,1)] = (*this)[p[i+Lb(p)]+Lb(A,1)];
00965 return A;
00966 }
00967
00969 INLINE rmatrix rmatrix::operator()(const intmatrix& P) {
00970 intvector p = permvec(P);
00971 return (*this)(p);
00972 }
00973
00975 INLINE rmatrix rmatrix::operator()(const intmatrix& P, const intmatrix& Q) {
00976 intvector p = permvec(P);
00977 intvector q = perminv(permvec(Q));
00978 return (*this)(p,q);
00979 }
00980
00982 INLINE rvector rvector::operator()(const intmatrix& P) {
00983 intvector p = permvec(P);
00984 return (*this)(p);
00985 }
00986
00987 }
00988
00989 #endif
00990