17 #define REPORT { static ExeCounter ExeCount(__LINE__,6); ++ExeCount; } 24 static int tristore(
int n)
25 {
return (
n*(
n+1))/2; }
33 if (m<=0 || m>nrows || n<=0 || n>ncols)
35 return store[(m-1)*ncols+
n-1];
41 if (m<=0 || n<=0 || m>nrows ||
n>ncols)
43 if (m>=
n)
return store[tristore(m-1)+
n-1];
44 else return store[tristore(
n-1)+m-1];
50 if (m<=0 || n<m || n>ncols)
52 return store[(m-1)*ncols+
n-1-tristore(m-1)];
58 if (
n<=0 || m<n || m>nrows)
60 return store[tristore(m-1)+
n-1];
66 if (n<=0 || m!=n || m>nrows ||
n>ncols)
95 int w = upper+lower+1;
int i = lower+
n-m;
96 if (m<=0 || m>nrows || n<=0 || n>ncols || i<0 || i>=w)
98 return store[w*(m-1)+i];
104 int w = upper+1;
int i =
n-m;
105 if (m<=0 || m>nrows || n<=0 || n>ncols || i<0 || i>=w)
107 return store[w*(m-1)+i];
113 int w = lower+1;
int i = lower+
n-m;
114 if (m<=0 || m>nrows || n<=0 || n>ncols || i<0 || i>=w)
116 return store[w*(m-1)+i];
127 if ( m>nrows ||
n<=0 || i<0 )
129 return store[w*(m-1)+i];
135 if (
n>nrows || m<=0 || i<0 )
137 return store[w*(
n-1)+i];
145 if (m<=0 || m>nrows || n<=0 || n>ncols)
147 return store[(m-1)*ncols+
n-1];
153 if (m<=0 || n<=0 || m>nrows ||
n>ncols)
155 if (m>=
n)
return store[tristore(m-1)+
n-1];
156 else return store[tristore(
n-1)+m-1];
162 if (m<=0 || n<m || n>ncols)
164 return store[(m-1)*ncols+
n-1-tristore(m-1)];
170 if (
n<=0 || m<n || m>nrows)
172 return store[tristore(m-1)+
n-1];
178 if (n<=0 || m!=n || m>nrows ||
n>ncols)
207 int w = upper+lower+1;
int i = lower+
n-m;
208 if (m<=0 || m>nrows || n<=0 || n>ncols || i<0 || i>=w)
210 return store[w*(m-1)+i];
216 int w = upper+1;
int i =
n-m;
217 if (m<=0 || m>nrows || n<=0 || n>ncols || i<0 || i>=w)
219 return store[w*(m-1)+i];
225 int w = lower+1;
int i = lower+
n-m;
226 if (m<=0 || m>nrows || n<=0 || n>ncols || i<0 || i>=w)
228 return store[w*(m-1)+i];
239 if ( m>nrows ||
n<=0 || i<0 )
241 return store[w*(m-1)+i];
247 if (
n>nrows || m<=0 || i<0 )
249 return store[w*(
n-1)+i];
259 if (gm->nrows!=1 || gm->ncols!=1)
264 CatchAll { gm->tDelete(); ReThrow; }
267 Real x = *(gm->store); gm->tDelete();
return x;
343 {
REPORT int i=storage;
Real* s=store;
while (i--) { *s++ = f; } }
425 int i = storage;
Real* s=store;
426 while(i--) *s++ = *r++;
433 int i = storage;
Real* s=store;
434 while(i--) *s++ = *r++;
440 if (&bmx !=
this) {
REPORT if (gm)
delete gm; gm = bmx.
gm->
Image();}
449 int counter=bmx.
search(gm);
450 if (counter==0) {
REPORT delete gm; gm=0; }
451 else {
REPORT gm->Release(counter); }
455 if (gmx != gm) {
REPORT if (gm)
delete gm; gm = gmx->
Image(); }
472 Tracer tr(
"GeneralMatrix::operator+=");
478 if (gm==
this) Release(2);
else Release();
485 Tracer tr(
"GeneralMatrix::operator-=");
491 if (gm==
this) Release(2);
else Release();
498 Tracer tr(
"GeneralMatrix::operator*=");
504 if (gm==
this) Release(2);
else Release();
511 Tracer tr(
"GeneralMatrix::operator|=");
517 if (gm==
this) Release(2);
else Release();
524 Tracer tr(
"GeneralMatrix::operator&=");
530 if (gm==
this) Release(2);
else Release();
537 Tracer tr(
"GeneralMatrix::operator+=(Real)");
540 Release(); Eq2(am,Type());
546 Tracer tr(
"GeneralMatrix::operator*=(Real)");
549 Release(); Eq2(am,Type());
558 Tracer tr(
"GenericMatrix::operator+=");
565 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
573 Tracer tr(
"GenericMatrix::operator-=");
580 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
588 Tracer tr(
"GenericMatrix::operator*=");
595 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
603 Tracer tr(
"GenericMatrix::operator|=");
610 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
618 Tracer tr(
"GenericMatrix::operator&=");
625 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
633 Tracer tr(
"GenericMatrix::operator+= (Real)");
638 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
646 Tracer tr(
"GenericMatrix::operator*= (Real)");
651 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
662 if (m<0 || m>= nrows || n<0 || n>= ncols)
664 return store[m*ncols+
n];
670 if (m<0 || m>= nrows || n<0 || n>= ncols)
672 return store[m*ncols+
n];
678 if (m<0 || n<0 || m >= nrows ||
n>=ncols)
680 if (m>=
n)
return store[tristore(m)+
n];
681 else return store[tristore(
n)+m];
687 if (m<0 || n<0 || m >= nrows ||
n>=ncols)
689 if (m>=
n)
return store[tristore(m)+
n];
690 else return store[tristore(
n)+m];
696 if (m<0 || n<m || n>=ncols)
698 return store[m*ncols+
n-tristore(m)];
704 if (m<0 || n<m || n>=ncols)
706 return store[m*ncols+
n-tristore(m)];
712 if (
n<0 || m<n || m>=nrows)
714 return store[tristore(m)+
n];
720 if (
n<0 || m<n || m>=nrows)
722 return store[tristore(m)+
n];
728 if (n<0 || m!=n || m>=nrows ||
n>=ncols)
736 if (n<0 || m!=n || m>=nrows ||
n>=ncols)
786 int w = upper+lower+1;
int i = lower+
n-m;
787 if (m<0 || m>= nrows || n<0 || n>= ncols || i<0 || i>=w)
795 int w = upper+lower+1;
int i = lower+
n-m;
796 if (m<0 || m>= nrows || n<0 || n>= ncols || i<0 || i>=w)
804 int w = upper+1;
int i =
n-m;
805 if (m<0 || m>= nrows || n<0 || n>= ncols || i<0 || i>=w)
813 int w = upper+1;
int i =
n-m;
814 if (m<0 || m>= nrows || n<0 || n>= ncols || i<0 || i>=w)
822 int w = lower+1;
int i = lower+
n-m;
823 if (m<0 || m>= nrows || n<0 || n>= ncols || i<0 || i>=w)
831 int w = lower+1;
int i = lower+
n-m;
832 if (m<0 || m>= nrows || n<0 || n>= ncols || i<0 || i>=w)
845 if ( m>=nrows ||
n<0 || i<0 )
853 if (
n>=nrows || m<0 || i<0 )
867 if ( m>=nrows ||
n<0 || i<0 )
875 if (
n>=nrows || m<0 || i<0 )
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Real & operator()(int, int)
void operator+=(const BaseMatrix &)
ColedMatrix AsColumn() const
void operator=(const BaseMatrix &)
virtual int search(const BaseMatrix *) const =0
SPMatrix SP(const BaseMatrix &bm1, const BaseMatrix &bm2)
void operator=(const BaseMatrix &)
void operator=(const BaseMatrix &)
void operator &=(const BaseMatrix &)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Real & operator()(int, int)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
DiagedMatrix AsDiagonal() const
NegatedMatrix operator-() const
Real & operator()(int, int)
Real & operator()(int, int)
void operator &=(const BaseMatrix &)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void operator-=(const BaseMatrix &)
void operator|=(const BaseMatrix &)
StackedMatrix operator &(const BaseMatrix &) const
os2<< "> n<< " > nendobj n
void operator=(const BaseMatrix &)
MatedMatrix AsMatrix(int, int) const
Real & operator()(int, int)
void operator*=(const BaseMatrix &)
void operator+=(const BaseMatrix &)
SolvedMatrix operator*(const BaseMatrix &) const
Real & operator()(int, int)
void operator<<(const Real *)
virtual GeneralMatrix * Image() const
ShiftedMatrix operator+(Real f, const BaseMatrix &BM)
void operator=(const BaseMatrix &)
void operator|=(const BaseMatrix &)
void operator-=(const BaseMatrix &)
void operator=(const BaseMatrix &)
ScaledMatrix operator/(Real) const
void operator*=(const BaseMatrix &)
void operator=(const GenericMatrix &)
NegShiftedMatrix operator-(Real f, const BaseMatrix &bm)
Real & operator()(int, int)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void operator=(const BaseMatrix &)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
KPMatrix KP(const BaseMatrix &bm1, const BaseMatrix &bm2)
AddedMatrix operator+(const BaseMatrix &) const
void operator=(const BaseMatrix &)
Real & operator()(int, int)
TransposedMatrix t() const
ReversedMatrix Reverse() const
Real & operator()(int, int)
void operator=(const BaseMatrix &)
ScaledMatrix operator*(Real f, const BaseMatrix &BM)
ConcatenatedMatrix operator|(const BaseMatrix &) const
MultipliedMatrix operator*(const BaseMatrix &) const
RowedMatrix AsRow() const