pub struct LaneProgram { /* private fields */ }Expand description
A lane program (RFC U3 §6). Send + Sync + Clone; it reads the forcing
sets of the program it was built from.
Implementations§
Source§impl LaneProgram
impl LaneProgram
Sourcepub fn layout(&self) -> &LaneLayout
pub fn layout(&self) -> &LaneLayout
The lane layout (RFC U3 §6): each variable a column-major block whose
first axis is the lane (1..=capacity) and whose other axes are the
variable’s axes outside the lane’s sets, in order.
Sourcepub fn n_lane_inputs(&self) -> usize
pub fn n_lane_inputs(&self) -> usize
The number of hoisted reads the pre-gather plan fills.
Sourcepub fn forcing_slots(&self) -> &[ForcingSlot]
pub fn forcing_slots(&self) -> &[ForcingSlot]
The forcing slots a set for this program holds: the whole program’s.
Sourcepub fn new_workspace(&self) -> RhsWorkspace
pub fn new_workspace(&self) -> RhsWorkspace
Buffers for Self::eval_into and Self::eval_gathered_into.
Sourcepub fn eval_into(
&self,
u: &[f64],
aux: &[f64],
p: &[f64],
t: f64,
forcing: &ForcingSet,
cells: &[i32],
n: usize,
du: &mut [f64],
ws: &mut RhsWorkspace,
) -> Result<(), RhsError>
pub fn eval_into( &self, u: &[f64], aux: &[f64], p: &[f64], t: f64, forcing: &ForcingSet, cells: &[i32], n: usize, du: &mut [f64], ws: &mut RhsWorkspace, ) -> Result<(), RhsError>
Evaluate lanes 1..=n (RFC U3 §6): for each lane l and each written
variable, du holds the whole-domain program’s value at cells[:, l].
Sourcepub fn lane_inputs(&self) -> LaneInputs
pub fn lane_inputs(&self) -> LaneInputs
The pre-gather plan’s buffers, unfilled.
Sourcepub fn gather_lane_inputs(
&self,
inputs: &mut LaneInputs,
p: &[f64],
t: f64,
forcing: &ForcingSet,
cells: &[i32],
n: usize,
) -> Result<(), RhsError>
pub fn gather_lane_inputs( &self, inputs: &mut LaneInputs, p: &[f64], t: f64, forcing: &ForcingSet, cells: &[i32], n: usize, ) -> Result<(), RhsError>
Fill inputs for lanes 1..=n of cells: every hoisted read of a
non-state input, at each lane’s cell.
Sourcepub fn eval_gathered_into(
&self,
u: &[f64],
aux: &[f64],
inputs: &LaneInputs,
p: &[f64],
t: f64,
cells: &[i32],
n: usize,
du: &mut [f64],
ws: &mut RhsWorkspace,
) -> Result<(), RhsError>
pub fn eval_gathered_into( &self, u: &[f64], aux: &[f64], inputs: &LaneInputs, p: &[f64], t: f64, cells: &[i32], n: usize, du: &mut [f64], ws: &mut RhsWorkspace, ) -> Result<(), RhsError>
Self::eval_into with every hoisted read taken from inputs, and
the forcing set they were gathered from.
Trait Implementations§
Source§impl Clone for LaneProgram
impl Clone for LaneProgram
Auto Trait Implementations§
impl Freeze for LaneProgram
impl RefUnwindSafe for LaneProgram
impl Send for LaneProgram
impl Sync for LaneProgram
impl Unpin for LaneProgram
impl UnsafeUnpin for LaneProgram
impl UnwindSafe for LaneProgram
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.