MCPcopy Create free account
hub / github.com/Rust-API/Rust-API-Bypass-Checker / fmt

Method fmt

src/analysis/numerical/linear_constraint.rs:218–238  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

216
217impl 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
241fn refine_symbolic_value(val: Rc<SymbolicValue>) -> Rc<SymbolicValue> {

Callers

nothing calls this directly

Calls 6

pushMethod · 0.80
is_contradictionMethod · 0.80
is_tautologyMethod · 0.80
constantMethod · 0.80
popMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected