(&self, f: &mut fmt::Formatter<'_>)
| 216 | |
| 217 | impl Debug for LinearExpression { |
| 218 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 219 | let mut res = String::new(); |
| 220 | for (i, (v, n)) in self.cof_map.iter().enumerate() { |
| 221 | if *n > 0 && i != 0 { |
| 222 | res.push('+'); |
| 223 | } |
| 224 | if *n == -1 { |
| 225 | res.push('-'); |
| 226 | } else if *n != 1 { |
| 227 | res.push_str(format!("{}*", n).as_str()); |
| 228 | } |
| 229 | res.push_str(format!("{:?}", v).as_str()); |
| 230 | } |
| 231 | if self.cst > 0 && !self.cof_map.is_empty() { |
| 232 | res.push('+'); |
| 233 | } |
| 234 | if self.cst != 0 || self.cof_map.is_empty() { |
| 235 | res.push_str(format!("{}", self.cst).as_str()); |
| 236 | } |
| 237 | write!(f, "{}", res) |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | fn refine_symbolic_value(val: Rc<SymbolicValue>) -> Rc<SymbolicValue> { |
nothing calls this directly
no test coverage detected