Skip to main content

LinearOperatorProblem

Struct LinearOperatorProblem 

Source
pub struct LinearOperatorProblem<O, P> { /* private fields */ }
Expand description

A vector problem driven by a dense, possibly state- and time-dependent linear operator: u' = A(u, p, t) u.

The operator callback overwrites a row-major dimension × dimension buffer. This mirrors SciML’s updateable MatrixOperator contract while making dimensions explicit in Rust.

Implementations§

Source§

impl<O, P> LinearOperatorProblem<O, P>

Source

pub fn new( operator: O, initial_state: impl Into<Vec<f64>>, time_span: (f64, f64), parameters: P, ) -> Result<Self, ConfigurationError>

Constructs a checked linear-operator problem.

Source

pub fn initial_state(&self) -> &[f64]

Returns the initial state.

Source

pub fn time_span(&self) -> (f64, f64)

Returns the integration time span.

Source

pub fn parameters(&self) -> &P

Returns the user parameters.

Source

pub fn dimension(&self) -> usize

Returns the state dimension.

Source

pub fn evaluate_operator( &self, output: &mut [f64], state: &[f64], time: f64, ) -> Result<(), SolveError>
where O: Fn(&mut [f64], &[f64], &P, f64),

Evaluates the row-major operator matrix at state and time.

The output must contain dimension * dimension entries and state must match the problem dimension. Non-finite operator entries are rejected with SolveError::NonFiniteDerivative.

Auto Trait Implementations§

§

impl<O, P> Forget for LinearOperatorProblem<O, P>

§

impl<O, P> Freeze for LinearOperatorProblem<O, P>
where O: Freeze, P: Freeze,

§

impl<O, P> Move for LinearOperatorProblem<O, P>

§

impl<O, P> RefUnwindSafe for LinearOperatorProblem<O, P>

§

impl<O, P> Send for LinearOperatorProblem<O, P>
where O: Send, P: Send,

§

impl<O, P> Sync for LinearOperatorProblem<O, P>
where O: Sync, P: Sync,

§

impl<O, P> Unpin for LinearOperatorProblem<O, P>
where O: Unpin, P: Unpin,

§

impl<O, P> UnsafeUnpin for LinearOperatorProblem<O, P>
where O: UnsafeUnpin, P: UnsafeUnpin,

§

impl<O, P> UnwindSafe for LinearOperatorProblem<O, P>
where O: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.