26 #ifndef _CXSC_INTMATRIX_HPP_INCLUDED
27 #define _CXSC_INTMATRIX_HPP_INCLUDED
29 #include "xscclass.hpp"
32 #include "intvector.hpp"
39 class intmatrix_slice;
53 int size,start,offset;
59 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
66 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
72 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
79 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
84 #ifdef _CXSC_FRIEND_TPL
86 template <
class MV1,
class MV2>
friend MV1 &_mvmvassign(MV1 &v,
const MV2 &rv)
88 throw(ERROR__OP_WITH_WRONG_DIM<MV1>);
92 template <
class MV,
class S>
friend MV &_mvsassign(MV &v,
const S &r)
throw();
93 template <
class MV,
class V>
friend MV &_mvvassign(MV &v,
const V &rv)
95 throw(ERROR__OP_WITH_WRONG_DIM<MV>);
99 template <
class V,
class MV2,
class S>
friend V &_vmvassign(V &v,
const MV2 &rv)
throw();
100 template <
class MV,
class V>
friend V _mvabs(
const MV &mv)
throw();
101 template <
class DP,
class V,
class SV>
friend void _vmvaccu(DP &dp,
const V & rv1,
const SV &rv2)
102 #if(CXSC_INDEX_CHECK)
103 throw(OP_WITH_WRONG_DIM);
107 template <
class DP,
class MV1,
class MV2>
friend void _mvmvaccu(DP &dp,
const MV1 & rv1,
const MV2 &rv2)
108 #if(CXSC_INDEX_CHECK)
109 throw(OP_WITH_WRONG_DIM);
113 template <
class MV,
class S,
class E>
friend E _mvsmult(
const MV &rv,
const S &s)
throw();
114 template <
class MV1,
class MV2,
class E>
friend E _mvmvplus(
const MV1 &rv1,
const MV2 &rv2)
115 #if(CXSC_INDEX_CHECK)
116 throw(ERROR__OP_WITH_WRONG_DIM<E>);
120 template <
class MV1,
class MV2,
class E>
friend E _mvmvminus(
const MV1 &rv1,
const MV2 &rv2)
121 #if(CXSC_INDEX_CHECK)
122 throw(ERROR__OP_WITH_WRONG_DIM<E>);
126 template <
class MV,
class V,
class E>
friend E _mvvplus(
const MV &rv1,
const V &rv2)
127 #if(CXSC_INDEX_CHECK)
128 throw(ERROR__OP_WITH_WRONG_DIM<E>);
132 template <
class MV,
class V,
class E>
friend E _mvvminus(
const MV &rv1,
const V &rv2)
133 #if(CXSC_INDEX_CHECK)
134 throw(ERROR__OP_WITH_WRONG_DIM<E>);
138 template <
class V,
class MV,
class E>
friend E _vmvminus(
const V &rv1,
const MV &rv2)
139 #if(CXSC_INDEX_CHECK)
140 throw(ERROR__OP_WITH_WRONG_DIM<E>);
144 template <
class MV,
class S,
class E>
friend E _mvsdiv(
const MV &rv,
const S &s)
throw();
145 template <
class MV,
class S>
friend MV &_mvsmultassign(MV &v,
const S &r)
throw();
146 template <
class MV,
class S>
friend MV &_mvsplusassign(MV &v,
const S &r)
throw();
147 template <
class MV,
class S>
friend MV &_mvsminusassign(MV &v,
const S &r)
throw();
148 template <
class MV,
class S>
friend MV &_mvsdivassign(MV &v,
const S &r)
throw();
149 template <
class MV,
class V>
friend MV &_mvvplusassign(MV &v,
const V &rv)
150 #if(CXSC_INDEX_CHECK)
151 throw(ERROR__OP_WITH_WRONG_DIM<MV>);
155 template <
class V,
class MV>
friend V &_vmvplusassign(V &rv,
const MV &v)
156 #if(CXSC_INDEX_CHECK)
157 throw(ERROR__OP_WITH_WRONG_DIM<V>);
161 template <
class MV,
class V>
friend MV &_mvvminusassign(MV &v,
const V &rv)
162 #if(CXSC_INDEX_CHECK)
163 throw(ERROR__OP_WITH_WRONG_DIM<MV>);
167 template <
class V,
class MV>
friend V &_vmvminusassign(V &rv,
const MV &v)
168 #if(CXSC_INDEX_CHECK)
169 throw(ERROR__OP_WITH_WRONG_DIM<V>);
179 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) { }
194 #if(CXSC_INDEX_CHECK)
195 throw(ERROR_INTMATRIX_TYPE_CAST_OF_THICK_OBJ);
201 #if(CXSC_INDEX_CHECK)
202 throw(ERROR_INTMATRIX_TYPE_CAST_OF_THICK_OBJ);
208 #if(CXSC_INDEX_CHECK)
209 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
215 #if(CXSC_INDEX_CHECK)
216 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
226 #if(CXSC_INDEX_CHECK)
227 throw(ERROR_INTVECTOR_ELEMENT_NOT_IN_VEC);
235 #if(CXSC_INDEX_CHECK)
236 throw(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG);
242 #if(CXSC_INDEX_CHECK)
243 throw(ERROR_INTVECTOR_SUB_ARRAY_TOO_BIG);
258 #if(CXSC_INDEX_CHECK)
259 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
265 #if(CXSC_INDEX_CHECK)
266 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
272 #if(CXSC_INDEX_CHECK)
273 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
279 #if(CXSC_INDEX_CHECK)
280 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
291 INLINE intmatrix_subv
Row(intmatrix &m,
const int &i)
292 #if(CXSC_INDEX_CHECK)
293 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
297 INLINE intmatrix_subv
Col(intmatrix &m,
const int &i)
299 #if(CXSC_INDEX_CHECK)
300 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
308 class intmatrix_slice;
319 int lb1,ub1,lb2,ub2,xsize,ysize;
323 #ifdef _CXSC_FRIEND_TPL
325 template <
class S,
class M>
friend void _smconstr(S &s,
const M &m)
326 #if(CXSC_INDEX_CHECK)
327 throw(ERROR__TYPE_CAST_OF_THICK_OBJ<M>,ERROR__USE_OF_UNINITIALIZED_OBJ<M>);
331 template <
class V,
class M,
class S>
friend void _vmconstr(V &v,
const M &m)
332 #if(CXSC_INDEX_CHECK)
333 throw(ERROR__TYPE_CAST_OF_THICK_OBJ<M>);
337 template <
class M1,
class M2,
class S>
friend M1 &_mmassign(M1 &m1,
const M2 &m,S ms)
throw();
338 template <
class M,
class MS2,
class S>
friend M &_mmsassign(M &m,
const MS2 &ms)
throw();
339 template <
class MS,
class M>
friend MS &_msmassign(MS &ms,
const M &m)
340 #if(CXSC_INDEX_CHECK)
341 throw(ERROR__OP_WITH_WRONG_DIM<MS>);
345 template <
class M,
class S>
friend M &_msassign(M &m,
const S &r)
throw();
346 template <
class V,
class M,
class S>
friend V &_vmassign(V &v,
const M &m)
347 #if(CXSC_INDEX_CHECK)
348 throw(ERROR__TYPE_CAST_OF_THICK_OBJ<M>);
352 template <
class M,
class V,
class S>
friend M &_mvassign(M &m,
const V &v)
throw();
353 template <
class M>
friend int _mlb(
const M &m,
const int &i)
354 #if(CXSC_INDEX_CHECK)
355 throw(ERROR__WRONG_ROW_OR_COL<M>);
359 template <
class M>
friend int _mub(
const M &m,
const int &i)
360 #if(CXSC_INDEX_CHECK)
361 throw(ERROR__WRONG_ROW_OR_COL<M>);
365 template <
class M>
friend M &_msetlb(M &m,
const int &i,
const int &j)
366 #if(CXSC_INDEX_CHECK)
367 throw(ERROR__WRONG_ROW_OR_COL<M>);
371 template <
class M>
friend M &_msetub(M &m,
const int &i,
const int &j)
372 #if(CXSC_INDEX_CHECK)
373 throw(ERROR__WRONG_ROW_OR_COL<M>);
377 template <
class M>
friend void _mresize(M &A)
throw();
378 template <
class M,
class S>
friend void _mresize(M &A,
const int &m,
const int &n)
379 #if(CXSC_INDEX_CHECK)
380 throw(ERROR__WRONG_BOUNDARIES<M>);
384 template <
class M,
class S>
friend void _mresize(M &A,
const int &m1,
const int &m2,
const int &n1,
const int &n2)
385 #if(CXSC_INDEX_CHECK)
386 throw(ERROR__WRONG_BOUNDARIES<M>);
390 template <
class M,
class E>
friend E _mabs(
const M &m)
throw();
391 template <
class MS,
class E>
friend E _msabs(
const MS &ms)
throw();
393 template <
class M1,
class M2,
class E>
friend E _mmplus(
const M1 &m1,
const M2 &m2)
394 #if(CXSC_INDEX_CHECK)
395 throw(ERROR__OP_WITH_WRONG_DIM<M1>);
399 template <
class M,
class MS,
class E>
friend E _mmsplus(
const M &m,
const MS &ms)
400 #if(CXSC_INDEX_CHECK)
401 throw(ERROR__OP_WITH_WRONG_DIM<M>);
405 template <
class MS1,
class MS2,
class E>
friend E _msmsplus(
const MS1 &m1,
const MS2 &m2)
406 #if(CXSC_INDEX_CHECK)
407 throw(ERROR__OP_WITH_WRONG_DIM<E>);
411 template <
class M>
friend M _mminus(
const M &m)
throw();
412 template <
class MS,
class E>
friend E _msminus(
const MS &ms)
throw();
413 template <
class M1,
class M2,
class E>
friend E _mmminus(
const M1 &m1,
const M2 &m2)
414 #if(CXSC_INDEX_CHECK)
415 throw(ERROR__OP_WITH_WRONG_DIM<M1>);
419 template <
class M1,
class M2>
friend M1 &_mmplusassign(M1 &m1,
const M2 &m2)
420 #if(CXSC_INDEX_CHECK)
421 throw(ERROR__OP_WITH_WRONG_DIM<M1>);
425 template <
class M,
class MS>
friend M &_mmsplusassign(M &m1,
const MS &ms)
426 #if(CXSC_INDEX_CHECK)
427 throw(ERROR__OP_WITH_WRONG_DIM<M>);
431 template <
class MS,
class M>
friend MS &_msmplusassign(MS &ms,
const M &m1)
432 #if(CXSC_INDEX_CHECK)
433 throw(ERROR__OP_WITH_WRONG_DIM<MS>);
437 template <
class M,
class MS,
class E>
friend E _mmsminus(
const M &m,
const MS &ms)
438 #if(CXSC_INDEX_CHECK)
439 throw(ERROR__OP_WITH_WRONG_DIM<E>);
443 template <
class MS,
class M,
class E>
friend E _msmminus(
const MS &ms,
const M &m)
444 #if(CXSC_INDEX_CHECK)
445 throw(ERROR__OP_WITH_WRONG_DIM<E>);
449 template <
class MS1,
class MS2,
class E>
friend E _msmsminus(
const MS1 &ms1,
const MS2 &ms2)
450 #if(CXSC_INDEX_CHECK)
451 throw(ERROR__OP_WITH_WRONG_DIM<E>);
455 template <
class M1,
class M2>
friend M1 &_mmminusassign(M1 &m1,
const M2 &m2)
456 #if(CXSC_INDEX_CHECK)
457 throw(ERROR__OP_WITH_WRONG_DIM<M1>);
461 template <
class M,
class MS>
friend M &_mmsminusassign(M &m1,
const MS &ms)
462 #if(CXSC_INDEX_CHECK)
463 throw(ERROR__OP_WITH_WRONG_DIM<M>);
467 template <
class MS,
class M>
friend MS &_msmminusassign(MS &ms,
const M &m1)
468 #if(CXSC_INDEX_CHECK)
469 throw(ERROR__OP_WITH_WRONG_DIM<MS>);
474 template <
class S,
class M,
class E>
friend E _smmult(
const S &c,
const M &m)
throw();
475 template <
class M,
class S>
friend M &_msmultassign(M &m,
const S &c)
throw();
476 template <
class S,
class MS,
class E>
friend E _smsmult(
const S &c,
const MS &ms)
throw();
477 template <
class M,
class S,
class E>
friend E _msdiv(
const M &m,
const S &c)
throw();
478 template <
class M,
class S>
friend M &_msdivassign(M &m,
const S &c)
throw();
479 template <
class MS,
class S,
class E>
friend E _mssdiv(
const MS &ms,
const S &c)
throw();
482 template <
class M>
friend void *_mvoid(
const M &m)
throw();
483 template <
class M>
friend bool _mnot(
const M &m)
throw();
484 template <
class MS>
friend void *_msvoid(
const MS &ms)
throw();
485 template <
class MS>
friend bool _msnot(
const MS &ms)
throw();
486 template <
class M1,
class M2>
friend bool _mmeq(
const M1 &m1,
const M2 &m2)
throw();
487 template <
class M1,
class M2>
friend bool _mmneq(
const M1 &m1,
const M2 &m2)
throw();
488 template <
class M1,
class M2>
friend bool _mmless(
const M1 &m1,
const M2 &m2)
throw();
489 template <
class M1,
class M2>
friend bool _mmleq(
const M1 &m1,
const M2 &m2)
throw();
490 template <
class M,
class MS>
friend bool _mmseq(
const M &m1,
const MS &ms)
throw();
491 template <
class M,
class MS>
friend bool _mmsneq(
const M &m1,
const MS &ms)
throw();
492 template <
class M,
class MS>
friend bool _mmsless(
const M &m1,
const MS &ms)
throw();
493 template <
class M,
class MS>
friend bool _mmsleq(
const M &m1,
const MS &ms)
throw();
494 template <
class MS,
class M>
friend bool _msmless(
const MS &ms,
const M &m1)
throw();
495 template <
class MS,
class M>
friend bool _msmleq(
const MS &ms,
const M &m1)
throw();
496 template <
class M>
friend std::ostream &_mout(std::ostream &s,
const M &r)
throw();
497 template <
class M>
friend std::istream &_min(std::istream &s,M &r)
throw();
510 explicit INLINE
intmatrix(
const int &m,
const int &n)
511 #if(CXSC_INDEX_CHECK)
512 throw(ERROR_INTMATRIX_WRONG_BOUNDARIES);
516 explicit INLINE
intmatrix(
const int &m1,
const int &n1,
const int &m2,
const int &n2)
518 #if(CXSC_INDEX_CHECK)
519 throw(ERROR_INTMATRIX_WRONG_BOUNDARIES);
528 explicit INLINE
intmatrix(
const int &r)
throw();
542 INLINE ~
intmatrix()
throw() {
delete [] dat; }
547 #if(CXSC_INDEX_CHECK)
548 throw(ERROR_INTMATRIX_TYPE_CAST_OF_THICK_OBJ);
554 #if(CXSC_INDEX_CHECK)
555 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
561 #if(CXSC_INDEX_CHECK)
562 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
570 #if(CXSC_INDEX_CHECK)
571 throw(ERROR_INTMATRIX_SUB_ARRAY_TOO_BIG);
577 #if(CXSC_INDEX_CHECK)
578 throw(ERROR_INTMATRIX_SUB_ARRAY_TOO_BIG);
582 INLINE
operator void*()
throw();
598 int offset1,offset2,mxsize,mysize;
599 int start1,end1,start2,end2,sxsize,sysize;
603 #ifdef _CXSC_FRIEND_TPL
605 template <
class V,
class MS,
class S>
friend void _vmsconstr(V &v,
const MS &m)
606 #if(CXSC_INDEX_CHECK)
607 throw(ERROR__TYPE_CAST_OF_THICK_OBJ<MS>);
611 template <
class MS,
class M>
friend MS &_msmassign(MS &ms,
const M &m)
612 #if(CXSC_INDEX_CHECK)
613 throw(ERROR__OP_WITH_WRONG_DIM<MS>);
617 template <
class MS1,
class MS2>
friend MS1 &_msmsassign(MS1 &ms1,
const MS2 &ms)
618 #if(CXSC_INDEX_CHECK)
619 throw(ERROR__OP_WITH_WRONG_DIM<MS1>);
623 template <
class M,
class MS2,
class S>
friend M &_mmsassign(M &m,
const MS2 &ms)
throw();
624 template <
class MS,
class S>
friend MS &_mssassign(MS &ms,
const S &r)
throw();
625 template <
class MS>
friend int _mslb(
const MS &ms,
const int &i)
626 #if(CXSC_INDEX_CHECK)
627 throw(ERROR__WRONG_ROW_OR_COL<MS>);
631 template <
class MS>
friend int _msub(
const MS &ms,
const int &i)
632 #if(CXSC_INDEX_CHECK)
633 throw(ERROR__WRONG_ROW_OR_COL<MS>);
637 template <
class MS,
class E>
friend E _msabs(
const MS &ms)
throw();
639 template <
class MS,
class E>
friend E _msminus(
const MS &ms)
throw();
640 template <
class M,
class MS,
class E>
friend E _mmsplus(
const M &m,
const MS &ms)
641 #if(CXSC_INDEX_CHECK)
642 throw(ERROR__OP_WITH_WRONG_DIM<M>);
646 template <
class MS1,
class MS2,
class E>
friend E _msmsplus(
const MS1 &m1,
const MS2 &m2)
647 #if(CXSC_INDEX_CHECK)
648 throw(ERROR__OP_WITH_WRONG_DIM<E>);
652 template <
class M,
class MS>
friend M &_mmsplusassign(M &m1,
const MS &ms)
653 #if(CXSC_INDEX_CHECK)
654 throw(ERROR__OP_WITH_WRONG_DIM<M>);
658 template <
class MS,
class M>
friend MS &_msmplusassign(MS &ms,
const M &m1)
659 #if(CXSC_INDEX_CHECK)
660 throw(ERROR__OP_WITH_WRONG_DIM<MS>);
664 template <
class MS1,
class MS2>
friend MS1 &_msmsplusassign(MS1 &ms1,
const MS2 &ms2)
665 #if(CXSC_INDEX_CHECK)
666 throw(ERROR__OP_WITH_WRONG_DIM<MS1>);
670 template <
class M,
class MS,
class E>
friend E _mmsminus(
const M &m,
const MS &ms)
671 #if(CXSC_INDEX_CHECK)
672 throw(ERROR__OP_WITH_WRONG_DIM<E>);
676 template <
class MS,
class M,
class E>
friend E _msmminus(
const MS &ms,
const M &m)
677 #if(CXSC_INDEX_CHECK)
678 throw(ERROR__OP_WITH_WRONG_DIM<E>);
682 template <
class MS1,
class MS2,
class E>
friend E _msmsminus(
const MS1 &ms1,
const MS2 &ms2)
683 #if(CXSC_INDEX_CHECK)
684 throw(ERROR__OP_WITH_WRONG_DIM<E>);
688 template <
class M,
class MS>
friend M &_mmsminusassign(M &m1,
const MS &ms)
689 #if(CXSC_INDEX_CHECK)
690 throw(ERROR__OP_WITH_WRONG_DIM<M>);
694 template <
class MS,
class M>
friend MS &_msmminusassign(MS &ms,
const M &m1)
695 #if(CXSC_INDEX_CHECK)
696 throw(ERROR__OP_WITH_WRONG_DIM<MS>);
700 template <
class MS1,
class MS2>
friend MS1 &_msmsminusassign(MS1 &ms1,
const MS2 &ms2)
701 #if(CXSC_INDEX_CHECK)
702 throw(ERROR__OP_WITH_WRONG_DIM<MS1>);
707 template <
class S,
class MS,
class E>
friend E _smsmult(
const S &c,
const MS &ms)
throw();
708 template <
class MS,
class S>
friend MS &_mssmultassign(MS &ms,
const S &c)
throw();
709 template <
class MS,
class S,
class E>
friend E _mssdiv(
const MS &ms,
const S &c)
throw();
710 template <
class MS,
class S>
friend MS &_mssdivassign(MS &ms,
const S &c)
throw();
712 template <
class MS>
friend void *_msvoid(
const MS &ms)
throw();
713 template <
class MS>
friend bool _msnot(
const MS &ms)
throw();
714 template <
class M,
class MS>
friend bool _mmseq(
const M &m1,
const MS &ms)
throw();
715 template <
class M,
class MS>
friend bool _mmsneq(
const M &m1,
const MS &ms)
throw();
716 template <
class M,
class MS>
friend bool _mmsless(
const M &m1,
const MS &ms)
throw();
717 template <
class M,
class MS>
friend bool _mmsleq(
const M &m1,
const MS &ms)
throw();
718 template <
class MS,
class M>
friend bool _msmless(
const MS &ms,
const M &m1)
throw();
719 template <
class MS,
class M>
friend bool _msmleq(
const MS &ms,
const M &m1)
throw();
720 template <
class MS1,
class MS2>
friend bool _msmseq(
const MS1 &ms1,
const MS2 &ms2)
throw();
721 template <
class MS1,
class MS2>
friend bool _msmsneq(
const MS1 &ms1,
const MS2 &ms2)
throw();
722 template <
class MS1,
class MS2>
friend bool _msmsless(
const MS1 &ms1,
const MS2 &ms2)
throw();
723 template <
class MS1,
class MS2>
friend bool _msmsleq(
const MS1 &ms1,
const MS2 &ms2)
throw();
724 template <
class MS>
friend std::ostream &_msout(std::ostream &s,
const MS &r)
throw();
725 template <
class MS>
friend std::istream &_msin(std::istream &s,MS &r)
throw();
733 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) { }
735 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) { }
738 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) { }
744 #if(CXSC_INDEX_CHECK)
745 throw(ERROR_INTMATRIX_TYPE_CAST_OF_THICK_OBJ);
752 #if(CXSC_INDEX_CHECK)
753 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
759 #if(CXSC_INDEX_CHECK)
760 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
768 #if(CXSC_INDEX_CHECK)
769 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
775 #if(CXSC_INDEX_CHECK)
776 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
782 #if(CXSC_INDEX_CHECK)
783 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
789 #if(CXSC_INDEX_CHECK)
790 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
796 #if(CXSC_INDEX_CHECK)
797 throw(ERROR_INTMATRIX_ROW_OR_COL_NOT_IN_MAT);
805 #if(CXSC_INDEX_CHECK)
806 throw(ERROR_INTMATRIX_SUB_ARRAY_TOO_BIG);
812 #if(CXSC_INDEX_CHECK)
813 throw(ERROR_INTMATRIX_SUB_ARRAY_TOO_BIG);
819 #if(CXSC_INDEX_CHECK)
820 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
826 #if(CXSC_INDEX_CHECK)
827 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
833 #if(CXSC_INDEX_CHECK)
834 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
840 #if(CXSC_INDEX_CHECK)
841 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
849 INLINE
operator void*()
throw();
860 INLINE intvector
operator /(
const intmatrix_subv &rv,
const int &s)
throw();
862 INLINE intvector
operator *(
const intmatrix_subv &rv,
const int &s)
throw();
864 INLINE intvector
operator *(
const int &s,
const intmatrix_subv &rv)
throw();
866 INLINE intvector
abs(
const intmatrix_subv &mv)
throw();
871 INLINE
void accumulate(dotprecision &dp,
const intmatrix_subv & rv1,
const intmatrix_subv &rv2)
872 #if(CXSC_INDEX_CHECK)
873 throw(OP_WITH_WRONG_DIM);
877 INLINE
void accumulate(dotprecision &dp,
const intvector & rv1,
const intmatrix_subv &rv2)
879 #if(CXSC_INDEX_CHECK)
880 throw(OP_WITH_WRONG_DIM);
884 INLINE
void accumulate(dotprecision &dp,
const intmatrix_subv & rv1,
const intvector &rv2)
886 #if(CXSC_INDEX_CHECK)
887 throw(OP_WITH_WRONG_DIM);
891 INLINE
void accumulate(dotprecision &dp,
const intvector_slice &sl,
const intmatrix_subv &sv)
893 #if(CXSC_INDEX_CHECK)
894 throw(OP_WITH_WRONG_DIM);
898 INLINE
void accumulate(dotprecision &dp,
const intmatrix_subv &mv,
const intvector_slice &vs)
900 #if(CXSC_INDEX_CHECK)
901 throw(OP_WITH_WRONG_DIM);
907 INLINE intvector operator +(
const intmatrix_subv & rv1,
const intmatrix_subv &rv2)
908 #if(CXSC_INDEX_CHECK)
909 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
913 INLINE intvector operator +(
const intmatrix_subv &rv1,
const intvector &rv2)
915 #if(CXSC_INDEX_CHECK)
916 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
920 INLINE intvector operator +(
const intvector & rv1,
const intmatrix_subv &rv2)
922 #if(CXSC_INDEX_CHECK)
923 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
927 INLINE intvector operator +(
const intvector_slice &sl,
const intmatrix_subv &mv)
929 #if(CXSC_INDEX_CHECK)
930 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
934 INLINE intvector operator +(
const intmatrix_subv &mv,
const intvector_slice &sl)
936 #if(CXSC_INDEX_CHECK)
937 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
943 INLINE intvector operator -(
const intmatrix_subv & rv1,
const intmatrix_subv &rv2)
944 #if(CXSC_INDEX_CHECK)
945 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
949 INLINE intvector operator -(
const intvector & rv1,
const intmatrix_subv &rv2)
951 #if(CXSC_INDEX_CHECK)
952 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
956 INLINE intvector operator -(
const intmatrix_subv &rv1,
const intvector &rv2)
958 #if(CXSC_INDEX_CHECK)
959 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
963 INLINE intvector operator -(
const intvector_slice &sl,
const intmatrix_subv &mv)
965 #if(CXSC_INDEX_CHECK)
966 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
970 INLINE intvector operator -(
const intmatrix_subv &mv,
const intvector_slice &sl)
972 #if(CXSC_INDEX_CHECK)
973 throw(ERROR_INTVECTOR_OP_WITH_WRONG_DIM);
982 INLINE intmatrix
_intmatrix(
const intmatrix &rm)
throw();
984 INLINE intmatrix
_intmatrix(
const intvector &v)
throw();
986 INLINE intmatrix
_intmatrix(
const intvector_slice &v)
throw();
988 INLINE intmatrix
_intmatrix(
const int &r)
throw();
991 INLINE
int Lb(
const intmatrix &rm,
const int &i)
992 #if(CXSC_INDEX_CHECK)
993 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL);
997 INLINE
int Ub(
const intmatrix &rm,
const int &i)
999 #if(CXSC_INDEX_CHECK)
1000 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL);
1004 INLINE
int Lb(
const intmatrix_slice &rm,
const int &i)
1006 #if(CXSC_INDEX_CHECK)
1007 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL);
1011 INLINE
int Ub(
const intmatrix_slice &rm,
const int &i)
1013 #if(CXSC_INDEX_CHECK)
1014 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL);
1018 INLINE intmatrix &
SetLb(intmatrix &m,
const int &i,
const int &j)
1020 #if(CXSC_INDEX_CHECK)
1021 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL);
1025 INLINE intmatrix &
SetUb(intmatrix &m,
const int &i,
const int &j)
1027 #if(CXSC_INDEX_CHECK)
1028 throw(ERROR_INTMATRIX_WRONG_ROW_OR_COL);
1032 INLINE
void Resize(intmatrix &A)
throw();
1035 INLINE
void Resize(intmatrix &A,
const int &m,
const int &n)
1036 #if(CXSC_INDEX_CHECK)
1037 throw(ERROR_INTMATRIX_WRONG_BOUNDARIES);
1041 INLINE
void Resize(intmatrix &A,
const int &m1,
const int &m2,
const int &n1,
const int &n2)
1043 #if(CXSC_INDEX_CHECK)
1044 throw(ERROR_INTMATRIX_WRONG_BOUNDARIES);
1050 INLINE intmatrix
abs(
const intmatrix &m)
throw();
1052 INLINE intmatrix
abs(
const intmatrix_slice &ms)
throw();
1057 INLINE intmatrix
operator *(
const int &c,
const intmatrix &m)
throw();
1059 INLINE intmatrix
operator *(
const int &c,
const intmatrix_slice &ms)
throw();
1061 INLINE intmatrix
operator *(
const intmatrix &m,
const int &c)
throw();
1063 INLINE intmatrix
operator *(
const intmatrix_slice &ms,
const int &c)
throw();
1065 INLINE intmatrix &
operator *=(intmatrix &m,
const int &c)
throw();
1067 INLINE intmatrix
operator /(
const intmatrix &m,
const int &c)
throw();
1069 INLINE intmatrix
operator /(
const intmatrix_slice &ms,
const int &c)
throw();
1071 INLINE intmatrix &
operator /=(intmatrix &m,
const int &c)
throw();
1077 INLINE
const intmatrix &operator +(
const intmatrix &m1)
throw();
1079 INLINE intmatrix operator +(
const intmatrix_slice &ms)
throw();
1081 INLINE intmatrix operator +(
const intmatrix &m1,
const intmatrix &m2)
1082 #if(CXSC_INDEX_CHECK)
1083 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1087 INLINE intmatrix operator +(
const intmatrix &m,
const intmatrix_slice &ms)
1089 #if(CXSC_INDEX_CHECK)
1090 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1094 INLINE intmatrix operator +(
const intmatrix_slice &ms,
const intmatrix &m)
1096 #if(CXSC_INDEX_CHECK)
1097 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1101 INLINE intmatrix operator +(
const intmatrix_slice &m1,
const intmatrix_slice &m2)
1103 #if(CXSC_INDEX_CHECK)
1104 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1108 INLINE intmatrix &
operator +=(intmatrix &m1,
const intmatrix &m2)
1110 #if(CXSC_INDEX_CHECK)
1111 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1115 INLINE intmatrix &
operator +=(intmatrix &m1,
const intmatrix_slice &ms)
1117 #if(CXSC_INDEX_CHECK)
1118 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1124 INLINE intmatrix operator -(
const intmatrix &m)
throw();
1126 INLINE intmatrix operator -(
const intmatrix_slice &ms)
throw();
1128 INLINE intmatrix operator -(
const intmatrix &m1,
const intmatrix &m2)
1129 #if(CXSC_INDEX_CHECK)
1130 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1134 INLINE intmatrix operator -(
const intmatrix &m,
const intmatrix_slice &ms)
1136 #if(CXSC_INDEX_CHECK)
1137 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1141 INLINE intmatrix operator -(
const intmatrix_slice &ms,
const intmatrix &m)
1143 #if(CXSC_INDEX_CHECK)
1144 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1148 INLINE intmatrix operator -(
const intmatrix_slice &ms1,
const intmatrix_slice &ms2)
1150 #if(CXSC_INDEX_CHECK)
1151 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1155 INLINE intmatrix &operator -=(intmatrix &m1,
const intmatrix &m2)
1157 #if(CXSC_INDEX_CHECK)
1158 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1162 INLINE intmatrix &operator -=(intmatrix &m1,
const intmatrix_slice &ms)
1164 #if(CXSC_INDEX_CHECK)
1165 throw(ERROR_INTMATRIX_OP_WITH_WRONG_DIM);
1176 INLINE
bool operator ==(
const intmatrix &m1,
const intmatrix &m2)
throw();
1178 INLINE
bool operator !=(
const intmatrix &m1,
const intmatrix &m2)
throw();
1180 INLINE
bool operator <(
const intmatrix &m1,
const intmatrix &m2)
throw();
1182 INLINE
bool operator <=(
const intmatrix &m1,
const intmatrix &m2)
throw();
1184 INLINE
bool operator >(
const intmatrix &m1,
const intmatrix &m2)
throw();
1186 INLINE
bool operator >=(
const intmatrix &m1,
const intmatrix &m2)
throw();
1188 INLINE
bool operator ==(
const intmatrix &m1,
const intmatrix_slice &ms)
throw();
1190 INLINE
bool operator !=(
const intmatrix &m1,
const intmatrix_slice &ms)
throw();
1192 INLINE
bool operator <(
const intmatrix &m1,
const intmatrix_slice &ms)
throw();
1194 INLINE
bool operator <=(
const intmatrix &m1,
const intmatrix_slice &ms)
throw();
1196 INLINE
bool operator >(
const intmatrix &m1,
const intmatrix_slice &ms)
throw();
1198 INLINE
bool operator >=(
const intmatrix &m1,
const intmatrix_slice &ms)
throw();
1203 INLINE
bool operator ==(
const intmatrix_slice &m1,
const intmatrix_slice &m2)
throw();
1205 INLINE
bool operator !=(
const intmatrix_slice &m1,
const intmatrix_slice &m2)
throw();
1207 INLINE
bool operator <(
const intmatrix_slice &m1,
const intmatrix_slice &m2)
throw();
1209 INLINE
bool operator <=(
const intmatrix_slice &m1,
const intmatrix_slice &m2)
throw();
1211 INLINE
bool operator >(
const intmatrix_slice &m1,
const intmatrix_slice &m2)
throw();
1213 INLINE
bool operator >=(
const intmatrix_slice &m1,
const intmatrix_slice &m2)
throw();
1218 INLINE
bool operator !(
const intmatrix &ms)
throw();
1220 INLINE
bool operator !(
const intmatrix_slice &ms)
throw();
1225 INLINE std::ostream &operator <<(std::ostream &s,
const intmatrix &r)
throw();
1227 INLINE std::ostream &operator <<(std::ostream &s,
const intmatrix_slice &r)
throw();
1229 INLINE std::istream &operator >>(std::istream &s,intmatrix &r)
throw();
1231 INLINE std::istream &operator >>(std::istream &s,intmatrix_slice &r)
throw();
1234 INLINE
int RowLen (
const intmatrix& );
1236 INLINE
int ColLen (
const intmatrix& );
1239 INLINE
int RowLen (
const intmatrix_slice& );
1241 INLINE
int ColLen (
const intmatrix_slice& );
1243 intmatrix
Id (
const intmatrix& );
1245 intmatrix
transp (
const intmatrix& );
1251 INLINE intvector permvec(
const intmatrix&);
1252 INLINE intmatrix permmat(
const intvector&);
1253 INLINE intmatrix perminv(
const intmatrix&);
1257 #ifdef _CXSC_INCL_INL
1258 # include "matrix.inl"
1259 # include "intmatrix.inl"