40 for(
int i=
Lb(A,1) ; i<=
Ub(A,1) ; i++) {
41 for(
int j=
Lb(A,2) ; j<=
Ub(A,2) ; j++) {
42 if(i-
Lb(A,1) == j-
Lb(A,2))
43 M[i][j] =
abs(A[i][j]);
45 M[i][j] = -
abs(A[i][j]);
55 int lbi =
Lb(A,1), ubi =
Ub(A,1);
56 int lbj =
Lb(A,2), ubj =
Ub(A,2);
59 for (i = lbi; i <= ubi; i++)
60 for (j = lbj; j <= ubj; j++)
61 B[i][j] = (i==j) ? 1.0 : 0.0;
70 for (n =
Lb(A,1); n <=
Ub(A,1); n++)
Col(res,n) =
Row(A,n);
89 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(dotprecision&, const rmatrix_subv &, const rmatrix_subv &)"));
95 addDot_op(dp,rv1,rv2);
107 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(dotprecision&, const rvector &, const rmatrix_subv &)"));
113 addDot_op(dp,rv1,rv2);
125 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(dotprecision&, const rmatrix_subv &, const rvector &)"));
131 addDot_op(dp,rv1,rv2);
143 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rmatrix_subv &, const rmatrix_subv &)"));
161 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rvector&, const rmatrix_subv &)"));
179 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rmatrix_subv&, const rvector &)"));
197 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cdotprecision&, const rmatrix_subv&, const rmatrix_subv &)"));
199 addDot(Re(dp),rv1,rv2);
204 addDot_op(Re(dp),rv1,rv2);
216 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cdotprecision&, const rvector&, const rmatrix_subv &)"));
218 addDot(Re(dp),rv1,rv2);
223 addDot_op(Re(dp),rv1,rv2);
234 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cdotprecision&, const rmatrix_subv&, const rvector &)"));
236 addDot(Re(dp),rv1,rv2);
241 addDot_op(Re(dp),rv1,rv2);
252 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const rmatrix_subv &)"));
268 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rvector &, const rmatrix_subv &)"));
284 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const rvector &)"));
301 if(
VecLen(sl)!=
VecLen(sv)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(dotprecision&, const rvector_slice &, const rmatrix_subv &)"));
319 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cdotprecision&, const rvector_slice&, const rmatrix_subv &)"));
321 addDot(Re(dp),sl1,rv2);
326 addDot_op(Re(dp),sl1,rv2);
338 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rvector_slice&, const rmatrix_subv &)"));
355 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rvector_slice &, const rmatrix_subv &)"));
372 if(
VecLen(mv)!=
VecLen(vs)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(dotprecision&, const rmatrix_subv &, const rvector_slice &)"));
391 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cdotprecision&, const rmatrix_subv&, const rvector_slice &)"));
393 addDot(Re(dp),rv1,sl2);
398 addDot_op(Re(dp),rv1,sl2);
410 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rmatrix_subv&, const rvector_slice &)"));
427 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const rvector_slice &)"));
The Data Type cdotprecision.
The Data Type cidotprecision.
int get_k() const
Get currently set precision for computation of dot products.
The Data Type dotprecision.
void set_k(unsigned int i)
Set precision for computation of dot products.
The Data Type idotprecision.
int get_k() const
Get currently set precision for computation of dot products.
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.
void accumulate_approx(cdotprecision &dp, const cmatrix_subv &rv1, const cmatrix_subv &rv2)
The accurate scalar product of the last two arguments added to the value of the first argument (witho...
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.