chore: typographical improvements per review
All checks were successful
/ test (pull_request) Successful in 3m45s

This commit is contained in:
Glen Whitney 2025-10-06 16:31:02 -06:00
parent ecbbe2068c
commit 46ffd6c285
3 changed files with 11 additions and 10 deletions

View file

@ -514,8 +514,7 @@ impl ProblemPoser for HalfCurvatureRegulator {
pub enum Axis {X = 0, Y = 1, Z = 2}
impl Axis {
pub const N_AXIS: usize = (Axis::Z as usize) + 1;
pub const NAME: [&str; Axis::N_AXIS] = ["X", "Y", "Z"];
pub const NAME: [&str; Axis::CARDINALITY] = ["X", "Y", "Z"];
}
pub struct PointCoordinateRegulator {
@ -553,17 +552,17 @@ impl ProblemPoser for PointCoordinateRegulator {
let col = self.subject.column_index().expect(
"Subject must be indexed before point-coordinate regulator poses.");
problem.frozen.push(self.axis as usize, col, val);
// Check if all three coordinates have been frozen, and if so,
// freeze the coradius as well
let mut coords = [0.0; Axis::N_AXIS];
// Check if all three spatial coordinates have been frozen, and if so,
// freeze the norm component as well
let mut coords = [0.0; Axis::CARDINALITY];
let mut nset: usize = 0;
for &MatrixEntry {index, value} in &(problem.frozen) {
if index.1 == col && index.0 < Axis::N_AXIS {
if index.1 == col && index.0 < Axis::CARDINALITY {
nset += 1;
coords[index.0] = value
}
}
if nset == Axis::N_AXIS {
if nset == Axis::CARDINALITY {
let [x, y, z] = coords;
problem.frozen.push(
Point::NORM_COMPONENT, col, point(x,y,z)[Point::NORM_COMPONENT]);
@ -773,6 +772,7 @@ impl Assembly {
/* DEBUG */
// log the Gram matrix
console_log!("Gram matrix:\n{}", problem.gram);
console_log!("Frozen entries:\n{}", problem.frozen);
/* DEBUG */
// log the initial configuration matrix