21 #define REPORT { static ExeCounter ExeCount(__LINE__,6); ++ExeCount; } 29 {
return (n*(n+1))/2; }
37 if (m<=0 || m>nrows_val || n<=0 || n>ncols_val)
39 return store[(m-1)*ncols_val+n-1];
45 if (m<=0 || n<=0 || m>nrows_val || n>ncols_val)
47 if (m>=n)
return store[
tristore(m-1)+n-1];
48 else return store[
tristore(n-1)+m-1];
54 if (m<=0 || n<m || n>ncols_val)
56 return store[(m-1)*ncols_val+n-1-
tristore(m-1)];
62 if (n<=0 || m<n || m>nrows_val)
70 if (n<=0 || m!=n || m>nrows_val || n>ncols_val)
99 int w = upper_val+lower_val+1;
int i = lower_val+n-
m;
100 if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w)
102 return store[w*(m-1)+i];
108 int w = upper_val+1;
int i = n-
m;
109 if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w)
111 return store[w*(m-1)+i];
117 int w = lower_val+1;
int i = lower_val+n-
m;
118 if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w)
120 return store[w*(m-1)+i];
130 int i = lower_val+n-
m;
131 if ( m>nrows_val || n<=0 || i<0 )
133 return store[w*(m-1)+i];
138 int i = lower_val+m-n;
139 if ( n>nrows_val || m<=0 || i<0 )
141 return store[w*(n-1)+i];
149 if (m<=0 || m>nrows_val || n<=0 || n>ncols_val)
151 return store[(m-1)*ncols_val+n-1];
157 if (m<=0 || n<=0 || m>nrows_val || n>ncols_val)
159 if (m>=n)
return store[
tristore(m-1)+n-1];
160 else return store[
tristore(n-1)+m-1];
166 if (m<=0 || n<m || n>ncols_val)
168 return store[(m-1)*ncols_val+n-1-
tristore(m-1)];
174 if (n<=0 || m<n || m>nrows_val)
182 if (n<=0 || m!=n || m>nrows_val || n>ncols_val)
211 int w = upper_val+lower_val+1;
int i = lower_val+n-
m;
212 if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w)
214 return store[w*(m-1)+i];
220 int w = upper_val+1;
int i = n-
m;
221 if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w)
223 return store[w*(m-1)+i];
229 int w = lower_val+1;
int i = lower_val+n-
m;
230 if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w)
232 return store[w*(m-1)+i];
242 int i = lower_val+n-
m;
243 if ( m>nrows_val || n<=0 || i<0 )
245 return store[w*(m-1)+i];
250 int i = lower_val+m-n;
251 if ( n>nrows_val || m<=0 || i<0 )
253 return store[w*(n-1)+i];
263 if (gm->nrows_val!=1 || gm->ncols_val!=1)
271 Real x = *(gm->store); gm->tDelete();
return x;
347 {
REPORT int i=storage;
Real* s=store;
while (i--) { *s++ = f; } }
361 if (nrows_val != ncols_val)
429 if (&gm ==
this) {
REPORT tag_val = -1;
return; }
431 if (indx > 0) {
delete [] indx; indx = 0; }
443 int i = storage;
Real* s=store;
444 while(i--) *s++ = (
Real)*r++;
451 int i = storage;
Real* s=store;
452 while(i--) *s++ = (
Real)*r++;
459 int i = storage;
Real* s=store;
460 while(i--) *s++ = (
Real)*r++;
466 if (&bmx !=
this) {
REPORT if (gm)
delete gm; gm = bmx.
gm->
Image();}
475 int counter=bmx.
search(gm);
476 if (counter==0) {
REPORT delete gm; gm=0; }
477 else {
REPORT gm->Release(counter); }
481 if (gmx != gm) {
REPORT if (gm)
delete gm; gm = gmx->Image(); }
495 Tracer tr(
"GeneralMatrix::operator+=");
501 if (gm==
this) Release(2);
else Release();
508 Tracer tr(
"GeneralMatrix::operator-=");
514 if (gm==
this) Release(2);
else Release();
521 Tracer tr(
"GeneralMatrix::operator*=");
527 if (gm==
this) Release(2);
else Release();
534 Tracer tr(
"GeneralMatrix::operator|=");
540 if (gm==
this) Release(2);
else Release();
547 Tracer tr(
"GeneralMatrix::operator&=");
553 if (gm==
this) Release(2);
else Release();
560 Tracer tr(
"GeneralMatrix::operator+=(Real)");
563 Release(); Eq2(am,type());
569 Tracer tr(
"GeneralMatrix::operator*=(Real)");
572 Release(); Eq2(am,type());
581 Tracer tr(
"GenericMatrix::operator+=");
586 if (gmx==gm) gm->Release(2);
else gm->Release();
588 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
596 Tracer tr(
"GenericMatrix::operator-=");
601 if (gmx==gm) gm->Release(2);
else gm->Release();
603 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
611 Tracer tr(
"GenericMatrix::operator*=");
616 if (gmx==gm) gm->Release(2);
else gm->Release();
618 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
626 Tracer tr(
"GenericMatrix::operator|=");
631 if (gmx==gm) gm->Release(2);
else gm->Release();
633 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
641 Tracer tr(
"GenericMatrix::operator&=");
646 if (gmx==gm) gm->Release(2);
else gm->Release();
648 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
656 Tracer tr(
"GenericMatrix::operator+= (Real)");
661 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
669 Tracer tr(
"GenericMatrix::operator*= (Real)");
674 if (gmy != gm) {
REPORT delete gm; gm = gmy->
Image(); }
685 if (m<0 || m>= nrows_val || n<0 || n>= ncols_val)
687 return store[m*ncols_val+n];
693 if (m<0 || m>= nrows_val || n<0 || n>= ncols_val)
695 return store[m*ncols_val+n];
701 if (m<0 || n<0 || m >= nrows_val || n>=ncols_val)
703 if (m>=n)
return store[
tristore(m)+n];
710 if (m<0 || n<0 || m >= nrows_val || n>=ncols_val)
712 if (m>=n)
return store[
tristore(m)+n];
719 if (m<0 || n<m || n>=ncols_val)
721 return store[m*ncols_val+n-
tristore(m)];
727 if (m<0 || n<m || n>=ncols_val)
729 return store[m*ncols_val+n-
tristore(m)];
735 if (n<0 || m<n || m>=nrows_val)
743 if (n<0 || m<n || m>=nrows_val)
751 if (n<0 || m!=n || m>=nrows_val || n>=ncols_val)
759 if (n<0 || m!=n || m>=nrows_val || n>=ncols_val)
809 int w = upper_val+lower_val+1;
int i = lower_val+n-
m;
810 if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w)
818 int w = upper_val+lower_val+1;
int i = lower_val+n-
m;
819 if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w)
827 int w = upper_val+1;
int i = n-
m;
828 if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w)
836 int w = upper_val+1;
int i = n-
m;
837 if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w)
845 int w = lower_val+1;
int i = lower_val+n-
m;
846 if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w)
854 int w = lower_val+1;
int i = lower_val+n-
m;
855 if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w)
867 int i = lower_val+n-
m;
868 if ( m>=nrows_val || n<0 || i<0 )
875 int i = lower_val+m-n;
876 if ( n>=nrows_val || m<0 || i<0 )
889 int i = lower_val+n-
m;
890 if ( m>=nrows_val || n<0 || i<0 )
897 int i = lower_val+m-n;
898 if ( n>=nrows_val || m<0 || i<0 )
SolvedMatrix operator*(const BaseMatrix &) const
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
AddedMatrix operator+(const BaseMatrix &) const
Real & operator()(int, int)
NegatedMatrix operator-() const
MatedMatrix as_matrix(int, int) const
void operator+=(const BaseMatrix &)
void operator=(const CroutMatrix &)
Miscellaneous exception (details in character string).
void operator=(const BaseMatrix &)
virtual int search(const BaseMatrix *) const =0
NegShiftedMatrix operator-(Real f, const BaseMatrix &bm)
void operator=(const BaseMatrix &)
SPMatrix SP(const BaseMatrix &bm1, const BaseMatrix &bm2)
void operator=(const BaseMatrix &)
ShiftedMatrix operator+(Real f, const BaseMatrix &BM)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Real & operator()(int, int)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
MultipliedMatrix operator*(const BaseMatrix &) const
void operator&=(const BaseMatrix &)
KPMatrix KP(const BaseMatrix &bm1, const BaseMatrix &bm2)
ReversedMatrix reverse() const
ScaledMatrix operator/(Real) const
Real & operator()(int, int)
Real & operator()(int, int)
A matrix is not square exception.
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void operator-=(const BaseMatrix &)
void operator|=(const BaseMatrix &)
TransposedMatrix t() const
void operator=(const BaseMatrix &)
StackedMatrix operator&(const BaseMatrix &) const
DiagedMatrix as_diagonal() const
ScaledMatrix operator*(Real f, const BaseMatrix &BM)
Base of the matrix classes.
The usual rectangular matrix.
Real & operator()(int, int)
void operator*=(const BaseMatrix &)
void operator+=(const BaseMatrix &)
Real & operator()(int, int)
void operator=(const BaseMatrix &)
void operator|=(const BaseMatrix &)
void operator-=(const BaseMatrix &)
void operator=(const BaseMatrix &)
void operator*=(const BaseMatrix &)
void operator=(const GenericMatrix &)
void operator&=(const BaseMatrix &)
RowedMatrix as_row() const
Real & operator()(int, int)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void operator=(const BaseMatrix &)
void operator<<(const double *)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void operator=(const BaseMatrix &)
ColedMatrix as_column() const
Real & operator()(int, int)
The classes for matrices that can contain data are derived from this.
Real & operator()(int, int)
virtual GeneralMatrix * Image() const
Cannot convert to vector exception.
void operator=(const BaseMatrix &)
A matrix which can be of any GeneralMatrix type.
static int tristore(int n)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
ConcatenatedMatrix operator|(const BaseMatrix &) const