Struct pcp::term::addition::Addition

source ·
pub struct Addition<VStore>where
    VStore: VStoreConcept,
    VStore::Item: Collection,
{ /* private fields */ }

Implementations§

Examples found in repository?
src/libpcp/term/addition.rs (line 63)
62
63
64
  fn clone(&self) -> Self {
    Addition::new(self.x.bclone(), self.v.clone())
  }
More examples
Hide additional examples
src/libpcp/propagators/cmp/mod.rs (line 49)
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
pub fn x_geq_y<VStore, Domain, Bound>(x: Var<VStore>, y: Var<VStore>) -> XGreaterEqY<VStore> where
  VStore: VStoreConcept<Item=Domain> + 'static,
  Domain: Collection<Item=Bound> + IntDomain,
  Bound: IntBound
{
  x_greater_y(Box::new(Addition::new(x, Bound::one())), y)
}

pub fn x_leq_y<VStore, Domain, Bound>(x: Var<VStore>, y: Var<VStore>) -> XLessEqY<VStore> where
  VStore: VStoreConcept<Item=Domain> + 'static,
  Domain: Collection<Item=Bound> + IntDomain,
  Bound: IntBound
{
  XLessY::new(x, Box::new(Addition::new(y, Bound::one())))
}

pub fn x_geq_y_plus_z<VStore, Domain, Bound>(x: Var<VStore>, y: Var<VStore>, z: Var<VStore>)
  -> XGreaterEqYPlusZ<VStore> where
 VStore: VStoreConcept<Item=Domain> + 'static,
 Domain: Collection<Item=Bound> + IntDomain,
 Bound: IntBound
{
  XGreaterYPlusZ::new(Box::new(Addition::new(x, Bound::one())), y, z)
}

pub fn x_leq_y_plus_z<VStore, Domain, Bound>(x: Var<VStore>, y: Var<VStore>, z: Var<VStore>)
  -> XLessEqYPlusZ<VStore> where
 VStore: VStoreConcept<Item=Domain> + 'static,
 Domain: Collection<Item=Bound> + IntDomain,
 Bound: IntBound
{
  XLessYPlusZ::new(Box::new(Addition::new(x, -Bound::one())), y, z)
}

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.