Skip to content

Commit

Permalink
Apply Eigen's normalize (appears to be equivalent to a VUNITIZE) to a…
Browse files Browse the repository at this point in the history
… libbn vect_t.
  • Loading branch information
starseeker committed Aug 10, 2023
1 parent bb0e42e commit 1bc71b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libbn/tests/eigen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ int main(int UNUSED(ac), const char **av)
bu_exit(BRLCAD_ERROR, "Vector assignment failed\n");
bu_log("Updated Vector: %g %g %g\n", V3ARGS(bn_vec));

// Unitize both the comparison vector (with libbn) and the original
// vector (with Eigen). Make sure the results are the same.
VUNITIZE(cmp_vec);
evec.normalize();
if (!VNEAR_EQUAL(cmp_vec, bn_vec, SMALL_FASTF))
bu_exit(BRLCAD_ERROR, "Vector unitization failed\n");
bu_log("Normalized Vector: %g %g %g\n", V3ARGS(bn_vec));

return 0;
}

Expand Down

0 comments on commit 1bc71b7

Please sign in to comment.