25 #define REPORT { static ExeCounter ExeCount(__LINE__,2); ++ExeCount; } 32 #define MONITOR(what,store,storage) {} 40 int f = mrc.
skip;
int l = f + mrc.
storage;
int lx = skip + storage;
41 if (f < skip) f = skip;
if (l > lx) l = lx; l -= f;
44 while (l--) *elx++ += *el++;
51 int f = mrc.
skip;
int l = f + mrc.
storage;
int lx = skip + storage;
52 if (f < skip) f = skip;
if (l > lx) l = lx; l -= f;
55 while (l--) *elx++ += *el++ * x;
62 int f = mrc.
skip;
int l = f + mrc.
storage;
int lx = skip + storage;
63 if (f < skip) f = skip;
if (l > lx) l = lx; l -= f;
66 while (l--) *elx++ -= *el++;
73 int f = mrc.
skip;
int l = f + mrc.
storage;
int lx = skip + storage;
74 if (f < skip) f = skip;
if (l > lx) l = lx; l -= f;
77 while (l--) *elx++ = *ely++;
83 int f = mrc1.
skip;
int f2 = mrc2.
skip;
85 if (f < f2) f = f2;
if (l > l2) l = l2; l -= f;
90 while (l--) sum += *el1++ * *el2++;
97 int f = skip;
int l = skip + storage;
99 if (f1<f) f1=f;
if (l1>l) l1=l;
101 if (f2<f) f2=f;
if (l2>l) l2=l;
102 Real* el = data + (f-skip);
106 int i = f1-f;
while (i--) *el++ = 0.0;
110 i = l1-f1;
while (i--) *el++ = *el1++;
111 i = f2-l1;
while (i--) *el++ = 0.0;
112 i = l2-f2;
while (i--) *el++ = *el2++;
113 i = l-l2;
while (i--) *el++ = 0.0;
117 i = f2-f1;
while (i--) *el++ = *el1++;
121 i = l1-f2;
while (i--) *el++ = *el1++ + *el2++;
122 i = l2-l1;
while (i--) *el++ = *el2++;
123 i = l-l2;
while (i--) *el++ = 0.0;
128 i = l2-f2;
while (i--) *el++ = *el1++ + *el2++;
129 i = l1-l2;
while (i--) *el++ = *el1++;
130 i = l-l1;
while (i--) *el++ = 0.0;
136 int i = f2-f;
while (i--) *el++ = 0.0;
140 i = l2-f2;
while (i--) *el++ = *el2++;
141 i = f1-l2;
while (i--) *el++ = 0.0;
142 i = l1-f1;
while (i--) *el++ = *el1++;
143 i = l-l1;
while (i--) *el++ = 0.0;
147 i = f1-f2;
while (i--) *el++ = *el2++;
151 i = l2-f1;
while (i--) *el++ = *el1++ + *el2++;
152 i = l1-l2;
while (i--) *el++ = *el1++;
153 i = l-l1;
while (i--) *el++ = 0.0;
158 i = l1-f1;
while (i--) *el++ = *el1++ + *el2++;
159 i = l2-l1;
while (i--) *el++ = *el2++;
160 i = l-l2;
while (i--) *el++ = 0.0;
169 int f = skip;
int l = skip + storage;
171 if (f1<f) f1=f;
if (l1>l) l1=l;
173 if (f2<f) f2=f;
if (l2>l) l2=l;
174 Real* el = data + (f-skip);
178 int i = f1-f;
while (i--) *el++ = 0.0;
182 i = l1-f1;
while (i--) *el++ = *el1++;
183 i = f2-l1;
while (i--) *el++ = 0.0;
184 i = l2-f2;
while (i--) *el++ = - *el2++;
185 i = l-l2;
while (i--) *el++ = 0.0;
189 i = f2-f1;
while (i--) *el++ = *el1++;
193 i = l1-f2;
while (i--) *el++ = *el1++ - *el2++;
194 i = l2-l1;
while (i--) *el++ = - *el2++;
195 i = l-l2;
while (i--) *el++ = 0.0;
200 i = l2-f2;
while (i--) *el++ = *el1++ - *el2++;
201 i = l1-l2;
while (i--) *el++ = *el1++;
202 i = l-l1;
while (i--) *el++ = 0.0;
208 int i = f2-f;
while (i--) *el++ = 0.0;
212 i = l2-f2;
while (i--) *el++ = - *el2++;
213 i = f1-l2;
while (i--) *el++ = 0.0;
214 i = l1-f1;
while (i--) *el++ = *el1++;
215 i = l-l1;
while (i--) *el++ = 0.0;
219 i = f1-f2;
while (i--) *el++ = - *el2++;
223 i = l2-f1;
while (i--) *el++ = *el1++ - *el2++;
224 i = l1-l2;
while (i--) *el++ = *el1++;
225 i = l-l1;
while (i--) *el++ = 0.0;
230 i = l1-f1;
while (i--) *el++ = *el1++ - *el2++;
231 i = l2-l1;
while (i--) *el++ = - *el2++;
232 i = l-l2;
while (i--) *el++ = 0.0;
243 if (!storage)
return;
244 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
245 if (f < skip) { f = skip;
if (l < f) l = f; }
246 if (l > lx) { l = lx;
if (f > lx) f = lx; }
250 int l1 = f-skip;
while (l1--) *elx++ = x;
251 l1 = l-f;
while (l1--) *elx++ = *ely++ + x;
252 lx -= l;
while (lx--) *elx++ = x;
259 if (!storage)
return;
260 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
261 if (f < skip) { f = skip;
if (l < f) l = f; }
262 if (l > lx) { l = lx;
if (f > lx) f = lx; }
266 int l1 = f-skip;
while (l1--) *elx++ = x;
267 l1 = l-f;
while (l1--) *elx++ = x - *ely++;
268 lx -= l;
while (lx--) *elx++ = x;
275 if (!storage)
return;
276 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
277 if (f < skip) { f = skip;
if (l < f) l = f; }
278 if (l > lx) { l = lx;
if (f > lx) f = lx; }
282 int l1 = f-skip;
while (l1--) { *elx = - *elx; elx++; }
283 l1 = l-f;
while (l1--) { *elx = *ely++ - *elx; elx++; }
284 lx -= l;
while (lx--) { *elx = - *elx; elx++; }
291 int f1 = mrc1.
skip;
int l1 = f1 + mrc1.
storage;
int lx = skip + storage;
292 if (f1 < skip) { f1 = skip;
if (l1 < f1) l1 = f1; }
293 if (l1 > lx) { l1 = lx;
if (f1 > lx) f1 = lx; }
297 int i = f1-skip;
while (i--) *elx++ =0.0;
300 {
Real* ely = mrc1.
data+(f1-mrc1.
skip);
while (i--) *elx++ = *ely++; }
303 int skipx = l1 - i; lx -= i;
304 if (f2 < skipx) { f2 = skipx;
if (l2 < f2) l2 = f2; }
305 if (l2 > lx) { l2 = lx;
if (f2 > lx) f2 = lx; }
307 i = f2-skipx;
while (i--) *elx++ = 0.0;
310 {
Real* ely = mrc2.
data+(f2-mrc2.
skip);
while (i--) *elx++ = *ely++; }
311 lx -= l2;
while (lx--) *elx++ = 0.0;
318 if (!storage)
return;
319 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
320 if (f < skip) { f = skip;
if (l < f) l = f; }
321 if (l > lx) { l = lx;
if (f > lx) f = lx; }
325 int l1 = f-skip;
while (l1--) *elx++ = 0;
326 l1 = l-f;
while (l1--) *elx++ *= *ely++;
327 lx -= l;
while (lx--) *elx++ = 0;
333 int f = skip;
int l = skip + storage;
335 if (f1<f) f1=f;
if (l1>l) l1=l;
337 if (f2<f) f2=f;
if (l2>l) l2=l;
338 Real* el = data + (f-skip);
int i;
339 if (f1<f2) f1 = f2;
if (l1>l2) l1 = l2;
340 if (l1<=f1) {
REPORT i = l-f;
while (i--) *el++ = 0.0; }
346 i = f1-f ;
while (i--) *el++ = 0.0;
347 i = l1-f1;
while (i--) *el++ = *el1++ * *el2++;
348 i = l-l1;
while (i--) *el++ = 0.0;
355 int f = skip;
int s = storage;
Real* el = data;
int i;
360 i -= f; f = 0;
if (i > s) { i = s; s = 0; }
else s -= i;
361 while (i--) *el++ = 0.0;
367 int mrc2_skip = mrc2.
skip;
int mrc2_storage = mrc2.
storage;
368 int mrc2_length = mrc2.
length;
369 int mrc2_remain = mrc2_length - mrc2_skip - mrc2_storage;
373 if (f == 0 && mrc2_length <= s)
375 j = mrc2_skip; s -= j;
while (j--) *el++ = 0.0;
376 j = mrc2_storage; s -= j;
while (j--) *el++ = vel1 * *el2++;
377 j = mrc2_remain; s -= j;
while (j--) *el++ = 0.0;
379 else if (f >= mrc2_length) f -= mrc2_length;
385 j -= f; f = 0;
if (j > s) { j = s; s = 0; }
else s -= j;
386 while (j--) *el++ = 0.0;
393 j -= f; el2 += f; f = 0;
if (j > s) { j = s; s = 0; }
else s -= j;
394 while (j--) *el++ = vel1 * *el2++;
401 j -= f; f = 0;
if (j > s) { j = s; s = 0; }
else s -= j;
402 while (j--) *el++ = 0.0;
413 i -= f;
if (i > s) i = s;
414 while (i--) *el++ = 0.0;
423 if (!storage)
return;
424 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
425 if (f < skip) { f = skip;
if (l < f) l = f; }
426 if (l > lx) { l = lx;
if (f > lx) f = lx; }
430 if (l-f) ely = mrc1.
data+(f-mrc1.
skip);
432 int l1 = f-skip;
while (l1--) *elx++ = 0.0;
433 l1 = l-f;
while (l1--) *elx++ = *ely++;
434 lx -= l;
while (lx--) *elx++ = 0.0;
441 if (!storage)
return;
442 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
447 int l1 = f-skip;
while (l1--) *elx++ = 0.0;
448 l1 = l-f;
while (l1--) *elx++ = *ely++;
449 lx -= l;
while (lx--) *elx++ = 0.0;
456 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
466 if (skip!=0 || storage!=length)
474 if (!storage)
return;
475 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
476 if (f < skip) { f = skip;
if (l < f) l = f; }
477 if (l > lx) { l = lx;
if (f > lx) f = lx; }
481 int l1 = f-skip;
while (l1--) *elx++ = 0.0;
482 l1 = l-f;
while (l1--) *elx++ = - *ely++;
483 lx -= l;
while (lx--) *elx++ = 0.0;
490 if (!storage)
return;
491 int f = mrc1.
skip;
int l = f + mrc1.
storage;
int lx = skip + storage;
492 if (f < skip) { f = skip;
if (l < f) l = f; }
493 if (l > lx) { l = lx;
if (f > lx) f = lx; }
497 int l1 = f-skip;
while (l1--) *elx++ = 0.0;
498 l1 = l-f;
while (l1--) *elx++ = *ely++ * s;
499 lx -= l;
while (lx--) *elx++ = 0.0;
506 int f = mrc1.
skip;
int f0 = mrc.
skip;
508 if (f < f0) { f = f0;
if (l < f) l = f; }
509 if (l > lx) { l = lx;
if (f > lx) f = lx; }
513 int l1 = f-f0;
while (l1--) *elx++ = 0.0;
514 l1 = l-f;
while (l1--) *elx++ /= *eld++;
515 lx -= l;
while (lx--) *elx++ = 0.0;
523 int f = mrc1.
skip;
int f0 = mrc.
skip;
525 if (f < f0) { f = f0;
if (l < f) l = f; }
526 if (l > lx) { l = lx;
if (f > lx) f = lx; }
530 int l1 = f-f0;
while (l1--) *elx++ = 0.0;
531 l1 = l-f;
while (l1--) *elx++ /= eldv;
532 lx -= l;
while (lx--) *elx++ = 0.0;
540 Real* elx = data;
const double* ely = r+skip; r += length;
541 int l = storage;
while (l--) *elx++ = (
Real)*ely++;
548 Real* elx = data;
const float* ely = r+skip; r += length;
549 int l = storage;
while (l--) *elx++ = (
Real)*ely++;
556 Real* elx = data;
const int* ely = r+skip; r += length;
557 int l = storage;
while (l--) *elx++ = (
Real)*ely++;
563 REPORT Real* elx = data;
int l = storage;
while (l--) *elx++ = r;
569 REPORT Real* elx = data;
int l = storage;
while (l--) *elx++ = 0;
575 REPORT Real* elx = data;
int l = storage;
while (l--) *elx++ *= r;
582 Real* elx = data;
int l = storage;
while (l--) *elx++ += r;
589 while (l--) sum += fabs(*elx++);
599 Real* elx = data;
int l = storage;
int li = -1;
600 while (l--) {
Real f = fabs(*elx++);
if (r <= f) { r = f; li = l; } }
601 i = (li >= 0) ? storage - li + skip : 0;
609 Real* elx = data;
int l = storage;
int li = -1;
610 while (l--) {
Real f = fabs(*elx++);
if (r >= f) { r = f; li = l; } }
611 i = (li >= 0) ? storage - li + skip : 0;
619 Real* elx = data;
int l = storage;
int li = -1;
620 while (l--) {
Real f = *elx++;
if (r <= f) { r = f; li = l; } }
621 i = (li >= 0) ? storage - li + skip : 0;
629 Real* elx = data;
int l = storage;
int li = -1;
630 while (l--) {
Real f = *elx++;
if (r >= f) { r = f; li = l; } }
631 i = (li >= 0) ? storage - li + skip : 0;
639 while (l--) sum += *elx++;
645 mrc.
length = l1;
int d = skip - skip1;
646 if (d<0) { mrc.
skip = 0; mrc.
data = data -
d; }
648 d = skip + storage - skip1;
649 d = ((l1 <
d) ? l1 : d) - mrc.
skip; mrc.
storage = (d < 0) ? 0 : d;
Real DotProd(const MatrixRowCol &mrc1, const MatrixRowCol &mrc2)
void Copy(const MatrixRowCol &)
void NegAdd(const MatrixRowCol &, Real)
Miscellaneous exception (details in character string).
void KP(const MatrixRowCol &, const MatrixRowCol &)
void RevSub(const MatrixRowCol &)
void Add(const MatrixRowCol &)
void ConCat(const MatrixRowCol &, const MatrixRowCol &)
void AddScaled(const MatrixRowCol &, Real)
void SubRowCol(MatrixRowCol &, int, int) const
void CopyCheck(const MatrixRowCol &)
void Negate(const MatrixRowCol &)
void Multiply(const MatrixRowCol &)
Real Maximum1(Real r, int &i)
void Sub(const MatrixRowCol &)
Real MaximumAbsoluteValue1(Real r, int &i)
void Solver(MatrixColX &, const MatrixColX &)
Real sum(const BaseMatrix &B)
void Solver(MatrixColX &, const MatrixColX &)
Real MinimumAbsoluteValue1(Real r, int &i)
void Inject(const MatrixRowCol &)
Real Minimum1(Real r, int &i)