File tree Expand file tree Collapse file tree 4 files changed +369
-357
lines changed
Expand file tree Collapse file tree 4 files changed +369
-357
lines changed Original file line number Diff line number Diff line change @@ -191,11 +191,11 @@ std::unique_ptr<DifferentiableConeMetric> compute_domain_coordinate_metric(
191191 VectorX codomain_metric_coords = constraint_codomain_matrix * init_codomain_coords;
192192 std::unique_ptr<DifferentiableConeMetric> cone_metric =
193193 m.set_metric_coordinates (domain_metric_coords + codomain_metric_coords);
194- SPDLOG_TRACE (
194+ SPDLOG_INFO (
195195 " Domain metric in range [{}, {}]" ,
196196 domain_metric_coords.minCoeff (),
197197 domain_metric_coords.maxCoeff ());
198- SPDLOG_TRACE (
198+ SPDLOG_INFO (
199199 " Codomain metric in range [{}, {}]" ,
200200 codomain_metric_coords.minCoeff (),
201201 codomain_metric_coords.maxCoeff ());
@@ -568,7 +568,8 @@ VectorX optimize_domain_coordinates(
568568 descent_direction);
569569
570570 // Ensure the descent direction range is stable
571- Scalar grad_range = beta * (descent_direction.maxCoeff () - descent_direction.minCoeff ());
571+ VectorX metric_descent_direction = constraint_domain_matrix * descent_direction;
572+ Scalar grad_range = beta * (metric_descent_direction.maxCoeff () - metric_descent_direction.minCoeff ());
572573 if ((max_grad_range > 0 ) && (grad_range >= max_grad_range)) {
573574 beta *= (max_grad_range / grad_range);
574575 spdlog::get (" optimize_metric" )->info (" Reducing beta to {} for stability" , beta);
Original file line number Diff line number Diff line change @@ -356,6 +356,14 @@ init_optimization_pybind(pybind11::module& m)
356356 &optimize_metric,
357357 pybind11::call_guard<pybind11::scoped_ostream_redirect,
358358 pybind11::scoped_estream_redirect>());
359+ m.def (" compute_shear_dual_basis" ,
360+ &compute_shear_dual_basis_pybind,
361+ pybind11::call_guard<pybind11::scoped_ostream_redirect,
362+ pybind11::scoped_estream_redirect>());
363+ m.def (" optimize_domain_coordinates" ,
364+ &optimize_domain_coordinates,
365+ pybind11::call_guard<pybind11::scoped_ostream_redirect,
366+ pybind11::scoped_estream_redirect>());
359367 m.def (" optimize_shear_basis_coordinates" ,
360368 &optimize_shear_basis_coordinates,
361369 pybind11::call_guard<pybind11::scoped_ostream_redirect,
You can’t perform that action at this time.
0 commit comments