Skip to content

Commit

Permalink
Fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
eastskykang authored and fdevinc committed Feb 15, 2024
1 parent eddf787 commit 98ad589
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions include/ungar/autodiff/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Function { // clang-format on
_jacobianInnerStarts.emplace_back(0);
for (int i = 0; const int j : enumerate(static_cast<int>(_dependentVariableSize))) {
if (i < static_cast<int>(_nnzJacobian)) {
while (i < _nnzJacobian && rows[i] == j) {
while (i < static_cast<int>(_nnzJacobian) && rows[i] == j) {
++i;
}
_jacobianInnerStarts.emplace_back(i);
Expand Down Expand Up @@ -408,7 +408,7 @@ class FunctionFactory {

UNGAR_LOG(info,
"Removing internal model folder {}...",
_internalLibrary.parent_path().parent_path());
_internalLibrary.parent_path().parent_path().c_str());
std::filesystem::remove_all(_internalLibrary.parent_path().parent_path());

UNGAR_LOG(info, "Success.");
Expand Down Expand Up @@ -492,18 +492,18 @@ class FunctionFactory {
libraryCSourceGen, (tmpLibrary.parent_path() / tmpLibrary.stem()).string()};
SetCompilerOptions(library.parent_path(), gccCompiler);

UNGAR_LOG(info, "Compiling shared library {}...", tmpLibrary);
UNGAR_LOG(info, "Compiling shared library {}...", tmpLibrary.c_str());
_dynamicLib = libraryProcessor.createDynamicLibrary(gccCompiler);
_model = _dynamicLib->model(modelName);
UNGAR_ASSERT(_dynamicLib);
UNGAR_ASSERT(_model);

UNGAR_LOG(info, "Renaming {} to {}...", tmpLibrary, library);
UNGAR_LOG(info, "Renaming {} to {}...", tmpLibrary.c_str(), library.c_str());
std::filesystem::rename(tmpLibrary, library);
}

void LoadModel() {
UNGAR_LOG(info, "Loading shared library {}...", _library);
UNGAR_LOG(info, "Loading shared library {}...", _library.c_str());

_dynamicLib.reset(new CppAD::cg::LinuxDynamicLib<real_t>(_library));
_model = _dynamicLib->model(_blueprint.name);
Expand Down
2 changes: 1 addition & 1 deletion include/ungar/optimization/soft_sqp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SoftSQPOptimizer {
VectorXr xpHelper = xp;
_cache.xp = xp;

for (const auto i : enumerate(_maxIterations)) {
for ([[maybe_unused]] const auto i : enumerate(_maxIterations)) {
if (_osqpSettings.verbose) {
UNGAR_LOG(trace, "Starting soft SQP iteration {}...", i);
}
Expand Down

0 comments on commit 98ad589

Please sign in to comment.