mirror of
https://github.com/rm-dr/daisy
synced 2025-07-01 06:33:34 -07:00
Added no_space parameter for units
This commit is contained in:
@ -86,6 +86,12 @@ impl Unit {
|
||||
pub fn get_val_mut(&mut self) -> &mut HashMap<FreeUnit, Scalar> { &mut self.val }
|
||||
pub fn unitless(&self) -> bool { self.get_val().len() == 0 }
|
||||
|
||||
pub fn no_space(&self) -> bool {
|
||||
if self.get_val().len() == 1 {
|
||||
return self.get_val().keys().next().unwrap().whole.no_space();
|
||||
} else { return false; }
|
||||
}
|
||||
|
||||
pub fn from_array(a: &[(FreeUnit, Scalar)]) -> Unit {
|
||||
let mut n = Unit::new();
|
||||
for (u, p) in a.iter() {
|
||||
|
Reference in New Issue
Block a user