Skip to content

Commit 60b4587

Browse files
committed
LBFGSHessian: return a positive number of Hessian nonzeros. Should be replaced with has_curvature()
1 parent 6add9b7 commit 60b4587

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

uno/ingredients/hessian_models/quasi_newton/LBFGSHessian.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ namespace uno {
3939
this->Hessian_approximation = DenseMatrix<double>(this->dimension, this->dimension);
4040
}
4141

42-
size_t LBFGSHessian::number_nonzeros(const Model& /*model*/) const {
43-
throw std::runtime_error("LBFGSHessian::number_nonzeros should not be called");
42+
size_t LBFGSHessian::number_nonzeros(const Model& model) const {
43+
// return dummy number for now
44+
return model.number_variables * model.number_variables;
4445
}
4546

4647
void LBFGSHessian::initialize_statistics(Statistics& statistics, const Options& options) const {

uno/model/Model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ namespace uno {
2828
const double upper_bound_violation = std::max(0., constraint_value - this->constraint_upper_bound(constraint_index));
2929
return std::max(lower_bound_violation, upper_bound_violation);
3030
}
31-
} // namespace
31+
} // namespace

0 commit comments

Comments
 (0)