Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Rizzi committed Nov 11, 2024
1 parent 4382613 commit 45705bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class NonLinLeastSquares : public RegistryType
InternalDiagnosticDataWithAbsoluteRelativeTracking<ScalarType> >;
diagnostics_container diagnostics_;
DiagnosticsLogger diagnosticsLogger_ = {};
std::optional<std::vector<scalar_of_t<StateType> > > parameters_;
std::optional<std::vector<scalar_trait_t<StateType> > > parameters_;

public:
template<class ...Args>
Expand Down Expand Up @@ -158,7 +158,7 @@ class NonLinLeastSquares : public RegistryType
void setStopTolerance(ScalarType value) { stopTolerance_ = value; }
void setMaxIterations(int newMax) { maxIters_ = newMax; }
auto & getLineSearchParameters(){
return parameters_;
return parameters_;
}

// this method can be used when passing a system object
Expand Down Expand Up @@ -230,11 +230,11 @@ class NonLinLeastSquares : public RegistryType
// so we need to reset the data in the registry everytime
reset_for_new_solve_loop(tag_, extReg);

BacktrackStrictlyDecreasingObjectiveUpdater<scalar_trait_t<StateType>> updater(parameters_);
nonlin_ls_solving_loop_impl(tag_, system, extReg,
stopEnValue_, stopTolerance_,
diagnostics_, diagnosticsLogger_,
maxIters_,
BacktrackStrictlyDecreasingObjectiveUpdater<scalar_of_t<StateType> >(parameters_));
maxIters_, updater);
}

template<class SystemType, class _Tag = Tag>
Expand Down
6 changes: 3 additions & 3 deletions include/pressio/solvers_nonlinear/impl/root_finder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class RootFinder : public RegistryType
InternalDiagnosticDataWithAbsoluteRelativeTracking<NormValueType> >;
norm_diagnostics_container normDiagnostics_;
DiagnosticsLogger diagnosticsLogger_ = {};
std::optional<std::vector<scalar_of_t<StateType> > > parameters_;
std::optional<std::vector<scalar_trait_t<StateType> > > parameters_;

public:
template<class ...Args>
Expand Down Expand Up @@ -154,7 +154,7 @@ class RootFinder : public RegistryType
void setStopTolerance(NormValueType value) { stopTolerance_ = value; }
void setMaxIterations(int newMax) { maxIters_ = newMax; }
auto & getLineSearchParameters(){
return parameters_;
return parameters_;
}

template<class SystemType>
Expand All @@ -180,7 +180,7 @@ class RootFinder : public RegistryType

root_solving_loop_impl(tag_, system, extReg, stopEnValue_, stopTolerance_,
normDiagnostics_, diagnosticsLogger_, maxIters_,
BacktrackStrictlyDecreasingObjectiveUpdater<scalar_of_t<StateType> >(parameters_));
BacktrackStrictlyDecreasingObjectiveUpdater<scalar_trait_t<StateType>>(parameters_));
}
else{
throw std::runtime_error("Invalid criterion");
Expand Down

0 comments on commit 45705bb

Please sign in to comment.