28 #include "rmatrix.hpp" 30 #include "rmatrix.inl" 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);
83 throw(OP_WITH_WRONG_DIM)
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);
100 #if(CXSC_INDEX_CHECK) 101 throw(OP_WITH_WRONG_DIM)
106 #if(CXSC_INDEX_CHECK) 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);
118 #if(CXSC_INDEX_CHECK) 119 throw(OP_WITH_WRONG_DIM)
124 #if(CXSC_INDEX_CHECK) 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);
136 #if(CXSC_INDEX_CHECK) 137 throw(OP_WITH_WRONG_DIM)
142 #if(CXSC_INDEX_CHECK) 143 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rmatrix_subv &, const rmatrix_subv &)"));
154 #if(CXSC_INDEX_CHECK) 155 throw(OP_WITH_WRONG_DIM)
160 #if(CXSC_INDEX_CHECK) 161 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rvector&, const rmatrix_subv &)"));
172 #if(CXSC_INDEX_CHECK) 173 throw(OP_WITH_WRONG_DIM)
178 #if(CXSC_INDEX_CHECK) 179 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rmatrix_subv&, const rvector &)"));
190 #if(CXSC_INDEX_CHECK) 191 throw(OP_WITH_WRONG_DIM)
196 #if(CXSC_INDEX_CHECK) 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);
209 #if(CXSC_INDEX_CHECK) 210 throw(OP_WITH_WRONG_DIM)
215 #if(CXSC_INDEX_CHECK) 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);
227 #if(CXSC_INDEX_CHECK) 228 throw(OP_WITH_WRONG_DIM)
233 #if(CXSC_INDEX_CHECK) 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);
245 #if(CXSC_INDEX_CHECK) 246 throw(OP_WITH_WRONG_DIM)
251 #if(CXSC_INDEX_CHECK) 252 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const rmatrix_subv &)"));
261 #if(CXSC_INDEX_CHECK) 262 throw(OP_WITH_WRONG_DIM)
267 #if(CXSC_INDEX_CHECK) 268 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rvector &, const rmatrix_subv &)"));
277 #if(CXSC_INDEX_CHECK) 278 throw(OP_WITH_WRONG_DIM)
283 #if(CXSC_INDEX_CHECK) 284 if(
VecLen(rv1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const rvector &)"));
294 #if(CXSC_INDEX_CHECK) 295 throw(OP_WITH_WRONG_DIM)
300 #if(CXSC_INDEX_CHECK) 301 if(
VecLen(sl)!=
VecLen(sv)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(dotprecision&, const rvector_slice &, const rmatrix_subv &)"));
312 #if(CXSC_INDEX_CHECK) 313 throw(OP_WITH_WRONG_DIM)
318 #if(CXSC_INDEX_CHECK) 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);
331 #if(CXSC_INDEX_CHECK) 332 throw(OP_WITH_WRONG_DIM)
337 #if(CXSC_INDEX_CHECK) 338 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rvector_slice&, const rmatrix_subv &)"));
348 #if(CXSC_INDEX_CHECK) 349 throw(OP_WITH_WRONG_DIM)
354 #if(CXSC_INDEX_CHECK) 355 if(
VecLen(sl1)!=
VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rvector_slice &, const rmatrix_subv &)"));
365 #if(CXSC_INDEX_CHECK) 366 throw(OP_WITH_WRONG_DIM)
371 #if(CXSC_INDEX_CHECK) 372 if(
VecLen(mv)!=
VecLen(vs)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(dotprecision&, const rmatrix_subv &, const rvector_slice &)"));
384 #if(CXSC_INDEX_CHECK) 385 throw(OP_WITH_WRONG_DIM)
390 #if(CXSC_INDEX_CHECK) 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);
403 #if(CXSC_INDEX_CHECK) 404 throw(OP_WITH_WRONG_DIM)
409 #if(CXSC_INDEX_CHECK) 410 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(idotprecision&, const rmatrix_subv&, const rvector_slice &)"));
420 #if(CXSC_INDEX_CHECK) 421 throw(OP_WITH_WRONG_DIM)
426 #if(CXSC_INDEX_CHECK) 427 if(
VecLen(rv1)!=
VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM(
"void accumulate(cidotprecision&, const rmatrix_subv &, const rvector_slice &)"));
void set_k(unsigned int i)
Set precision for computation of dot products.
The Data Type idotprecision.
The Data Type dotprecision.
int Lb(const cimatrix &rm, const int &i)
Returns the lower bound index.
The namespace cxsc, providing all functionality of the class library C-XSC.
cimatrix_subv Col(cimatrix &m, const int &i)
Returns one column of the matrix as a vector.
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...
void DoubleSize(cimatrix &A)
Doubles the size of the matrix.
The Data Type cidotprecision.
cimatrix Id(const cimatrix &A)
Returns the Identity matrix.
The Data Type rvector_slice.
The Data Type rmatrix_subv.
The Data Type cdotprecision.
void Resize(cimatrix &A)
Resizes the matrix.
cimatrix_subv Row(cimatrix &m, const int &i)
Returns one row of the matrix as a vector.
int get_k() const
Get currently set precision for computation of dot products.
int get_k() const
Get currently set precision for computation of dot products.
rmatrix CompMat(const cimatrix &A)
Returns Ostrowski's comparison matrix.
int Ub(const cimatrix &rm, const int &i)
Returns the upper bound index.
cimatrix transp(const cimatrix &A)
Returns the transposed matrix.
ivector abs(const cimatrix_subv &mv)
Returns the absolute value of the matrix.