pub struct ParamProjection { /* private fields */ }Expand description
Validated projection from one parameter layout into another.
The target layout owns the values produced by Self::project, while the
source layout owns the values accepted by it. Only free parameters are
projected: fixed target parameters retain their configured values, and a
target free parameter must also be free in the source layout.
Implementations§
Source§impl ParamProjection
impl ParamProjection
Sourcepub fn project(&self, source: &ParamValues) -> ParamResult<ParamValues>
pub fn project(&self, source: &ParamValues) -> ParamResult<ParamValues>
Projects values from the source layout into the target layout.
§Errors
Returns ParamError::UnknownName when the supplied values do not
contain a required target parameter.
Sourcepub fn scatter_add(&self, target: &[f64], source: &mut [f64]) -> ParamResult<()>
pub fn scatter_add(&self, target: &[f64], source: &mut [f64]) -> ParamResult<()>
Scatters a target-layout free gradient into a source-layout gradient.
Values are added to source, allowing several projections to
contribute to one gradient. Both dimensions are validated against the
layouts captured by this artifact.
§Errors
Returns ParamError::FreeLengthMismatch when either slice has an
incompatible free-parameter dimension.
Trait Implementations§
Source§impl Clone for ParamProjection
impl Clone for ParamProjection
Source§fn clone(&self) -> ParamProjection
fn clone(&self) -> ParamProjection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more