C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
00001 /* 00002 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4) 00003 ** 00004 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik, 00005 ** Universitaet Karlsruhe, Germany 00006 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie 00007 ** Universitaet Wuppertal, Germany 00008 ** 00009 ** This library is free software; you can redistribute it and/or 00010 ** modify it under the terms of the GNU Library General Public 00011 ** License as published by the Free Software Foundation; either 00012 ** version 2 of the License, or (at your option) any later version. 00013 ** 00014 ** This library is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 ** Library General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU Library General Public 00020 ** License along with this library; if not, write to the Free 00021 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 /* CVS $Id: intmatrix.hpp,v 1.20 2014/01/30 17:23:45 cxsc Exp $ */ 00025 00026 #ifndef _CXSC_INTMATRIX_HPP_INCLUDED 00027 #define _CXSC_INTMATRIX_HPP_INCLUDED 00028 00029 #include "xscclass.hpp" 00030 00031 #include "dot.hpp" 00032 #include "intvector.hpp" 00033 #include "except.hpp" 00034 #include "matrix.hpp" 00035 00036 namespace cxsc { 00037 00038 class intmatrix; 00039 class intmatrix_slice; 00040 00042 00045 class intmatrix_subv 00046 { 00047 friend class intvector; 00048 friend class intmatrix; 00049 friend class intmatrix_slice; 00050 private: 00051 int *dat; 00052 int lb,ub; 00053 int size,start,offset; // start=first element index 0..n-1 00054 00055 public: 00057 friend INLINE intmatrix_subv Row(intmatrix &m,const int &i) 00058 #if(CXSC_INDEX_CHECK) 00059 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00060 #else 00061 throw(); 00062 #endif 00063 00064 friend INLINE intmatrix_subv Col(intmatrix &m,const int &i) 00065 #if(CXSC_INDEX_CHECK) 00066 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00067 #else 00068 throw(); 00069 #endif 00070 friend INLINE intmatrix_subv Row(const intmatrix &m,const int &i) 00071 #if(CXSC_INDEX_CHECK) 00072 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00073 #else 00074 throw(); 00075 #endif 00076 00077 friend INLINE intmatrix_subv Col(const intmatrix &m,const int &i) 00078 #if(CXSC_INDEX_CHECK) 00079 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00080 #else 00081 throw(); 00082 #endif 00083 //#if(CXSC_INDEX_CHECK) 00084 #ifdef _CXSC_FRIEND_TPL 00085 //----------------- Templates --------------------------------------- 00086 template <class MV1,class MV2> friend MV1 &_mvmvassign(MV1 &v,const MV2 &rv) 00087 #if(CXSC_INDEX_CHECK) 00088 throw(ERROR__OP_WITH_WRONG_DIM<MV1>); 00089 #else 00090 throw(); 00091 #endif 00092 template <class MV,class S> friend MV &_mvsassign(MV &v,const S &r) throw(); 00093 template <class MV,class V> friend MV &_mvvassign(MV &v,const V &rv) 00094 #if(CXSC_INDEX_CHECK) 00095 throw(ERROR__OP_WITH_WRONG_DIM<MV>); 00096 #else 00097 throw(); 00098 #endif 00099 template <class V,class MV2,class S> friend V &_vmvassign(V &v,const MV2 &rv) throw(); 00100 template <class MV,class V> friend V _mvabs(const MV &mv) throw(); 00101 template <class DP,class V,class SV> friend void _vmvaccu(DP &dp, const V & rv1, const SV &rv2) 00102 #if(CXSC_INDEX_CHECK) 00103 throw(OP_WITH_WRONG_DIM); 00104 #else 00105 throw(); 00106 #endif 00107 template <class DP,class MV1,class MV2> friend void _mvmvaccu(DP &dp, const MV1 & rv1, const MV2 &rv2) 00108 #if(CXSC_INDEX_CHECK) 00109 throw(OP_WITH_WRONG_DIM); 00110 #else 00111 throw(); 00112 #endif 00113 template <class MV,class S,class E> friend E _mvsmult(const MV &rv, const S &s) throw(); 00114 template <class MV1,class MV2,class E> friend E _mvmvplus(const MV1 &rv1, const MV2 &rv2) 00115 #if(CXSC_INDEX_CHECK) 00116 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00117 #else 00118 throw(); 00119 #endif 00120 template <class MV1,class MV2,class E> friend E _mvmvminus(const MV1 &rv1, const MV2 &rv2) 00121 #if(CXSC_INDEX_CHECK) 00122 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00123 #else 00124 throw(); 00125 #endif 00126 template <class MV,class V,class E> friend E _mvvplus(const MV &rv1, const V &rv2) 00127 #if(CXSC_INDEX_CHECK) 00128 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00129 #else 00130 throw(); 00131 #endif 00132 template <class MV,class V,class E> friend E _mvvminus(const MV &rv1, const V &rv2) 00133 #if(CXSC_INDEX_CHECK) 00134 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00135 #else 00136 throw(); 00137 #endif 00138 template <class V,class MV,class E> friend E _vmvminus(const V &rv1, const MV &rv2) 00139 #if(CXSC_INDEX_CHECK) 00140 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00141 #else 00142 throw(); 00143 #endif 00144 template <class MV,class S,class E> friend E _mvsdiv(const MV &rv, const S &s) throw(); 00145 template <class MV,class S> friend MV &_mvsmultassign(MV &v,const S &r) throw(); 00146 template <class MV, class S> friend MV &_mvsplusassign(MV &v,const S &r) throw(); 00147 template <class MV,class S> friend MV &_mvsminusassign(MV &v,const S &r) throw(); 00148 template <class MV,class S> friend MV &_mvsdivassign(MV &v,const S &r) throw(); 00149 template <class MV,class V> friend MV &_mvvplusassign(MV &v,const V &rv) 00150 #if(CXSC_INDEX_CHECK) 00151 throw(ERROR__OP_WITH_WRONG_DIM<MV>); 00152 #else 00153 throw(); 00154 #endif 00155 template <class V,class MV> friend V &_vmvplusassign(V &rv,const MV &v) 00156 #if(CXSC_INDEX_CHECK) 00157 throw(ERROR__OP_WITH_WRONG_DIM<V>); 00158 #else 00159 throw(); 00160 #endif 00161 template <class MV,class V> friend MV &_mvvminusassign(MV &v,const V &rv) 00162 #if(CXSC_INDEX_CHECK) 00163 throw(ERROR__OP_WITH_WRONG_DIM<MV>); 00164 #else 00165 throw(); 00166 #endif 00167 template <class V,class MV> friend V &_vmvminusassign(V &rv,const MV &v) 00168 #if(CXSC_INDEX_CHECK) 00169 throw(ERROR__OP_WITH_WRONG_DIM<V>); 00170 #else 00171 throw(); 00172 #endif 00173 00174 #endif 00175 00176 //----------------- Konstruktoren ---------------------------------- 00177 00179 explicit INLINE intmatrix_subv (int *d, const int &l, const int &u, const int &s, const int &st, const int &o) throw():dat(d),lb(l),ub(u),size(s),start(st),offset(o) { } 00180 public: 00182 INLINE intmatrix_subv(const intmatrix_subv &v) throw():dat(v.dat),lb(v.lb),ub(v.ub),size(v.size),start(v.start),offset(v.offset) { } 00183 public: 00184 00185 //---------------------- Standardfunktionen ------------------------ 00186 00187 friend INLINE intvector::intvector(const intmatrix_subv &) throw(); 00189 INLINE intmatrix_subv &operator =(const intmatrix_subv &rv) throw(); 00191 INLINE intmatrix_subv &operator =(const int &r) throw(); 00193 INLINE intmatrix_subv &operator =(const intmatrix &m) 00194 #if(CXSC_INDEX_CHECK) 00195 throw(ERROR_INTMATRIX_TYPE_CAST_OF_THICK_OBJ); 00196 #else 00197 throw(); 00198 #endif 00199 00200 INLINE intmatrix_subv &operator =(const intmatrix_slice &m) 00201 #if(CXSC_INDEX_CHECK) 00202 throw(ERROR_INTMATRIX_TYPE_CAST_OF_THICK_OBJ); 00203 #else 00204 throw(); 00205 #endif 00206 00207 INLINE intmatrix_subv &operator =(const intvector &v) 00208 #if(CXSC_INDEX_CHECK) 00209 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00210 #else 00211 throw(); 00212 #endif 00213 00214 INLINE intmatrix_subv &operator =(const intvector_slice &v) 00215 #if(CXSC_INDEX_CHECK) 00216 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00217 #else 00218 throw(); 00219 #endif 00220 00221 friend INLINE int Lb(const intmatrix_subv &rv) throw() { return rv.lb; } 00223 friend INLINE int Ub(const intmatrix_subv &rv) throw() { return rv.ub; } 00225 INLINE int &operator [](const int &i) const 00226 #if(CXSC_INDEX_CHECK) 00227 throw(ERROR_INTVECTOR_ELEMENT_NOT_IN_VEC); 00228 #else 00229 throw(); 00230 #endif 00231 00232 INLINE intmatrix_subv &operator ()() throw() { return *this; } 00234 INLINE intmatrix_subv operator ()(const int &i) 00235 #if(CXSC_INDEX_CHECK) 00236 throw(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG); 00237 #else 00238 throw(); 00239 #endif 00240 00241 INLINE intmatrix_subv operator ()(const int &i1,const int &i2) 00242 #if(CXSC_INDEX_CHECK) 00243 throw(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG); 00244 #else 00245 throw(); 00246 #endif 00247 00249 INLINE intmatrix_subv &operator *=(const int &c) throw(); 00251 INLINE intmatrix_subv &operator +=(const int &c) throw(); 00253 INLINE intmatrix_subv &operator -=(const int &c) throw(); 00255 INLINE intmatrix_subv &operator /=(const int &c) throw(); 00257 INLINE intmatrix_subv &operator -=(const intvector &rv) 00258 #if(CXSC_INDEX_CHECK) 00259 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00260 #else 00261 throw(); 00262 #endif 00263 00264 INLINE intmatrix_subv &operator -=(const intvector_slice &rv) 00265 #if(CXSC_INDEX_CHECK) 00266 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00267 #else 00268 throw(); 00269 #endif 00270 00271 INLINE intmatrix_subv &operator +=(const intvector &rv) 00272 #if(CXSC_INDEX_CHECK) 00273 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00274 #else 00275 throw(); 00276 #endif 00277 00278 INLINE intmatrix_subv &operator +=(const intvector_slice &rv) 00279 #if(CXSC_INDEX_CHECK) 00280 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00281 #else 00282 throw(); 00283 #endif 00284 //#else 00285 //#endif 00286 00287 }; 00288 00289 00291 INLINE intmatrix_subv Row(intmatrix &m,const int &i) 00292 #if(CXSC_INDEX_CHECK) 00293 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00294 #else 00295 throw(); 00296 #endif 00297 00298 INLINE intmatrix_subv Col(intmatrix &m,const int &i) 00299 #if(CXSC_INDEX_CHECK) 00300 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00301 #else 00302 throw(); 00303 #endif 00304 00305 00306 //----------------------- Matrix ----------------------------------------------- 00307 00308 class intmatrix_slice; 00310 00313 class intmatrix 00314 { 00315 friend class intmatrix_slice; 00316 friend class intmatrix_subv; 00317 private: 00318 int *dat; 00319 int lb1,ub1,lb2,ub2,xsize,ysize; 00320 00321 public: 00322 //#if(CXSC_INDEX_CHECK) 00323 #ifdef _CXSC_FRIEND_TPL 00324 //----------------- Templates --------------------------------------- 00325 template <class S,class M> friend void _smconstr(S &s,const M &m) 00326 #if(CXSC_INDEX_CHECK) 00327 throw(ERROR__TYPE_CAST_OF_THICK_OBJ<M>,ERROR__USE_OF_UNINITIALIZED_OBJ<M>); 00328 #else 00329 throw(); 00330 #endif 00331 template <class V,class M,class S> friend void _vmconstr(V &v,const M &m) 00332 #if(CXSC_INDEX_CHECK) 00333 throw(ERROR__TYPE_CAST_OF_THICK_OBJ<M>); 00334 #else 00335 throw(); 00336 #endif 00337 template <class M1,class M2,class S> friend M1 &_mmassign(M1 &m1,const M2 &m,S ms) throw(); 00338 template <class M,class MS2,class S> friend M &_mmsassign(M &m,const MS2 &ms) throw(); 00339 template <class MS,class M> friend MS &_msmassign(MS &ms,const M &m) 00340 #if(CXSC_INDEX_CHECK) 00341 throw(ERROR__OP_WITH_WRONG_DIM<MS>); 00342 #else 00343 throw(); 00344 #endif 00345 template <class M,class S> friend M &_msassign(M &m,const S &r) throw(); 00346 template <class V,class M,class S> friend V &_vmassign(V &v,const M &m) 00347 #if(CXSC_INDEX_CHECK) 00348 throw(ERROR__TYPE_CAST_OF_THICK_OBJ<M>); 00349 #else 00350 throw(); 00351 #endif 00352 template <class M,class V,class S> friend M &_mvassign(M &m,const V &v) throw(); 00353 template <class M> friend int _mlb(const M &m, const int &i) 00354 #if(CXSC_INDEX_CHECK) 00355 throw(ERROR__WRONG_ROW_OR_COL<M>); 00356 #else 00357 throw(); 00358 #endif 00359 template <class M> friend int _mub(const M &m, const int &i) 00360 #if(CXSC_INDEX_CHECK) 00361 throw(ERROR__WRONG_ROW_OR_COL<M>); 00362 #else 00363 throw(); 00364 #endif 00365 template <class M> friend M &_msetlb(M &m, const int &i,const int &j) 00366 #if(CXSC_INDEX_CHECK) 00367 throw(ERROR__WRONG_ROW_OR_COL<M>); 00368 #else 00369 throw(); 00370 #endif 00371 template <class M> friend M &_msetub(M &m, const int &i,const int &j) 00372 #if(CXSC_INDEX_CHECK) 00373 throw(ERROR__WRONG_ROW_OR_COL<M>); 00374 #else 00375 throw(); 00376 #endif 00377 template <class M> friend void _mresize(M &A) throw(); 00378 template <class M,class S> friend void _mresize(M &A,const int &m, const int &n) 00379 #if(CXSC_INDEX_CHECK) 00380 throw(ERROR__WRONG_BOUNDARIES<M>); 00381 #else 00382 throw(); 00383 #endif 00384 template <class M,class S> friend void _mresize(M &A,const int &m1, const int &m2,const int &n1,const int &n2) 00385 #if(CXSC_INDEX_CHECK) 00386 throw(ERROR__WRONG_BOUNDARIES<M>); 00387 #else 00388 throw(); 00389 #endif 00390 template <class M,class E> friend E _mabs(const M &m) throw(); 00391 template <class MS,class E> friend E _msabs(const MS &ms) throw(); 00392 //------- matrix-matrix -------------- 00393 template <class M1,class M2,class E> friend E _mmplus(const M1 &m1,const M2 &m2) 00394 #if(CXSC_INDEX_CHECK) 00395 throw(ERROR__OP_WITH_WRONG_DIM<M1>); 00396 #else 00397 throw(); 00398 #endif 00399 template <class M,class MS,class E> friend E _mmsplus(const M &m,const MS &ms) 00400 #if(CXSC_INDEX_CHECK) 00401 throw(ERROR__OP_WITH_WRONG_DIM<M>); 00402 #else 00403 throw(); 00404 #endif 00405 template <class MS1,class MS2,class E> friend E _msmsplus(const MS1 &m1,const MS2 &m2) 00406 #if(CXSC_INDEX_CHECK) 00407 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00408 #else 00409 throw(); 00410 #endif 00411 template <class M> friend M _mminus(const M &m) throw(); 00412 template <class MS,class E> friend E _msminus(const MS &ms) throw(); 00413 template <class M1,class M2,class E> friend E _mmminus(const M1 &m1,const M2 &m2) 00414 #if(CXSC_INDEX_CHECK) 00415 throw(ERROR__OP_WITH_WRONG_DIM<M1>); 00416 #else 00417 throw(); 00418 #endif 00419 template <class M1,class M2> friend M1 &_mmplusassign(M1 &m1,const M2 &m2) 00420 #if(CXSC_INDEX_CHECK) 00421 throw(ERROR__OP_WITH_WRONG_DIM<M1>); 00422 #else 00423 throw(); 00424 #endif 00425 template <class M,class MS> friend M &_mmsplusassign(M &m1,const MS &ms) 00426 #if(CXSC_INDEX_CHECK) 00427 throw(ERROR__OP_WITH_WRONG_DIM<M>); 00428 #else 00429 throw(); 00430 #endif 00431 template <class MS,class M> friend MS &_msmplusassign(MS &ms,const M &m1) 00432 #if(CXSC_INDEX_CHECK) 00433 throw(ERROR__OP_WITH_WRONG_DIM<MS>); 00434 #else 00435 throw(); 00436 #endif 00437 template <class M,class MS,class E> friend E _mmsminus(const M &m,const MS &ms) 00438 #if(CXSC_INDEX_CHECK) 00439 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00440 #else 00441 throw(); 00442 #endif 00443 template <class MS,class M,class E> friend E _msmminus(const MS &ms,const M &m) 00444 #if(CXSC_INDEX_CHECK) 00445 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00446 #else 00447 throw(); 00448 #endif 00449 template <class MS1,class MS2,class E> friend E _msmsminus(const MS1 &ms1,const MS2 &ms2) 00450 #if(CXSC_INDEX_CHECK) 00451 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00452 #else 00453 throw(); 00454 #endif 00455 template <class M1,class M2> friend M1 &_mmminusassign(M1 &m1,const M2 &m2) 00456 #if(CXSC_INDEX_CHECK) 00457 throw(ERROR__OP_WITH_WRONG_DIM<M1>); 00458 #else 00459 throw(); 00460 #endif 00461 template <class M,class MS> friend M &_mmsminusassign(M &m1,const MS &ms) 00462 #if(CXSC_INDEX_CHECK) 00463 throw(ERROR__OP_WITH_WRONG_DIM<M>); 00464 #else 00465 throw(); 00466 #endif 00467 template <class MS,class M> friend MS &_msmminusassign(MS &ms,const M &m1) 00468 #if(CXSC_INDEX_CHECK) 00469 throw(ERROR__OP_WITH_WRONG_DIM<MS>); 00470 #else 00471 throw(); 00472 #endif 00473 //-------- matrix-scalar --------------------- 00474 template <class S,class M,class E> friend E _smmult(const S &c, const M &m) throw(); 00475 template <class M,class S> friend M &_msmultassign(M &m,const S &c) throw(); 00476 template <class S,class MS,class E> friend E _smsmult(const S &c, const MS &ms) throw(); 00477 template <class M,class S,class E> friend E _msdiv(const M &m,const S &c) throw(); 00478 template <class M,class S> friend M &_msdivassign(M &m,const S &c) throw(); 00479 template <class MS,class S,class E> friend E _mssdiv(const MS &ms, const S &c) throw(); 00480 //--------- matrix-vector -------------------- 00481 00482 template <class M> friend void *_mvoid(const M &m) throw(); 00483 template <class M> friend bool _mnot(const M &m) throw(); 00484 template <class MS> friend void *_msvoid(const MS &ms) throw(); 00485 template <class MS> friend bool _msnot(const MS &ms) throw(); 00486 template <class M1,class M2> friend bool _mmeq(const M1 &m1,const M2 &m2) throw(); 00487 template <class M1,class M2> friend bool _mmneq(const M1 &m1,const M2 &m2) throw(); 00488 template <class M1,class M2> friend bool _mmless(const M1 &m1,const M2 &m2) throw(); 00489 template <class M1,class M2> friend bool _mmleq(const M1 &m1,const M2 &m2) throw(); 00490 template <class M,class MS> friend bool _mmseq(const M &m1,const MS &ms) throw(); 00491 template <class M,class MS> friend bool _mmsneq(const M &m1,const MS &ms) throw(); 00492 template <class M,class MS> friend bool _mmsless(const M &m1,const MS &ms) throw(); 00493 template <class M,class MS> friend bool _mmsleq(const M &m1,const MS &ms) throw(); 00494 template <class MS,class M> friend bool _msmless(const MS &ms,const M &m1) throw(); 00495 template <class MS,class M> friend bool _msmleq(const MS &ms,const M &m1) throw(); 00496 template <class M> friend std::ostream &_mout(std::ostream &s,const M &r) throw(); 00497 template <class M> friend std::istream &_min(std::istream &s,M &r) throw(); 00498 00499 #endif 00500 00501 //-------------------------- Konstruktoren ---------------------------- 00502 00504 INLINE intmatrix(const intmatrix &rm) throw(); 00506 INLINE intmatrix(const intmatrix_slice &rm) throw(); 00508 INLINE intmatrix() throw(); 00510 explicit INLINE intmatrix(const int &m, const int &n) 00511 #if(CXSC_INDEX_CHECK) 00512 throw(ERROR_INTMATRIX_WRONG_BOUNDARIES); 00513 #else 00514 throw(); 00515 #endif 00516 00517 explicit INLINE intmatrix(const int &m1, const int &n1, const int &m2, const int &n2) 00518 #if(CXSC_INDEX_CHECK) 00519 throw(ERROR_INTMATRIX_WRONG_BOUNDARIES); 00520 #else 00521 throw(); 00522 #endif 00523 00524 explicit INLINE intmatrix(const intvector &v) throw(); 00526 explicit INLINE intmatrix(const intvector_slice &v) throw(); 00528 explicit INLINE intmatrix(const int &r) throw(); 00530 INLINE intmatrix &operator =(const int &r) throw(); 00532 INLINE intmatrix &operator =(const intmatrix &m) throw(); 00534 INLINE intmatrix &operator =(const intmatrix_slice &ms) throw(); 00536 INLINE intmatrix &operator =(const intvector &v) throw(); 00538 INLINE intmatrix &operator =(const intvector_slice &v) throw(); 00539 00540 //--------------------------- Destruktoren ----------------------------- 00541 00542 INLINE ~intmatrix() throw() { delete [] dat; } 00543 00544 //------------------------- Standardfunktionen ------------------------- 00545 00546 friend INLINE intvector::intvector(const intmatrix &m) 00547 #if(CXSC_INDEX_CHECK) 00548 throw(ERROR_INTMATRIX_TYPE_CAST_OF_THICK_OBJ); 00549 #else 00550 throw(); 00551 #endif 00552 00553 INLINE intmatrix_subv operator [](const int &i) const 00554 #if(CXSC_INDEX_CHECK) 00555 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00556 #else 00557 throw(); 00558 #endif 00559 00560 INLINE intmatrix_subv operator [](const cxscmatrix_column &i) const 00561 #if(CXSC_INDEX_CHECK) 00562 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00563 #else 00564 throw(); 00565 #endif 00566 00567 INLINE intmatrix &operator ()() throw() { return *this; } 00569 INLINE intmatrix_slice operator ()(const int &m, const int &n) 00570 #if(CXSC_INDEX_CHECK) 00571 throw(ERROR_INTMATRIX_SUB_ARRAY_TOO_BIG); 00572 #else 00573 throw(); 00574 #endif 00575 00576 INLINE intmatrix_slice operator ()(const int &m1, const int &m2, const int &n1, const int &n2) 00577 #if(CXSC_INDEX_CHECK) 00578 throw(ERROR_INTMATRIX_SUB_ARRAY_TOO_BIG); 00579 #else 00580 throw(); 00581 #endif 00582 INLINE operator void*() throw(); 00583 //#else 00584 //#endif 00585 }; 00586 00588 00593 class intmatrix_slice 00594 { 00595 friend class intmatrix; 00596 private: 00597 int *dat; 00598 int offset1,offset2,mxsize,mysize; 00599 int start1,end1,start2,end2,sxsize,sysize; // slice size 00600 00601 public: 00602 //#if(CXSC_INDEX_CHECK) 00603 #ifdef _CXSC_FRIEND_TPL 00604 //----------------- Templates --------------------------------------- 00605 template <class V,class MS,class S> friend void _vmsconstr(V &v,const MS &m) 00606 #if(CXSC_INDEX_CHECK) 00607 throw(ERROR__TYPE_CAST_OF_THICK_OBJ<MS>); 00608 #else 00609 throw(); 00610 #endif 00611 template <class MS,class M> friend MS &_msmassign(MS &ms,const M &m) 00612 #if(CXSC_INDEX_CHECK) 00613 throw(ERROR__OP_WITH_WRONG_DIM<MS>); 00614 #else 00615 throw(); 00616 #endif 00617 template <class MS1,class MS2> friend MS1 &_msmsassign(MS1 &ms1,const MS2 &ms) 00618 #if(CXSC_INDEX_CHECK) 00619 throw(ERROR__OP_WITH_WRONG_DIM<MS1>); 00620 #else 00621 throw(); 00622 #endif 00623 template <class M,class MS2,class S> friend M &_mmsassign(M &m,const MS2 &ms) throw(); 00624 template <class MS,class S> friend MS &_mssassign(MS &ms,const S &r) throw(); 00625 template <class MS> friend int _mslb(const MS &ms, const int &i) 00626 #if(CXSC_INDEX_CHECK) 00627 throw(ERROR__WRONG_ROW_OR_COL<MS>); 00628 #else 00629 throw(); 00630 #endif 00631 template <class MS> friend int _msub(const MS &ms, const int &i) 00632 #if(CXSC_INDEX_CHECK) 00633 throw(ERROR__WRONG_ROW_OR_COL<MS>); 00634 #else 00635 throw(); 00636 #endif 00637 template <class MS,class E> friend E _msabs(const MS &ms) throw(); 00638 //------------ matrix-matrix -------------------- 00639 template <class MS,class E> friend E _msminus(const MS &ms) throw(); 00640 template <class M,class MS,class E> friend E _mmsplus(const M &m,const MS &ms) 00641 #if(CXSC_INDEX_CHECK) 00642 throw(ERROR__OP_WITH_WRONG_DIM<M>); 00643 #else 00644 throw(); 00645 #endif 00646 template <class MS1,class MS2,class E> friend E _msmsplus(const MS1 &m1,const MS2 &m2) 00647 #if(CXSC_INDEX_CHECK) 00648 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00649 #else 00650 throw(); 00651 #endif 00652 template <class M,class MS> friend M &_mmsplusassign(M &m1,const MS &ms) 00653 #if(CXSC_INDEX_CHECK) 00654 throw(ERROR__OP_WITH_WRONG_DIM<M>); 00655 #else 00656 throw(); 00657 #endif 00658 template <class MS,class M> friend MS &_msmplusassign(MS &ms,const M &m1) 00659 #if(CXSC_INDEX_CHECK) 00660 throw(ERROR__OP_WITH_WRONG_DIM<MS>); 00661 #else 00662 throw(); 00663 #endif 00664 template <class MS1,class MS2> friend MS1 &_msmsplusassign(MS1 &ms1,const MS2 &ms2) 00665 #if(CXSC_INDEX_CHECK) 00666 throw(ERROR__OP_WITH_WRONG_DIM<MS1>); 00667 #else 00668 throw(); 00669 #endif 00670 template <class M,class MS,class E> friend E _mmsminus(const M &m,const MS &ms) 00671 #if(CXSC_INDEX_CHECK) 00672 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00673 #else 00674 throw(); 00675 #endif 00676 template <class MS,class M,class E> friend E _msmminus(const MS &ms,const M &m) 00677 #if(CXSC_INDEX_CHECK) 00678 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00679 #else 00680 throw(); 00681 #endif 00682 template <class MS1,class MS2,class E> friend E _msmsminus(const MS1 &ms1,const MS2 &ms2) 00683 #if(CXSC_INDEX_CHECK) 00684 throw(ERROR__OP_WITH_WRONG_DIM<E>); 00685 #else 00686 throw(); 00687 #endif 00688 template <class M,class MS> friend M &_mmsminusassign(M &m1,const MS &ms) 00689 #if(CXSC_INDEX_CHECK) 00690 throw(ERROR__OP_WITH_WRONG_DIM<M>); 00691 #else 00692 throw(); 00693 #endif 00694 template <class MS,class M> friend MS &_msmminusassign(MS &ms,const M &m1) 00695 #if(CXSC_INDEX_CHECK) 00696 throw(ERROR__OP_WITH_WRONG_DIM<MS>); 00697 #else 00698 throw(); 00699 #endif 00700 template <class MS1,class MS2> friend MS1 &_msmsminusassign(MS1 &ms1,const MS2 &ms2) 00701 #if(CXSC_INDEX_CHECK) 00702 throw(ERROR__OP_WITH_WRONG_DIM<MS1>); 00703 #else 00704 throw(); 00705 #endif 00706 //--------- matrix-scalar ----------------- 00707 template <class S,class MS,class E> friend E _smsmult(const S &c, const MS &ms) throw(); 00708 template <class MS,class S> friend MS &_mssmultassign(MS &ms,const S &c) throw(); 00709 template <class MS,class S,class E> friend E _mssdiv(const MS &ms, const S &c) throw(); 00710 template <class MS,class S> friend MS &_mssdivassign(MS &ms,const S &c) throw(); 00711 00712 template <class MS> friend void *_msvoid(const MS &ms) throw(); 00713 template <class MS> friend bool _msnot(const MS &ms) throw(); 00714 template <class M,class MS> friend bool _mmseq(const M &m1,const MS &ms) throw(); 00715 template <class M,class MS> friend bool _mmsneq(const M &m1,const MS &ms) throw(); 00716 template <class M,class MS> friend bool _mmsless(const M &m1,const MS &ms) throw(); 00717 template <class M,class MS> friend bool _mmsleq(const M &m1,const MS &ms) throw(); 00718 template <class MS,class M> friend bool _msmless(const MS &ms,const M &m1) throw(); 00719 template <class MS,class M> friend bool _msmleq(const MS &ms,const M &m1) throw(); 00720 template <class MS1,class MS2> friend bool _msmseq(const MS1 &ms1,const MS2 &ms2) throw(); 00721 template <class MS1,class MS2> friend bool _msmsneq(const MS1 &ms1,const MS2 &ms2) throw(); 00722 template <class MS1,class MS2> friend bool _msmsless(const MS1 &ms1,const MS2 &ms2) throw(); 00723 template <class MS1,class MS2> friend bool _msmsleq(const MS1 &ms1,const MS2 &ms2) throw(); 00724 template <class MS> friend std::ostream &_msout(std::ostream &s,const MS &r) throw(); 00725 template <class MS> friend std::istream &_msin(std::istream &s,MS &r) throw(); 00726 00727 #endif 00728 00729 00730 //--------------- Konstruktoren ---------------------------------------- 00731 00733 explicit INLINE intmatrix_slice(intmatrix &a,const int &l1,const int &u1,const int &l2, const int &u2) throw():dat(a.dat),offset1(l1-a.lb1),offset2(l2-a.lb2),mxsize(a.xsize),mysize(a.ysize),start1(l1),end1(u1),start2(l2),end2(u2),sxsize(u2-l2+1),sysize(u1-l1+1) { } 00735 explicit INLINE intmatrix_slice(intmatrix_slice &a,const int &l1,const int &u1,const int &l2, const int &u2) throw():dat(a.dat),offset1(a.offset1+l1-a.start1),offset2(a.offset2+l2-a.start2),mxsize(a.mxsize),mysize(a.mysize),start1(l1),end1(u1),start2(l2),end2(u2),sxsize(u2-l2+1),sysize(u1-l1+1) { } 00736 public: 00738 INLINE intmatrix_slice(const intmatrix_slice &ms) throw():dat(ms.dat),offset1(ms.offset1),offset2(ms.offset2),mxsize(ms.mxsize),mysize(ms.mysize),start1(ms.start1),end1(ms.end1),start2(ms.start2),end2(ms.end2),sxsize(ms.sxsize),sysize(ms.sysize) { } 00739 public: 00740 00741 //---------------- Standardfunktionen ----------------------------------- 00742 00743 friend intvector::intvector(const intmatrix_slice &sl) 00744 #if(CXSC_INDEX_CHECK) 00745 throw(ERROR_INTMATRIX_TYPE_CAST_OF_THICK_OBJ); 00746 #else 00747 throw(); 00748 #endif 00749 friend INLINE intmatrix::intmatrix(const intmatrix_slice &) throw(); 00751 INLINE intmatrix_slice &operator =(const intmatrix &m) 00752 #if(CXSC_INDEX_CHECK) 00753 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00754 #else 00755 throw(); 00756 #endif 00757 00758 INLINE intmatrix_slice &operator =(const intmatrix_slice &ms) 00759 #if(CXSC_INDEX_CHECK) 00760 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00761 #else 00762 throw(); 00763 #endif 00764 00765 INLINE intmatrix_slice &operator =(const int &r) throw(); 00767 INLINE intmatrix_slice &operator =(const intvector &v) 00768 #if(CXSC_INDEX_CHECK) 00769 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00770 #else 00771 throw(); 00772 #endif 00773 00774 INLINE intmatrix_slice &operator =(const intvector_slice &v) 00775 #if(CXSC_INDEX_CHECK) 00776 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00777 #else 00778 throw(); 00779 #endif 00780 00781 INLINE intmatrix_slice &operator =(const intmatrix_subv &v) 00782 #if(CXSC_INDEX_CHECK) 00783 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00784 #else 00785 throw(); 00786 #endif 00787 00788 INLINE intmatrix_subv operator [](const int &i) 00789 #if(CXSC_INDEX_CHECK) 00790 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00791 #else 00792 throw(); 00793 #endif 00794 00795 INLINE intmatrix_subv operator [](const cxscmatrix_column &i) 00796 #if(CXSC_INDEX_CHECK) 00797 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT); 00798 #else 00799 throw(); 00800 #endif 00801 00802 INLINE intmatrix_slice &operator ()() throw() { return *this; } 00804 INLINE intmatrix_slice operator ()(const int &m, const int &n) 00805 #if(CXSC_INDEX_CHECK) 00806 throw(ERROR_INTMATRIX_SUB_ARRAY_TOO_BIG); 00807 #else 00808 throw(); 00809 #endif 00810 00811 INLINE intmatrix_slice operator ()(const int &m1, const int &m2, const int &n1, const int &n2) 00812 #if(CXSC_INDEX_CHECK) 00813 throw(ERROR_INTMATRIX_SUB_ARRAY_TOO_BIG); 00814 #else 00815 throw(); 00816 #endif 00817 00818 INLINE intmatrix_slice& operator +=(const intmatrix &m1) 00819 #if(CXSC_INDEX_CHECK) 00820 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00821 #else 00822 throw(); 00823 #endif 00824 00825 INLINE intmatrix_slice& operator +=(const intmatrix_slice &ms2) 00826 #if(CXSC_INDEX_CHECK) 00827 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00828 #else 00829 throw(); 00830 #endif 00831 00832 INLINE intmatrix_slice& operator -=(const intmatrix &m1) 00833 #if(CXSC_INDEX_CHECK) 00834 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00835 #else 00836 throw(); 00837 #endif 00838 00839 INLINE intmatrix_slice& operator -=(const intmatrix_slice &ms2) 00840 #if(CXSC_INDEX_CHECK) 00841 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 00842 #else 00843 throw(); 00844 #endif 00845 00846 INLINE intmatrix_slice& operator *=(const int &c) throw(); 00848 INLINE intmatrix_slice& operator /=(const int &c) throw(); 00849 INLINE operator void*() throw(); 00850 //#else 00851 //#endif 00852 }; 00853 00854 //================================================================ 00855 //====================== Subvector Functions ===================== 00856 00857 //=======================Vector / Scalar ========================= 00858 00860 INLINE intvector operator /(const intmatrix_subv &rv, const int &s) throw(); 00862 INLINE intvector operator *(const intmatrix_subv &rv, const int &s) throw(); 00864 INLINE intvector operator *(const int &s, const intmatrix_subv &rv) throw(); 00866 INLINE intvector abs(const intmatrix_subv &mv) throw(); 00867 00868 //======================== Vector / Vector ======================== 00869 00871 INLINE void accumulate(dotprecision &dp, const intmatrix_subv & rv1, const intmatrix_subv &rv2) 00872 #if(CXSC_INDEX_CHECK) 00873 throw(OP_WITH_WRONG_DIM); 00874 #else 00875 throw(); 00876 #endif 00877 00878 INLINE void accumulate(dotprecision &dp, const intvector & rv1, const intmatrix_subv &rv2) 00879 #if(CXSC_INDEX_CHECK) 00880 throw(OP_WITH_WRONG_DIM); 00881 #else 00882 throw(); 00883 #endif 00884 00885 INLINE void accumulate(dotprecision &dp, const intmatrix_subv & rv1, const intvector &rv2) 00886 #if(CXSC_INDEX_CHECK) 00887 throw(OP_WITH_WRONG_DIM); 00888 #else 00889 throw(); 00890 #endif 00891 00892 INLINE void accumulate(dotprecision &dp,const intvector_slice &sl,const intmatrix_subv &sv) 00893 #if(CXSC_INDEX_CHECK) 00894 throw(OP_WITH_WRONG_DIM); 00895 #else 00896 throw(); 00897 #endif 00898 00899 INLINE void accumulate(dotprecision &dp,const intmatrix_subv &mv,const intvector_slice &vs) 00900 #if(CXSC_INDEX_CHECK) 00901 throw(OP_WITH_WRONG_DIM); 00902 #else 00903 throw(); 00904 #endif 00905 00907 INLINE intvector operator +(const intmatrix_subv & rv1, const intmatrix_subv &rv2) 00908 #if(CXSC_INDEX_CHECK) 00909 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00910 #else 00911 throw(); 00912 #endif 00913 00914 INLINE intvector operator +(const intmatrix_subv &rv1,const intvector &rv2) 00915 #if(CXSC_INDEX_CHECK) 00916 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00917 #else 00918 throw(); 00919 #endif 00920 00921 INLINE intvector operator +(const intvector & rv1, const intmatrix_subv &rv2) 00922 #if(CXSC_INDEX_CHECK) 00923 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00924 #else 00925 throw(); 00926 #endif 00927 00928 INLINE intvector operator +(const intvector_slice &sl,const intmatrix_subv &mv) 00929 #if(CXSC_INDEX_CHECK) 00930 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00931 #else 00932 throw(); 00933 #endif 00934 00935 INLINE intvector operator +(const intmatrix_subv &mv,const intvector_slice &sl) 00936 #if(CXSC_INDEX_CHECK) 00937 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00938 #else 00939 throw(); 00940 #endif 00941 00943 INLINE intvector operator -(const intmatrix_subv & rv1, const intmatrix_subv &rv2) 00944 #if(CXSC_INDEX_CHECK) 00945 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00946 #else 00947 throw(); 00948 #endif 00949 00950 INLINE intvector operator -(const intvector & rv1, const intmatrix_subv &rv2) 00951 #if(CXSC_INDEX_CHECK) 00952 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00953 #else 00954 throw(); 00955 #endif 00956 00957 INLINE intvector operator -(const intmatrix_subv &rv1,const intvector &rv2) 00958 #if(CXSC_INDEX_CHECK) 00959 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00960 #else 00961 throw(); 00962 #endif 00963 00964 INLINE intvector operator -(const intvector_slice &sl,const intmatrix_subv &mv) 00965 #if(CXSC_INDEX_CHECK) 00966 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00967 #else 00968 throw(); 00969 #endif 00970 00971 INLINE intvector operator -(const intmatrix_subv &mv,const intvector_slice &sl) 00972 #if(CXSC_INDEX_CHECK) 00973 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM); 00974 #else 00975 throw(); 00976 #endif 00977 00978 //==================================================================== 00979 //===================== Matrix Functions ============================= 00980 00982 INLINE intmatrix _intmatrix(const intmatrix &rm) throw(); 00984 INLINE intmatrix _intmatrix(const intvector &v) throw(); 00986 INLINE intmatrix _intmatrix(const intvector_slice &v) throw(); 00988 INLINE intmatrix _intmatrix(const int &r) throw(); 00989 00991 INLINE int Lb(const intmatrix &rm, const int &i) 00992 #if(CXSC_INDEX_CHECK) 00993 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL); 00994 #else 00995 throw(); 00996 #endif 00997 00998 INLINE int Ub(const intmatrix &rm, const int &i) 00999 #if(CXSC_INDEX_CHECK) 01000 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL); 01001 #else 01002 throw(); 01003 #endif 01004 01005 INLINE int Lb(const intmatrix_slice &rm, const int &i) 01006 #if(CXSC_INDEX_CHECK) 01007 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL); 01008 #else 01009 throw(); 01010 #endif 01011 01012 INLINE int Ub(const intmatrix_slice &rm, const int &i) 01013 #if(CXSC_INDEX_CHECK) 01014 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL); 01015 #else 01016 throw(); 01017 #endif 01018 01019 INLINE intmatrix &SetLb(intmatrix &m, const int &i,const int &j) 01020 #if(CXSC_INDEX_CHECK) 01021 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL); 01022 #else 01023 throw(); 01024 #endif 01025 01026 INLINE intmatrix &SetUb(intmatrix &m, const int &i,const int &j) 01027 #if(CXSC_INDEX_CHECK) 01028 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL); 01029 #else 01030 throw(); 01031 #endif 01032 01033 INLINE void Resize(intmatrix &A) throw(); 01035 INLINE void Resize(intmatrix &A,const int &m, const int &n) 01036 #if(CXSC_INDEX_CHECK) 01037 throw(ERROR_INTMATRIX_WRONG_BOUNDARIES); 01038 #else 01039 throw(); 01040 #endif 01041 01042 INLINE void Resize(intmatrix &A,const int &m1, const int &m2,const int &n1,const int &n2) 01043 #if(CXSC_INDEX_CHECK) 01044 throw(ERROR_INTMATRIX_WRONG_BOUNDARIES); 01045 #else 01046 throw(); 01047 #endif 01048 01050 INLINE intmatrix abs(const intmatrix &m) throw(); 01052 INLINE intmatrix abs(const intmatrix_slice &ms) throw(); 01053 01054 //===================== Matrix / Scalar =============================== 01055 01057 INLINE intmatrix operator *(const int &c, const intmatrix &m) throw(); 01059 INLINE intmatrix operator *(const int &c, const intmatrix_slice &ms) throw(); 01061 INLINE intmatrix operator *(const intmatrix &m,const int &c) throw(); 01063 INLINE intmatrix operator *(const intmatrix_slice &ms,const int &c) throw(); 01065 INLINE intmatrix &operator *=(intmatrix &m,const int &c) throw(); 01067 INLINE intmatrix operator /(const intmatrix &m,const int &c) throw(); 01069 INLINE intmatrix operator /(const intmatrix_slice &ms, const int &c) throw(); 01071 INLINE intmatrix &operator /=(intmatrix &m,const int &c) throw(); 01072 01073 01074 //================ Matrix / Matrix ============================ 01075 01077 INLINE const intmatrix &operator +(const intmatrix &m1) throw(); 01079 INLINE intmatrix operator +(const intmatrix_slice &ms) throw(); 01081 INLINE intmatrix operator +(const intmatrix &m1,const intmatrix &m2) 01082 #if(CXSC_INDEX_CHECK) 01083 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01084 #else 01085 throw(); 01086 #endif 01087 01088 INLINE intmatrix operator +(const intmatrix &m,const intmatrix_slice &ms) 01089 #if(CXSC_INDEX_CHECK) 01090 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01091 #else 01092 throw(); 01093 #endif 01094 01095 INLINE intmatrix operator +(const intmatrix_slice &ms,const intmatrix &m) 01096 #if(CXSC_INDEX_CHECK) 01097 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01098 #else 01099 throw(); 01100 #endif 01101 01102 INLINE intmatrix operator +(const intmatrix_slice &m1,const intmatrix_slice &m2) 01103 #if(CXSC_INDEX_CHECK) 01104 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01105 #else 01106 throw(); 01107 #endif 01108 01109 INLINE intmatrix &operator +=(intmatrix &m1,const intmatrix &m2) 01110 #if(CXSC_INDEX_CHECK) 01111 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01112 #else 01113 throw(); 01114 #endif 01115 01116 INLINE intmatrix &operator +=(intmatrix &m1,const intmatrix_slice &ms) 01117 #if(CXSC_INDEX_CHECK) 01118 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01119 #else 01120 throw(); 01121 #endif 01122 01124 INLINE intmatrix operator -(const intmatrix &m) throw(); 01126 INLINE intmatrix operator -(const intmatrix_slice &ms) throw(); 01128 INLINE intmatrix operator -(const intmatrix &m1,const intmatrix &m2) 01129 #if(CXSC_INDEX_CHECK) 01130 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01131 #else 01132 throw(); 01133 #endif 01134 01135 INLINE intmatrix operator -(const intmatrix &m,const intmatrix_slice &ms) 01136 #if(CXSC_INDEX_CHECK) 01137 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01138 #else 01139 throw(); 01140 #endif 01141 01142 INLINE intmatrix operator -(const intmatrix_slice &ms,const intmatrix &m) 01143 #if(CXSC_INDEX_CHECK) 01144 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01145 #else 01146 throw(); 01147 #endif 01148 01149 INLINE intmatrix operator -(const intmatrix_slice &ms1,const intmatrix_slice &ms2) 01150 #if(CXSC_INDEX_CHECK) 01151 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01152 #else 01153 throw(); 01154 #endif 01155 01156 INLINE intmatrix &operator -=(intmatrix &m1,const intmatrix &m2) 01157 #if(CXSC_INDEX_CHECK) 01158 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01159 #else 01160 throw(); 01161 #endif 01162 01163 INLINE intmatrix &operator -=(intmatrix &m1,const intmatrix_slice &ms) 01164 #if(CXSC_INDEX_CHECK) 01165 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM); 01166 #else 01167 throw(); 01168 #endif 01169 01170 01171 //============== Compare Operator ========================== 01172 01173 //-------------- Matrix - Matrix ------------------------- 01174 01176 INLINE bool operator ==(const intmatrix &m1,const intmatrix &m2) throw(); 01178 INLINE bool operator !=(const intmatrix &m1,const intmatrix &m2) throw(); 01180 INLINE bool operator <(const intmatrix &m1,const intmatrix &m2) throw(); 01182 INLINE bool operator <=(const intmatrix &m1,const intmatrix &m2) throw(); 01184 INLINE bool operator >(const intmatrix &m1,const intmatrix &m2) throw(); 01186 INLINE bool operator >=(const intmatrix &m1,const intmatrix &m2) throw(); 01188 INLINE bool operator ==(const intmatrix &m1,const intmatrix_slice &ms) throw(); 01190 INLINE bool operator !=(const intmatrix &m1,const intmatrix_slice &ms) throw(); 01192 INLINE bool operator <(const intmatrix &m1,const intmatrix_slice &ms) throw(); 01194 INLINE bool operator <=(const intmatrix &m1,const intmatrix_slice &ms) throw(); 01196 INLINE bool operator >(const intmatrix &m1,const intmatrix_slice &ms) throw(); 01198 INLINE bool operator >=(const intmatrix &m1,const intmatrix_slice &ms) throw(); 01199 01200 //---------------- Matrix - Matrix_slice ---------------------- 01201 01203 INLINE bool operator ==(const intmatrix_slice &m1,const intmatrix_slice &m2) throw(); 01205 INLINE bool operator !=(const intmatrix_slice &m1,const intmatrix_slice &m2) throw(); 01207 INLINE bool operator <(const intmatrix_slice &m1,const intmatrix_slice &m2) throw(); 01209 INLINE bool operator <=(const intmatrix_slice &m1,const intmatrix_slice &m2) throw(); 01211 INLINE bool operator >(const intmatrix_slice &m1,const intmatrix_slice &m2) throw(); 01213 INLINE bool operator >=(const intmatrix_slice &m1,const intmatrix_slice &m2) throw(); 01214 01215 //=================== Not Operator ============================= 01216 01218 INLINE bool operator !(const intmatrix &ms) throw(); 01220 INLINE bool operator !(const intmatrix_slice &ms) throw(); 01221 01222 //======================== Input / Output ======================== 01223 01225 INLINE std::ostream &operator <<(std::ostream &s,const intmatrix &r) throw(); 01227 INLINE std::ostream &operator <<(std::ostream &s,const intmatrix_slice &r) throw(); 01229 INLINE std::istream &operator >>(std::istream &s,intmatrix &r) throw(); 01231 INLINE std::istream &operator >>(std::istream &s,intmatrix_slice &r) throw(); 01232 01234 INLINE int RowLen ( const intmatrix& ); 01236 INLINE int ColLen ( const intmatrix& ); 01239 INLINE int RowLen ( const intmatrix_slice& ); 01241 INLINE int ColLen ( const intmatrix_slice& ); 01243 intmatrix Id ( const intmatrix& ); 01245 intmatrix transp ( const intmatrix& ); 01247 void DoubleSize ( intmatrix& ); 01248 01249 //=================== Permutation matrix/vector functions ======================= 01250 01251 INLINE intvector permvec(const intmatrix&); 01252 INLINE intmatrix permmat(const intvector&); 01253 INLINE intmatrix perminv(const intmatrix&); 01254 01255 } // namespace cxsc 01256 01257 #ifdef _CXSC_INCL_INL 01258 # include "matrix.inl" 01259 # include "intmatrix.inl" 01260 #endif 01261 01262 #endif 01263