Write out representation in Element structure

This commit is contained in:
Aaron Fenyes 2024-11-10 19:24:26 -08:00
parent 933f05661d
commit da008fd090
4 changed files with 22 additions and 20 deletions

View file

@ -12,7 +12,7 @@ pub struct Element {
pub id: String,
pub label: String,
pub color: [f32; 3],
pub rep: DVector<f64>,
pub representation: DVector<f64>,
pub constraints: BTreeSet<usize>,
// internal properties, not reflected in any view
@ -86,7 +86,7 @@ impl Assembly {
id: id,
label: format!("Sphere {}", id_num),
color: [0.75_f32, 0.75_f32, 0.75_f32],
rep: DVector::<f64>::from_column_slice(&[0.0, 0.0, 0.0, 0.5, -0.5]),
representation: DVector::<f64>::from_column_slice(&[0.0, 0.0, 0.0, 0.5, -0.5]),
constraints: BTreeSet::default(),
index: 0
}
@ -133,7 +133,7 @@ impl Assembly {
for (_, elt) in elts {
let index = elt.index;
gram_to_be.push_sym(index, index, 1.0);
guess_to_be.set_column(index, &elt.rep);
guess_to_be.set_column(index, &elt.representation);
}
(gram_to_be, guess_to_be)
@ -177,7 +177,7 @@ impl Assembly {
// read out the solution
self.elements.update(|elts| {
for (_, elt) in elts.iter_mut() {
elt.rep.set_column(0, &config.column(elt.index));
elt.representation.set_column(0, &config.column(elt.index));
}
});
}