@@ -43,25 +43,34 @@ MatrixX DifferentiableConeMetric::change_metric_to_reduced_coordinates(
4343 assert (J.size () == V.size ());
4444 int num_entries = V.size ();
4545
46+ // Build triplet list
4647 typedef Eigen::Triplet<Scalar> T;
4748 std::vector<T> tripletList;
4849 tripletList.reserve (num_entries);
4950 for (int k = 0 ; k < num_entries; ++k) {
5051 tripletList.push_back (T (I[k], J[k], V[k]));
5152 }
5253
54+ // Use triplet list method
55+ return change_metric_to_reduced_coordinates (tripletList, num_rows);
56+ }
57+
58+ MatrixX DifferentiableConeMetric::change_metric_to_reduced_coordinates (
59+ const std::vector<Eigen::Triplet<Scalar>>& tripletList,
60+ int num_rows) const
61+ {
5362 // Build Jacobian from triplets
63+ int num_entries = tripletList.size ();
5464 int num_halfedges = n_halfedges ();
5565 MatrixX halfedge_jacobian (num_rows, num_halfedges);
5666 halfedge_jacobian.reserve (num_entries);
5767 halfedge_jacobian.setFromTriplets (tripletList.begin (), tripletList.end ());
5868
59- // Get transition Jacobian
60- MatrixX J_transition = get_transition_jacobian ();
61-
62- return halfedge_jacobian * J_transition;
69+ // Use matrix method
70+ return change_metric_to_reduced_coordinates (halfedge_jacobian);
6371}
6472
73+
6574MatrixX DifferentiableConeMetric::change_metric_to_reduced_coordinates (
6675 const MatrixX& halfedge_jacobian) const
6776{
0 commit comments