C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
28 #include "imatrix.hpp"
30 #include "imatrix.inl"
31 #include "ivecrmat.inl"
41 for(
int i=
Lb(A,1) ; i<=
Ub(A,1) ; i++) {
42 for(
int j=
Lb(A,2) ; j<=
Ub(A,2) ; j++) {
43 if(i-
Lb(A,1) == j-
Lb(A,2))
46 M[i][j] = -
AbsMax(A[i][j]);
57 int lbi =
Lb(A,1), ubi =
Ub(A,1);
58 int lbj =
Lb(A,2), ubj =
Ub(A,2);
61 for (i = lbi; i <= ubi; i++)
62 for (j = lbj; j <= ubj; j++)
63 B[i][j] =
interval( (i==j) ? 1.0 : 0.0 );
72 for (n =
Lb(A,1); n <=
Ub(A,1); n++)
Col(res,n) =
Row(A,n);
79 int i, l=
Lb(v), u=
Ub(v);
82 for (i = l; i <= u; i++)
105 #if(CXSC_INDEX_CHECK)
106 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const imatrix_subv &, imatrix_subv &)"));
112 #if(CXSC_INDEX_CHECK)
118 #if(CXSC_INDEX_CHECK)
119 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const ivector &, imatrix_subv &)"));
125 #if(CXSC_INDEX_CHECK)
131 #if(CXSC_INDEX_CHECK)
132 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const imatrix_subv &, ivector &)"));
139 #if(CXSC_INDEX_CHECK)
145 #if(CXSC_INDEX_CHECK)
146 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const ivector_slice &, imatrix_subv &)"));
152 #if(CXSC_INDEX_CHECK)
158 #if(CXSC_INDEX_CHECK)
159 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const imatrix_subv &, ivector_slice &)"));
165 #if(CXSC_INDEX_CHECK)
171 #if(CXSC_INDEX_CHECK)
172 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const imatrix_subv &)"));
181 #if(CXSC_INDEX_CHECK)
187 #if(CXSC_INDEX_CHECK)
188 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const ivector &, const imatrix_subv &)"));
197 #if(CXSC_INDEX_CHECK)
203 #if(CXSC_INDEX_CHECK)
204 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const ivector &)"));
213 #if(CXSC_INDEX_CHECK)
219 #if(CXSC_INDEX_CHECK)
220 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const ivector_slice &, const imatrix_subv &)"));
229 #if(CXSC_INDEX_CHECK)
235 #if(CXSC_INDEX_CHECK)
236 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const ivector_slice &)"));
245 #if(CXSC_INDEX_CHECK)
251 #if(CXSC_INDEX_CHECK)
252 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const rmatrix_subv &, imatrix_subv &)"));
258 #if(CXSC_INDEX_CHECK)
264 #if(CXSC_INDEX_CHECK)
265 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const rvector &, imatrix_subv &)"));
271 #if(CXSC_INDEX_CHECK)
277 #if(CXSC_INDEX_CHECK)
278 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const rvector_slice &, imatrix_subv &)"));
284 #if(CXSC_INDEX_CHECK)
290 #if(CXSC_INDEX_CHECK)
291 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const imatrix_subv &, rmatrix_subv &)"));
297 #if(CXSC_INDEX_CHECK)
303 #if(CXSC_INDEX_CHECK)
304 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const imatrix_subv &, rvector &)"));
310 #if(CXSC_INDEX_CHECK)
316 #if(CXSC_INDEX_CHECK)
317 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const imatrix_subv &, rvector_slice &)"));
323 #if(CXSC_INDEX_CHECK)
329 #if(CXSC_INDEX_CHECK)
330 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const imatrix_subv &)"));
339 #if(CXSC_INDEX_CHECK)
345 #if(CXSC_INDEX_CHECK)
346 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rvector &, const imatrix_subv &)"));
355 #if(CXSC_INDEX_CHECK)
361 #if(CXSC_INDEX_CHECK)
362 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rvector_slice&, const imatrix_subv &)"));
371 #if(CXSC_INDEX_CHECK)
377 #if(CXSC_INDEX_CHECK)
378 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const rmatrix_subv &)"));
387 #if(CXSC_INDEX_CHECK)
393 #if(CXSC_INDEX_CHECK)
394 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const rvector &)"));
403 #if(CXSC_INDEX_CHECK)
409 #if(CXSC_INDEX_CHECK)
410 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const rvector_slice &)"));
419 #if(CXSC_INDEX_CHECK)
425 #if(CXSC_INDEX_CHECK)
426 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const rmatrix_subv &, ivector &)"));
432 #if(CXSC_INDEX_CHECK)
438 #if(CXSC_INDEX_CHECK)
439 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const ivector &, rmatrix_subv &)"));
445 #if(CXSC_INDEX_CHECK)
451 #if(CXSC_INDEX_CHECK)
452 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const ivector &)"));
461 #if(CXSC_INDEX_CHECK)
467 #if(CXSC_INDEX_CHECK)
468 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const ivector &, const rmatrix_subv &)"));
477 #if(CXSC_INDEX_CHECK)
483 #if(CXSC_INDEX_CHECK)
484 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const rmatrix_subv &, ivector_slice &)"));
490 #if(CXSC_INDEX_CHECK)
496 #if(CXSC_INDEX_CHECK)
497 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision &, const ivector_slice &, rmatrix_subv &)"));
503 #if(CXSC_INDEX_CHECK)
509 #if(CXSC_INDEX_CHECK)
510 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const ivector_slice &)"));
519 #if(CXSC_INDEX_CHECK)
525 #if(CXSC_INDEX_CHECK)
526 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const ivector_slice &, const rmatrix_subv &)"));
real AbsMax(const interval &x)
Computes the greatest absolute value .
rmatrix CompMat(const cimatrix &A)
Returns Ostrowski's comparison matrix.
int get_k() const
Get currently set precision for computation of dot products.
The Data Type imatrix_subv.
int Ub(const cimatrix &rm, const int &i) noexcept
Returns the upper bound index.
The Scalar Type interval.
The Data Type idotprecision.
cimatrix_subv Col(cimatrix &m, const int &i) noexcept
Returns one column of the matrix as a vector.
The Data Type ivector_slice.
The Data Type rvector_slice.
int Lb(const cimatrix &rm, const int &i) noexcept
Returns the lower bound index.
void set_k(unsigned int i)
Set precision for computation of dot products.
The Data Type rmatrix_subv.
The Data Type cidotprecision.
The namespace cxsc, providing all functionality of the class library C-XSC.
void DoubleSize(cimatrix &A)
Doubles the size of the matrix.
cimatrix transp(const cimatrix &A)
Returns the transposed matrix.
real RelDiam(const interval &x)
Computes the relative diameter .
real AbsMin(const interval &x)
Computes the smallest absolute value .
cimatrix Id(const cimatrix &A)
Returns the Identity matrix.
void Resize(cimatrix &A) noexcept
Resizes the matrix.
cimatrix_subv Row(cimatrix &m, const int &i) noexcept
Returns one row of the matrix as a vector.
int VecLen(const scimatrix_subv &S)
Returns the length of the subvector.
real MaxRelDiam(const imatrix_subv &v)
Computes the relative diameter .