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