16 __exp<basic_scmatrix<float, std::complex<float> >,
float>
21 tint nR = 0, nI = 0, nQ = 0, nJ = 0;
26 const std::complex<float>* pd = mArg._pd();
34 CMEXPC (&mnM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), &tol, &nR, &nI, &nQ, &nJ);
38 const tint issymm = 0;
39 std::complex<float> work_dummy(0.F);
40 const tint lwork_dummy = 0;
42 CMEXP (&mnM, 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_scmatrix<double, std::complex<double> >,
double>
53 tint nR = 0, nI = 0, nQ = 0, nJ = 0;
58 const std::complex<double>* pd = mArg._pd();
66 ZMEXPC (&mnM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), &tol, &nR, &nI, &nQ, &nJ);
70 const tint issymm = 0;
71 std::complex<double> work_dummy(0.);
72 const tint lwork_dummy = 0;
74 ZMEXP (&mnM, 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_schmatrix<float, std::complex<float> >,
float>
85 tint nR = 0, nI = 0, nQ = 0, nJ = 0;
90 const std::complex<float>* pd = mArg._pd();
98 CMEXPC (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), &tol, &nR, &nI, &nQ, &nJ);
102 const tint ishem = 1;
103 const tint lwork = 64 * nM;
106 CMEXP (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), m, m._pld(),
107 vR, vI, &nR, &nI, &nQ, &nJ, &ishem, work, &lwork);
112 __exp_symm<basic_schmatrix<double, std::complex<double> >,
double>
117 tint nR = 0, nI = 0, nQ = 0, nJ = 0;
122 const std::complex<double>* pd = mArg._pd();
130 ZMEXPC (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), &tol, &nR, &nI, &nQ, &nJ);
134 const tint ishem = 1;
135 const tint lwork = 64 * nM;
138 ZMEXP (&nM, pd, pd == m.
get() ? mTmp._pld() : mArg._pldm(), m, m._pld(),
139 vR, vI, &nR, &nI, &nQ, &nJ, &ishem, work, &lwork);
144 __cond_num<float, basic_scmatrix<float, std::complex<float> > >
155 const float rNorm = mA.
norminf();
156 CGETRF (&mnM, &mnM, mA, mA._pld(), iwork, &nOutInfo);
161 #if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
166 &mnM, mA, mA._pld(), &rNorm, &dCond, work, rwork, &nOutInfo);
172 __cond_num<double, basic_scmatrix<double, std::complex<double> > >
183 const double rNorm = mA.
norminf();
184 ZGETRF (&mnM, &mnM, mA, mA._pld(), iwork, &nOutInfo);
189 #if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
194 &mnM, mA, mA._pld(), &rNorm, &dCond, work, rwork, &nOutInfo);
200 __inv<basic_scmatrix<float, std::complex<float> > >
209 if (_abs (mArg(
CVM0,
CVM0)) <= basic_cvmMachMin<float>()) {
221 std::complex<float> dWork;
222 CGETRI (&mnM, m, m._pld(), nPivots, &dWork, &lWork, &nOutInfo);
224 lWork =
static_cast<tint>(dWork.real());
227 CGETRI (&mnM, m, m._pld(), nPivots, vWork, &lWork, &nOutInfo);
235 __inv<basic_scmatrix<double, std::complex<double> > >
244 if (_abs (mArg(
CVM0,
CVM0)) <= basic_cvmMachMin<double>()) {
256 std::complex<double> dWork;
257 ZGETRI (&mnM, m, m._pld(), nPivots, &dWork, &lWork, &nOutInfo);
258 lWork =
static_cast<tint>(dWork.real());
261 ZGETRI (&mnM, m, m._pld(), nPivots, vWork, &lWork, &nOutInfo);
269 __inv<basic_schmatrix<float, std::complex<float> > >
278 if (_abs (mArg(
CVM0,
CVM0)) <= basic_cvmMachMin<float>()) {
285 bool bPositiveDefinite =
false;
289 m._factorize (mArg, nPivots, bPositiveDefinite);
291 if (bPositiveDefinite)
294 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
297 &nM, m, m._pld(), &nOutInfo);
305 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
308 &nM, m, m._pld(), nPivots, vWork, &nOutInfo);
318 __inv<basic_schmatrix<double, std::complex<double> > >
327 if (_abs (mArg(
CVM0,
CVM0)) <= basic_cvmMachMin<double>()) {
334 bool bPositiveDefinite =
false;
338 m._factorize (mArg, nPivots, bPositiveDefinite);
340 if (bPositiveDefinite)
343 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
346 &nM, m, m._pld(), &nOutInfo);
354 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
357 &nM, m, m._pld(), nPivots, vWork, &nOutInfo);
369 (std::complex<float>* mpd,
tint ldP,
371 const std::complex<float>* pd,
tint ldA,
375 CPOLY (&mnM, pd, &ldA, v._psize(), v, mpd, &ldP, vWork);
381 (std::complex<double>* mpd,
tint ldP,
383 const std::complex<double>* pd,
tint ldA,
387 ZPOLY (&mnM, pd, &ldA, v._psize(), v, mpd, &ldP, vWork);
398 const std::complex<float>* pB,
tint ldB,
399 std::complex<float>* pX,
tint ldX,
401 const std::complex<float>* pLU,
const tint* pPivots,
int transp_mode)
throw (
cvmexception)
404 const bool bGivenLU = pLU !=
nullptr && pPivots !=
nullptr;
412 const char* transp = transp_mode == 0 ? Chars::pN() : (transp_mode == 1 ? Chars::pT() : Chars::pC());
414 if (bGivenLU) nPivots.assign (pPivots);
422 mLU = m.low_up (nPivots);
427 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
430 &mnM, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
435 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
444 vFerr, vBerr, vWork, rWork, &nOutInfo);
447 dErr = vFerr.norminf();
455 const std::complex<double>* pB,
tint ldB,
456 std::complex<double>* pX,
tint ldX,
458 const std::complex<double>* pLU,
const tint* pPivots,
int transp_mode)
throw (
cvmexception)
461 const bool bGivenLU = pLU !=
nullptr && pPivots !=
nullptr;
469 const char* transp = transp_mode == 0 ? Chars::pN() : (transp_mode == 1 ? Chars::pT() : Chars::pC());
471 if (bGivenLU) nPivots.assign (pPivots);
479 mLU = m.low_up (nPivots);
484 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
487 &mnM, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
492 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
501 vFerr, vBerr, vWork, rWork, &nOutInfo);
504 dErr = vFerr.norminf();
512 const std::complex<float>* pB,
tint ldB,
513 std::complex<float>* pX,
tint ldX,
515 const std::complex<float>* pLU,
const tint* pPivots,
int transp_mode)
throw (
cvmexception)
518 const tint mnKL = m.lsize();
519 const tint mnKU = m.usize();
520 const bool bGivenLU = pLU !=
nullptr && pPivots !=
nullptr;
528 const char* transp = transp_mode == 0 ? Chars::pN() : (transp_mode == 1 ? Chars::pT() : Chars::pC());
530 if (bGivenLU) nPivots.assign (pPivots);
538 mLU = m.low_up (nPivots);
543 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
546 &mnM, &mnKL, &mnKU, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
551 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
554 &mnM, &mnKL, &mnKU, &nrhs,
560 vFerr, vBerr, vWork, rWork, &nOutInfo);
563 dErr = vFerr.norminf();
571 const std::complex<double>* pB,
tint ldB,
572 std::complex<double>* pX,
tint ldX,
574 const std::complex<double>* pLU,
const tint* pPivots,
int transp_mode)
throw (
cvmexception)
577 const tint mnKL = m.lsize();
578 const tint mnKU = m.usize();
579 const bool bGivenLU = pLU !=
nullptr && pPivots !=
nullptr;
587 const char* transp = transp_mode == 0 ? Chars::pN() : (transp_mode == 1 ? Chars::pT() : Chars::pC());
589 if (bGivenLU) nPivots.assign (pPivots);
597 mLU = m.low_up (nPivots);
602 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
605 &mnM, &mnKL, &mnKU, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
610 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
613 &mnM, &mnKL, &mnKU, &nrhs,
619 vFerr, vBerr, vWork, rWork, &nOutInfo);
622 dErr = vFerr.norminf();
633 const std::complex<float>* pB,
tint ldB,
634 std::complex<float>* pX,
tint ldX,
636 const std::complex<float>* pLU,
const tint* pPivots, int)
throw (
cvmexception)
639 const bool bCholeskyGiven = pLU !=
nullptr && pPivots ==
nullptr;
640 const bool bBunchKaufmanGiven = pLU !=
nullptr && pPivots !=
nullptr;
641 const bool bCalc = !bCholeskyGiven && !bBunchKaufmanGiven;
642 bool bPositiveDefinite = bCholeskyGiven;
651 if (bBunchKaufmanGiven) nPivots.assign (pPivots);
655 mLU._factorize (m, nPivots, bPositiveDefinite);
663 if (bPositiveDefinite)
666 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
669 &nM, &nrhs, mLU, mLU._pld(), pX, &ldX, &nOutInfo);
673 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
682 vWork, vrWork, &nOutInfo);
688 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
691 &nM, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
695 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
705 vWork, vrWork, &nOutInfo);
709 dErr = vFerr.norminf();
717 const std::complex<double>* pB,
tint ldB,
718 std::complex<double>* pX,
tint ldX,
720 const std::complex<double>* pLU,
const tint* pPivots, int)
throw (
cvmexception)
723 const bool bCholeskyGiven = pLU !=
nullptr && pPivots ==
nullptr;
724 const bool bBunchKaufmanGiven = pLU !=
nullptr && pPivots !=
nullptr;
725 const bool bCalc = !bCholeskyGiven && !bBunchKaufmanGiven;
726 bool bPositiveDefinite = bCholeskyGiven;
735 if (bBunchKaufmanGiven) nPivots.assign (pPivots);
739 mLU._factorize (m, nPivots, bPositiveDefinite);
747 if (bPositiveDefinite)
750 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
753 &nM, &nrhs, mLU, mLU._pld(), pX, &ldX, &nOutInfo);
757 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
766 vWork, vrWork, &nOutInfo);
772 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
775 &nM, &nrhs, mLU, mLU._pld(), nPivots, pX, &ldX, &nOutInfo);
779 #
if defined (CVM_PASS_STRING_LENGTH_TO_FTN_SUBROUTINES)
789 vWork, vrWork, &nOutInfo);
793 dErr = vFerr.norminf();