Fix syntax errors introduced in lbfgs methods in r6232 and r6233.

This commit is contained in:
Ryan Curtin
2010-11-01 19:45:20 +00:00
parent fb8197e259
commit b60b8eb021
2 changed files with 3 additions and 4 deletions
@@ -620,7 +620,7 @@ std::string Lbfgs<OptimizedFunction>::ComputeProgress_() {
double feasibility_error;
optimized_function_->ComputeFeasibilityError(
coordinates_, &feasibility_error);
double norm_grad=1.0/math::pow(2,la::Dot(gradient_.n_elements(),
double norm_grad=1.0/std::pow(2,la::Dot(gradient_.n_elements(),
gradient_.ptr(), gradient_.ptr()));
char buffer[1024];
sprintf(buffer, "iteration:%i sigma:%lg lagrangian:%lg objective:%lg error:%lg "
@@ -170,9 +170,8 @@ class OptUtils {
ones.SetAll(1.0);
// This part of the sparsity constraint function formula can be
// precomputed and it is the same for every iteration
double temp_pow_1_2_dimension = 1.0/std::pow(2,dimension)
double precomputed_sparse_factor
= -sparse_factor*(temp_pow_1_2_dimension-1)+temp_pow_1_2_dimension;
double temp_pow_1_2_dimension = 1.0/std::pow(2,dimension);
double precomputed_sparse_factor = -sparse_factor*(temp_pow_1_2_dimension-1)+temp_pow_1_2_dimension;
for (index_t i=0; i<data->n_cols(); i++) {
double *point=data->GetColumnPtr(i);