28#include "cimatrix.hpp"
30#include "cimatrix.inl"
31#include "civecrmat.inl"
32#include "civeccmat.inl"
33#include "civecimat.inl"
36#include "cvecimat.inl"
37#include "iveccmat.inl"
38#include "cmatimat.inl"
48 for(
int i=
Lb(A,1) ; i<=
Ub(A,1) ; i++) {
49 for(
int j=
Lb(A,2) ; j<=
Ub(A,2) ; j++) {
50 if(i-
Lb(A,1) == j-
Lb(A,2))
51 M[i][j] = Inf(
abs(A[i][j]));
53 M[i][j] = -Sup(
abs(A[i][j]));
64 int lbi =
Lb(A,1), ubi =
Ub(A,1);
65 int lbj =
Lb(A,2), ubj =
Ub(A,2);
68 for (i = lbi; i <= ubi; i++)
69 for (j = lbj; j <= ubj; j++)
70 B[i][j] =
cinterval( (i==j) ? 1.0 : 0.0 );
79 for (n =
Lb(A,1); n <=
Ub(A,1); n++)
Col(res,n) =
Row(A,n);
98 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const cimatrix_subv &)"));
111 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const civector &, const cimatrix_subv &)"));
124 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const civector &)"));
137 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const civector_slice &, const cimatrix_subv &)"));
150 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const civector_slice &)"));
163 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const rmatrix_subv &)"));
169 addDot(tmp_re,Re(rv1),rv2);
170 addDot(tmp_im,Im(rv1),rv2);
182 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const rvector_slice &)"));
188 addDot(tmp_re,Re(rv1),sl2);
189 addDot(tmp_im,Im(rv1),sl2);
201 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const rvector &)"));
207 addDot(tmp_re,Re(rv1),rv2);
208 addDot(tmp_im,Im(rv1),rv2);
220 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const cimatrix_subv &)"));
226 addDot(tmp_re,rv1,Re(rv2));
227 addDot(tmp_im,rv1,Im(rv2));
239 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rvector_slice &, const cimatrix_subv &)"));
245 addDot(tmp_re,sl1,Re(rv2));
246 addDot(tmp_im,sl1,Im(rv2));
258 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rvector &, const cimatrix_subv &)"));
264 addDot(tmp_re,rv1,Re(rv2));
265 addDot(tmp_im,rv1,Im(rv2));
278 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const cmatrix_subv &)"));
291 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const cvector_slice &)"));
304 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const cvector &)"));
317 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cmatrix_subv &, const cimatrix_subv &)"));
330 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cvector_slice &, const cimatrix_subv &)"));
343 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cvector &, const cimatrix_subv &)"));
357 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const imatrix_subv &)"));
363 addDot(tmp_re,Re(rv1),rv2);
364 addDot(tmp_im,Im(rv1),rv2);
376 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const ivector_slice &)"));
382 addDot(tmp_re,Re(rv1),sl2);
383 addDot(tmp_im,Im(rv1),sl2);
395 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cimatrix_subv &, const ivector &)"));
401 addDot(tmp_re,Re(rv1),rv2);
402 addDot(tmp_im,Im(rv1),rv2);
414 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const cimatrix_subv &)"));
420 addDot(tmp_re,rv1,Re(rv2));
421 addDot(tmp_im,rv1,Im(rv2));
433 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const ivector_slice &, const cimatrix_subv &)"));
439 addDot(tmp_re,sl1,Re(rv2));
440 addDot(tmp_im,sl1,Im(rv2));
452 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const ivector &, const cimatrix_subv &)"));
458 addDot(tmp_re,rv1,Re(rv2));
459 addDot(tmp_im,rv1,Im(rv2));
471 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const civector &)"));
477 addDot(tmp_re,rv1,Re(rv2));
478 addDot(tmp_im,rv1,Im(rv2));
490 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const civector &, const rmatrix_subv &)"));
496 addDot(tmp_re,Re(rv1),rv2);
497 addDot(tmp_im,Im(rv1),rv2);
547 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const civector &)"));
553 addDot(tmp_re,rv1,Re(rv2));
554 addDot(tmp_im,rv1,Im(rv2));
566 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const civector &, const imatrix_subv &)"));
572 addDot(tmp_re,Re(rv1),rv2);
573 addDot(tmp_im,Im(rv1),rv2);
586 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const civector_slice &, const rmatrix_subv &)"));
592 addDot(tmp_re,rv1,Re(rv2));
593 addDot(tmp_im,rv1,Im(rv2));
605 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const civector_slice &, const imatrix_subv &)"));
611 addDot(tmp_re,Re(rv1),rv2);
612 addDot(tmp_im,Im(rv1),rv2);
624 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cmatrix_subv &, const civector &)"));
637 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const civector &, const cmatrix_subv &)"));
650 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cmatrix_subv &, const civector_slice &)"));
663 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const civector_slice &, const cmatrix_subv &)"));
676 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const cmatrix_subv &, const imatrix_subv &)"));
681 addDot(idot,Re(rv1),rv2);
682 SetRe(dp,Re(dp)+idot);
685 addDot(idot,Im(rv1),rv2);
686 SetIm(dp,Im(dp)+idot);
697 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const imatrix_subv &, const cmatrix_subv &)"));
702 addDot(idot,rv1,Re(rv2));
703 SetRe(dp,Re(dp)+idot);
706 addDot(idot,rv1,Im(rv2));
707 SetIm(dp,Im(dp)+idot);
The Data Type cidotprecision.
int get_k() const
Get currently set precision for computation of dot products.
The Data Type cimatrix_subv.
The Scalar Type cinterval.
The Data Type civector_slice.
The Data Type cmatrix_subv.
The Data Type cvector_slice.
The Data Type idotprecision.
void set_k(unsigned int i)
Set precision for computation of dot products.
The Data Type imatrix_subv.
The Data Type ivector_slice.
The Data Type rmatrix_subv.
The Data Type rvector_slice.
The namespace cxsc, providing all functionality of the class library C-XSC.
int VecLen(const scimatrix_subv &S)
Returns the length of the subvector.
cimatrix_subv Col(cimatrix &m, const int &i) noexcept
Returns one column of the matrix as a vector.
rmatrix CompMat(const cimatrix &A)
Returns Ostrowski's comparison matrix.
cimatrix transp(const cimatrix &A)
Returns the transposed matrix.
int Ub(const cimatrix &rm, const int &i) noexcept
Returns the upper bound index.
cimatrix_subv Row(cimatrix &m, const int &i) noexcept
Returns one row of the matrix as a vector.
void DoubleSize(cimatrix &A)
Doubles the size of the matrix.
cimatrix Id(const cimatrix &A)
Returns the Identity matrix.
ivector abs(const cimatrix_subv &mv) noexcept
Returns the absolute value of the matrix.
void Resize(cimatrix &A) noexcept
Resizes the matrix.
int Lb(const cimatrix &rm, const int &i) noexcept
Returns the lower bound index.