Skip to content

Commit

Permalink
fix(deps): update to libslope 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jolars committed Feb 6, 2024
1 parent 0872c25 commit bac6f93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/slope/constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @internal
* @file
* @brief Definitions of constants used in libslope
*/
#pragma once

const double EPSILON = 1e-10;
5 changes: 3 additions & 2 deletions src/slope/slope.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "cd.h"
#include "clusters.h"
#include "constants.h"
#include "helpers.h"
#include "math.h"
#include "objectives.h"
Expand Down Expand Up @@ -390,7 +391,7 @@ class Slope

dual_gaps.emplace_back(dual_gap);

double tol_scaled = std::abs(primal) * this->tol;
double tol_scaled = (std::abs(primal) + EPSILON) * this->tol;

if (this->print_level > 1) {
std::cout << indent(1) << "IRLS iteration: " << it_outer << std::endl
Expand Down Expand Up @@ -431,7 +432,7 @@ class Slope

double dual_gap_inner = primal_inner - dual_inner;

double tol_inner = std::abs(primal_inner) * this->tol;
double tol_inner = (std::abs(primal_inner) + EPSILON) * this->tol;

if (this->print_level > 2) {
std::cout << indent(2) << "iteration: " << it << std::endl
Expand Down
1 change: 0 additions & 1 deletion src/slope/slope_threshold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ slopeThreshold(const double x,
}

return { x - sign_x * lo, 0 };

} else {
int end = clusters.pointer(j + 1);
double hi = lambdas.segment(end - cluster_size, cluster_size).sum();
Expand Down

0 comments on commit bac6f93

Please sign in to comment.