Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhuling committed Jan 10, 2019
1 parent 7b8d119 commit 7be7bd2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions src/ADMMogLassoTall.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ class ADMMogLassoTall: public FADMMBase<Eigen::VectorXd, Eigen::VectorXd, Eigen:
// precompute LLT decomposition of (X'X + rho * D'D)
solver.compute(matToSolve.selfadjointView<Eigen::Lower>());

eps_primal = 0.0;
eps_dual = 0.0;
eps_primal = 1e-15;
eps_dual = 1e-15;
resid_primal = 1e99;
resid_dual = 1e99;

Expand Down Expand Up @@ -365,10 +365,10 @@ class ADMMogLassoTall: public FADMMBase<Eigen::VectorXd, Eigen::VectorXd, Eigen:
// precompute LLT decomposition of (X'X + rho * C'C)
solver.compute(matToSolve.selfadjointView<Eigen::Lower>());

eps_primal = 0.0;
eps_dual = 0.0;
resid_primal = 1e30;
resid_dual = 1e30;
eps_primal = 1e-15;
eps_dual = 1e-15;
resid_primal = 1e99;
resid_dual = 1e99;

// adj_a = 1.0;
// adj_c = 9999;
Expand Down
26 changes: 13 additions & 13 deletions src/FADMMBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class FADMMBase
{
protected:
typedef typename VecTypeNu::RealScalar Yscalar;

double eps_primal; // tolerance for primal residual
double eps_dual; // tolerance for dual residual

double resid_primal; // primal residual
double resid_dual; // dual residual

const int dim_main; // dimension of x
const int dim_aux; // dimension of z
Expand All @@ -36,12 +42,6 @@ class FADMMBase
const double eps_abs; // absolute tolerance
const double eps_rel; // relative tolerance

double eps_primal; // tolerance for primal residual
double eps_dual; // tolerance for dual residual

double resid_primal; // primal residual
double resid_dual; // dual residual

virtual void A_mult (VecTypeNu &res, VecTypeBeta &x) = 0; // operation res -> Ax, x can be overwritten
virtual void At_mult(VecTypeNu &res, VecTypeNu &y) = 0; // operation res -> A'y, y can be overwritten
virtual void B_mult (VecTypeNu &res, VecTypeGamma &z) = 0; // operation res -> Bz, z can be overwritten
Expand Down Expand Up @@ -105,14 +105,14 @@ class FADMMBase
// increase or decrease rho in iterations
virtual void update_rho()
{
if(resid_primal / eps_primal > 10 * resid_dual / eps_dual)
if(resid_primal / eps_primal > 10.0 * resid_dual / eps_dual)
{
rho *= 2;
rho *= 2.0;
rho_changed_action();
}
else if(resid_dual / eps_dual > 10 * resid_primal / eps_primal)
else if(resid_dual / eps_dual > 10.0 * resid_primal / eps_primal)
{
rho /= 2;
rho /= 2.0;
rho_changed_action();
}

Expand Down Expand Up @@ -169,14 +169,14 @@ class FADMMBase
public:
FADMMBase(int n_, int m_, int p_,
double eps_abs_ = 1e-6, double eps_rel_ = 1e-6) :
eps_primal(1e-15), eps_dual(1e-15),
resid_primal(1e99), resid_dual(1e99),
dim_main(n_), dim_aux(m_), dim_dual(p_),
main_beta(n_), aux_gamma(m_), dual_nu(p_), // allocate space but do not set values
adj_gamma(m_), adj_nu(p_),
old_gamma(m_), old_nu(p_),
adj_a(1.0), adj_c(1e99),
eps_abs(eps_abs_), eps_rel(eps_rel_),
eps_primal(0.0), eps_dual(0.0),
resid_primal(1e99), resid_dual(1e99)
eps_abs(eps_abs_), eps_rel(eps_rel_)

{}

Expand Down

0 comments on commit 7be7bd2

Please sign in to comment.