|
@ -160,7 +160,7 @@ where |
|
|
let pp = |s: &mut String, lc: &LinearCombination<G::Scalar>| {
|
|
|
let pp = |s: &mut String, lc: &LinearCombination<G::Scalar>| {
|
|
|
s.push('(');
|
|
|
s.push('(');
|
|
|
let mut is_first = true;
|
|
|
let mut is_first = true;
|
|
|
for (var, coeff) in proc_lc::<G::Scalar>(&lc) {
|
|
|
|
|
|
|
|
|
for (var, coeff) in proc_lc::<G::Scalar>(lc) {
|
|
|
if coeff == negone {
|
|
|
if coeff == negone {
|
|
|
s.push_str(" - ")
|
|
|
s.push_str(" - ")
|
|
|
} else if !is_first {
|
|
|
} else if !is_first {
|
|
@ -213,9 +213,7 @@ where |
|
|
|
|
|
|
|
|
/// TODO: document
|
|
|
/// TODO: document
|
|
|
fn set_named_obj(&mut self, path: String, to: NamedObject) {
|
|
|
fn set_named_obj(&mut self, path: String, to: NamedObject) {
|
|
|
if self.named_objects.contains_key(&path) {
|
|
|
|
|
|
panic!("tried to create object at existing path: {}", path);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
assert!(!self.named_objects.contains_key(&path), "tried to create object at existing path: {}", path);
|
|
|
|
|
|
|
|
|
self.named_objects.insert(path, to);
|
|
|
self.named_objects.insert(path, to);
|
|
|
}
|
|
|
}
|
|
@ -308,9 +306,7 @@ where |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
fn compute_path(ns: &[String], this: &str) -> String {
|
|
|
fn compute_path(ns: &[String], this: &str) -> String {
|
|
|
if this.chars().any(|a| a == '/') {
|
|
|
|
|
|
panic!("'/' is not allowed in names");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
assert!(!this.chars().any(|a| a == '/'), "'/' is not allowed in names");
|
|
|
|
|
|
|
|
|
let mut name = String::new();
|
|
|
let mut name = String::new();
|
|
|
|
|
|
|
|
|