18 #define REPORT { static ExeCounter ExeCount(__LINE__,5); ++ExeCount; } 34 gm1 = mt.
New(ncols,nrows,tm);
35 for (
int i=0; i<ncols; i++)
44 gm1 = mt.
New(ncols,nrows,tm);
54 {
REPORT return Evaluate(mt); }
58 {
REPORT return Evaluate(mt); }
64 gmx->nrows = 1; gmx->ncols = gmx->storage = storage;
65 return BorrowStore(gmx,mt);
72 gmx->ncols = 1; gmx->nrows = gmx->storage = storage;
73 return BorrowStore(gmx,mt);
77 {
REPORT return Evaluate(mt); }
88 tDelete(); gmx->ReleaseAndDelete();
return gmx;
92 {
REPORT return gm->Evaluate(mt); }
97 int nr=gm->
Nrows();
int nc=gm->Ncols();
98 Compare(gm->Type().AddEqualEl(),mt);
99 if (!(mt==gm->Type()))
105 while (nr--) { mrx.
Add(mr,f); mrx.
Next(); mr.
Next(); }
106 gmx->ReleaseAndDelete(); gm->tDelete();
109 else if (gm->reuse())
125 int nr=gm->
Nrows();
int nc=gm->Ncols();
126 Compare(gm->Type().AddEqualEl(),mt);
127 if (!(mt==gm->Type()))
134 gmx->ReleaseAndDelete(); gm->tDelete();
137 else if (gm->reuse())
153 int nr=gm->
Nrows();
int nc=gm->Ncols();
175 gmx->ReleaseAndDelete(); gm->tDelete();
183 int nr=gm->
Nrows();
int nc=gm->Ncols();
206 gmx->ReleaseAndDelete(); gm->tDelete();
215 if ((gm->Type()).IsBand() && ! (gm->Type()).IsDiagonal())
221 if (gm->reuse()) {
REPORT gm->ReverseElements(); gmx = gm; }
225 gmx = gm->
Type().
New(gm->Nrows(), gm->Ncols(),
this);
246 return gm->BorrowStore(gmx,mt);
254 return gm->BorrowStore(gmx,mt);
262 return gm->BorrowStore(gmx,mt);
267 Tracer tr(
"MatedMatrix::Evaluate");
273 return gm->BorrowStore(gmx,mt);
279 Tracer tr(
"SubMatrix(evaluate)");
281 if (row_number < 0) row_number = gm->Nrows();
282 if (col_number < 0) col_number = gm->Ncols();
283 if (row_skip+row_number > gm->Nrows() || col_skip+col_number > gm->Ncols())
288 if (IsSym)
Compare(gm->Type().ssub(), mt);
289 else Compare(gm->Type().sub(), mt);
300 gmx->ReleaseAndDelete(); gm->tDelete();
316 { *s++ = *s1++ + f; *s++ = *s1++ + f; *s++ = *s1++ + f; *s++ = *s1++ + f; }
317 i = storage & 3;
while (i--) *s++ = *s1++ + f;
323 Real* s=store;
int i=(storage >> 2);
324 while (i--) { *s++ += f; *s++ += f; *s++ += f; *s++ += f; }
325 i = storage & 3;
while (i--) *s++ += f;
333 { *s++ = f - *s1++; *s++ = f - *s1++; *s++ = f - *s1++; *s++ = f - *s1++; }
334 i = storage & 3;
while (i--) *s++ = f - *s1++;
340 Real* s=store;
int i=(storage >> 2);
343 *s = f - *s; s++; *s = f - *s; s++;
344 *s = f - *s; s++; *s = f - *s; s++;
346 i = storage & 3;
while (i--) { *s = f - *s; s++; }
355 { *s++ = -(*s1++); *s++ = -(*s1++); *s++ = -(*s1++); *s++ = -(*s1++); }
356 i = storage & 3;
while(i--) *s++ = -(*s1++);
362 Real* s=store;
int i=(storage >> 2);
364 { *s = -(*s); s++; *s = -(*s); s++; *s = -(*s); s++; *s = -(*s); s++; }
365 i = storage & 3;
while(i--) { *s = -(*s); s++; }
373 { *s++ = *s1++ * f; *s++ = *s1++ * f; *s++ = *s1++ * f; *s++ = *s1++ * f; }
374 i = storage & 3;
while (i--) *s++ = *s1++ * f;
380 Real* s=store;
int i=(storage >> 2);
381 while (i--) { *s++ *= f; *s++ *= f; *s++ *= f; *s++ *= f; }
382 i = storage & 3;
while (i--) *s++ *= f;
396 *r = f;
int n1 =
n-1;
n=0;
407 Real* r; r = Store(); *r = f;
n--;
414 Tracer et(
"MatrixInput (GetSubMatrix)");
416 if (row_number != 1 || col_skip != 0 || col_number != gm->Ncols())
469 while (
n--) *(--rx) = *(
x++);
478 while (
n--) {
Real t = *(--rx); *rx = *
x; *(
x++) = t; }
void Add(GeneralMatrix *, Real)
void operator<<(const BaseMatrix &)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void Copy(const MatrixRowCol &)
GeneralMatrix * Transpose(TransposedMatrix *, MatrixType)
void operator<<(const Real *r)
void NegAdd(const MatrixRowCol &, Real)
GeneralMatrix * Transpose(TransposedMatrix *, MatrixType)
void Add(const MatrixRowCol &)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void NegAdd(GeneralMatrix *, Real)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
GeneralMatrix * New() const
MatrixInput operator<<(Real)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
GeneralMatrix * Transpose(TransposedMatrix *, MatrixType)
GeneralMatrix * Transpose(TransposedMatrix *, MatrixType)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
bool Compare(const MatrixType &source, MatrixType &destination)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void MatrixErrorNoSpace(const void *)
void Negate(const MatrixRowCol &)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void Multiply(const MatrixRowCol &)
os2<< "> n<< " > nendobj n
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void Multiply(GeneralMatrix *, Real)
void SubRowCol(MatrixRowCol &, int, int) const
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void operator<<(const Real *)
virtual MatrixType Type() const =0
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
virtual GeneralMatrix * Transpose(TransposedMatrix *, MatrixType)
GeneralMatrix * Transpose(TransposedMatrix *, MatrixType)
GeneralMatrix * Evaluate(MatrixType=MatrixTypeUnSp)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)