Skip to content
Snippets Groups Projects

Dynamic Constant Math

Merged Aaron Councilman requested to merge dyn_const_math into main
1 unresolved thread
Files
9
+ 22
2
@@ -376,8 +376,8 @@ impl<'a> Builder<'a> {
Type::Float64 => self.create_constant_f64(0.0),
Type::Product(fs) => {
let mut cs = vec![];
for t in fs.clone() {
cs.push(self.create_constant_zero(t));
for t in fs.clone().iter() {
cs.push(self.create_constant_zero(*t));
}
self.create_constant_prod(cs.into())
},
@@ -399,6 +399,26 @@ impl<'a> Builder<'a> {
self.intern_dynamic_constant(DynamicConstant::Parameter(val))
}
pub fn create_dynamic_constant_add(&mut self, x : DynamicConstantID,
y : DynamicConstantID) -> DynamicConstantID {
self.intern_dynamic_constant(DynamicConstant::Add(x, y))
}
pub fn create_dynamic_constant_sub(&mut self, x : DynamicConstantID,
y : DynamicConstantID) -> DynamicConstantID {
self.intern_dynamic_constant(DynamicConstant::Sub(x, y))
}
pub fn create_dynamic_constant_mul(&mut self, x : DynamicConstantID,
y : DynamicConstantID) -> DynamicConstantID {
self.intern_dynamic_constant(DynamicConstant::Mul(x, y))
}
pub fn create_dynamic_constant_div(&mut self, x : DynamicConstantID,
y : DynamicConstantID) -> DynamicConstantID {
self.intern_dynamic_constant(DynamicConstant::Div(x, y))
}
pub fn create_field_index(&self, idx: usize) -> Index {
Index::Field(idx)
}
Loading