16 __exp<basic_srmatrix<float>,
float>
21 tint nR = 0, nI = 0, nQ = 0, nJ = 0;
26 const float* pd = mArg._pd();
34 SMEXPC (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), &tol, &nR, &nI, &nQ, &nJ);
38 const tint issymm = 0;
39 float work_dummy = 0.F;
40 const tint lwork_dummy = 0;
42 SMEXP (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), m, m._pld(),
43 vR, vI, &nR, &nI, &nQ, &nJ, &issymm, &work_dummy, &lwork_dummy);
48 __exp<basic_srmatrix<double>,
double>
53 tint nR = 0, nI = 0, nQ = 0, nJ = 0;
58 const double* pd = mArg._pd();
66 DMEXPC (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), &tol, &nR, &nI, &nQ, &nJ);
70 const tint issymm = 0;
71 double work_dummy = 0.;
72 const tint lwork_dummy = 0;
74 DMEXP (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), m, m._pld(),
75 vR, vI, &nR, &nI, &nQ, &nJ, &issymm, &work_dummy, &lwork_dummy);
80 __exp_symm<basic_srsmatrix<float>,
float>
85 tint nR = 0, nI = 0, nQ = 0, nJ = 0;
90 const float* pd = mArg._pd();
98 SMEXPC (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), &tol, &nR, &nI, &nQ, &nJ);
102 const tint issymm = 1;
103 const tint lwork = 64 * nM;
106 SMEXP (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), m, m._pld(),
107 vR, vI, &nR, &nI, &nQ, &nJ, &issymm, work, &lwork);
112 __exp_symm<basic_srsmatrix<double>,
double>
117 tint nR = 0, nI = 0, nQ = 0, nJ = 0;
122 const double* pd = mArg._pd();
130 DMEXPC (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), &tol, &nR, &nI, &nQ, &nJ);
134 const tint issymm = 1;
135 const tint lwork = 64 * nM;
138 DMEXP (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), m, m._pld(),
139 vR, vI, &nR, &nI, &nQ, &nJ, &issymm, work, &lwork);
144 __cond_num<float, basic_srmatrix<float> >
154 const float rNorm = mA.
norminf();
155 SGETRF (&mnM, &mnM, mA, mA._pld(), iwork, &nOutInfo);
161 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
164 &mnM, mA, mA._pld(), &rNorm, &dCond, work, iwork, &nOutInfo);
170 __cond_num<double, basic_srmatrix<double> >
180 const double rNorm = mA.
norminf();
181 DGETRF (&mnM, &mnM, mA, mA._pld(), iwork, &nOutInfo);
187 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
190 &mnM, mA, mA._pld(), &rNorm, &dCond, work, iwork, &nOutInfo);
196 __inv<basic_srmatrix<float> >
204 if (_abs (mArg(
CVM0,
CVM0)) <= basic_cvmMachMin<float>()) {
217 SGETRI (&mnM, m, m._pld(), nPivots, &dWork, &lWork, &nOutInfo);
219 lWork =
static_cast<tint>(dWork);
222 SGETRI (&mnM, m, m._pld(), nPivots, vWork, &lWork, &nOutInfo);
230 __inv<basic_srmatrix<double> >
239 if (_abs (mArg(
CVM0,
CVM0)) <= basic_cvmMachMin<double>()) {
252 DGETRI (&mnM, m, m._pld(), nPivots, &dWork, &lWork, &nOutInfo);
254 lWork =
static_cast<tint>(dWork);
257 DGETRI (&mnM, m, m._pld(), nPivots, vWork, &lWork, &nOutInfo);
265 __polynom<float, basic_rvector<float> >
269 SPOLY (&mnM, pd, &ldA, v._psize(), v, mpd, &ldP, vWork);
274 __polynom<double, basic_rvector<double> >
278 DPOLY (&mnM, pd, &ldA, v._psize(), v, mpd, &ldP, vWork);
285 __solve<float, float, basic_srmatrix<float> >
288 const float* pB,
tint ldB,
291 const float* pLU,
const tint* pPivots,
int transp_mode)
throw (
cvmexception)
294 const bool bGivenLU = pLU !=
nullptr && pPivots !=
nullptr;
301 const char* transp = transp_mode == 0 ? Chars::pN() : Chars::pT();
303 if (bGivenLU) nPivots.
assign (pPivots);
316 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
319 &mnM, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
323 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
332 vFerr, vBerr, vWork, iWork, &nOutInfo);
340 __solve<double, double, basic_srmatrix<double> >
343 const double* pB,
tint ldB,
344 double* pX,
tint ldX,
346 const double* pLU,
const tint* pPivots,
int transp_mode)
throw (
cvmexception)
349 const bool bGivenLU = pLU !=
nullptr && pPivots !=
nullptr;
356 const char* transp = transp_mode == 0 ? Chars::pN() : Chars::pT();
358 if (bGivenLU) nPivots.
assign (pPivots);
371 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
374 &mnM, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
378 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
387 vFerr, vBerr, vWork, iWork, &nOutInfo);
395 __solve<float, float, basic_srbmatrix<float> >
398 const float* pB,
tint ldB,
401 const float* pLU,
const tint* pPivots,
int transp_mode)
throw (
cvmexception)
406 const bool bGivenLU = pLU !=
nullptr && pPivots !=
nullptr;
413 const char* transp = transp_mode == 0 ? Chars::pN() : Chars::pT();
415 if (bGivenLU) nPivots.
assign (pPivots);
428 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
431 &mnM, &mnKL, &mnKU, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
435 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
438 &mnM, &mnKL, &mnKU, &nrhs,
444 vFerr, vBerr, vWork, iWork, &nOutInfo);
452 __solve<double, double, basic_srbmatrix<double> >
455 const double* pB,
tint ldB,
456 double* pX,
tint ldX,
458 const double* pLU,
const tint* pPivots,
int transp_mode)
throw (
cvmexception)
463 const bool bGivenLU = pLU !=
nullptr && pPivots !=
nullptr;
470 const char* transp = transp_mode == 0 ? Chars::pN() : Chars::pT();
472 if (bGivenLU) nPivots.
assign (pPivots);
485 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
488 &mnM, &mnKL, &mnKU, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
492 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
495 &mnM, &mnKL, &mnKU, &nrhs,
501 vFerr, vBerr, vWork, iWork, &nOutInfo);
511 __solve<float, float, basic_srsmatrix<float> >
514 const float* pB,
tint ldB,
520 const bool bCholeskyGiven = pLU !=
nullptr && pPivots ==
nullptr;
521 const bool bBunchKaufmanGiven = pLU !=
nullptr && pPivots !=
nullptr;
522 const bool bCalc = !bCholeskyGiven && !bBunchKaufmanGiven;
523 bool bPositiveDefinite = bCholeskyGiven;
532 if (bBunchKaufmanGiven) nPivots.
assign (pPivots);
536 mLU._factorize (m, nPivots, bPositiveDefinite);
544 if (bPositiveDefinite)
547 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
550 &nM, &nrhs, mLU, mLU._pld(), pX, &ldX, &nOutInfo);
554 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
563 vWork, iWork, &nOutInfo);
570 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
573 &nM, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
577 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
587 vWork, iWork, &nOutInfo);
596 __solve<double, double, basic_srsmatrix<double> >
599 const double* pB,
tint ldB,
600 double* pX,
tint ldX,
605 const bool bCholeskyGiven = pLU !=
nullptr && pPivots ==
nullptr;
606 const bool bBunchKaufmanGiven = pLU !=
nullptr && pPivots !=
nullptr;
607 const bool bCalc = !bCholeskyGiven && !bBunchKaufmanGiven;
608 bool bPositiveDefinite = bCholeskyGiven;
617 if (bBunchKaufmanGiven) nPivots.
assign (pPivots);
621 mLU._factorize (m, nPivots, bPositiveDefinite);
629 if (bPositiveDefinite)
632 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
635 &nM, &nrhs, mLU, mLU._pld(), pX, &ldX, &nOutInfo);
639 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
648 vWork, iWork, &nOutInfo);
654 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
657 &nM, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
661 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
671 vWork, iWork, &nOutInfo);
680 __inv<basic_srsmatrix<float> >
689 if (_abs (mArg(
CVM0,
CVM0)) <= basic_cvmMachMin<float>()) {
696 bool bPositiveDefinite =
false;
700 m._factorize (mArg, nPivots, bPositiveDefinite);
702 if (bPositiveDefinite)
705 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
708 &nM, m, m._pld(), &nOutInfo);
716 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
719 &nM, m, m._pld(), nPivots, vWork, &nOutInfo);
729 __inv<basic_srsmatrix<double> >
738 if (_abs (mArg(
CVM0,
CVM0)) <= basic_cvmMachMin<double>()) {
745 bool bPositiveDefinite =
false;
749 m._factorize (mArg, nPivots, bPositiveDefinite);
751 if (bPositiveDefinite)
754 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
757 &nM, m, m._pld(), &nOutInfo);
765 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
768 &nM, m, m._pld(), nPivots, vWork, &nOutInfo);