Name element column index more descriptively

This commit is contained in:
Aaron Fenyes 2024-11-14 01:18:20 -08:00
parent a48fef3641
commit 7d6a394156

View File

@ -23,7 +23,7 @@ pub struct Element {
// the configuration matrix column index that was assigned to this element
// last time the assembly was realized
index: usize
column_index: usize
}
impl Element {
@ -39,7 +39,7 @@ impl Element {
color: color,
representation: create_signal(representation),
constraints: create_signal(BTreeSet::default()),
index: 0
column_index: 0
}
}
}
@ -133,7 +133,7 @@ impl Assembly {
// index the elements
self.elements.update_silent(|elts| {
for (index, (_, elt)) in elts.into_iter().enumerate() {
elt.index = index;
elt.column_index = index;
}
});
@ -145,8 +145,8 @@ impl Assembly {
for (_, cst) in csts {
if cst.active.get_untracked() && cst.lorentz_prod_valid.get_untracked() {
let subjects = cst.subjects;
let row = elts[subjects.0].index;
let col = elts[subjects.1].index;
let row = elts[subjects.0].column_index;
let col = elts[subjects.1].column_index;
gram_to_be.push_sym(row, col, cst.lorentz_prod.get_untracked());
}
}
@ -156,7 +156,7 @@ impl Assembly {
// Gram matrix
let mut guess_to_be = DMatrix::<f64>::zeros(5, elts.len());
for (_, elt) in elts {
let index = elt.index;
let index = elt.column_index;
gram_to_be.push_sym(index, index, 1.0);
guess_to_be.set_column(index, &elt.representation.get_clone_untracked());
}
@ -202,7 +202,7 @@ impl Assembly {
// read out the solution
for (_, elt) in self.elements.get_clone_untracked() {
elt.representation.update(
|rep| rep.set_column(0, &config.column(elt.index))
|rep| rep.set_column(0, &config.column(elt.column_index))
);
}
}