18 template <
class T,
class ST>
24 template <
class T,
class ST>
31 template <
class T,
class ST>
36 template <
class T,
class ST>
39 const T& beta_old,
const T& beta_cur,
const T& alpha,
SGVector<ST>& zeta_sh_new)
45 ST numer=zeta_sh_old[i]*zeta_sh_cur[i]*beta_old;
47 ST denom=beta_cur*alpha*(zeta_sh_old[i]-zeta_sh_cur[i])
48 +beta_old*zeta_sh_old[i]*(1.0-beta_cur*shifts[i]);
51 if (denom==static_cast<ST>(0.0))
54 zeta_sh_new[i]=numer/denom;
58 template <
class T,
class ST>
67 ST numer=beta_cur*zeta_sh_new[i];
68 ST denom=zeta_sh_cur[i];
71 if (denom==static_cast<ST>(0.0))
74 beta_sh_cur[i]=numer/denom;
78 template <
class T,
class ST>
87 ST numer=alpha*zeta_sh_cur[i]*beta_sh_old[i];
88 ST denom=zeta_sh_old[i]*beta_old;
91 if (denom==static_cast<ST>(0.0))
94 alpha_sh[i]=numer/denom;
static const float64_t MACHINE_EPSILON
void compute_zeta_sh_new(const SGVector< ST > &zeta_sh_old, const SGVector< ST > &zeta_sh_cur, const SGVector< ST > &shifts, const T &beta_old, const T &beta_cur, const T &alpha, SGVector< ST > &zeta_sh_new)
CIterativeShiftedLinearFamilySolver()
void compute_beta_sh(const SGVector< ST > &zeta_sh_new, const SGVector< ST > &zeta_sh_cur, const T &beta_cur, SGVector< ST > &beta_sh)
abstract template base for all iterative linear solvers such as conjugate gradient (CG) solvers...
all of classes and functions are contained in the shogun namespace
virtual ~CIterativeShiftedLinearFamilySolver()
void compute_alpha_sh(const SGVector< ST > &zeta_sh_cur, const SGVector< ST > &zeta_sh_old, const SGVector< ST > &beta_sh_old, const T &beta_old, const T &alpha, SGVector< ST > &alpha_sh)
abstract template base for CG based solvers to the solution of shifted linear systems of the form fo...