Skip to content

use VectorView and VectorViewMut instead of &Vector and &mut Vector #47

@martinjrobins

Description

@martinjrobins

atm the main call function for NonLinearOp is:

pub trait NonLinearOp: Op {
    /// Compute the operator at a given state and time.
    fn call_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V);
    ...

To make this more flexible, we should use VectorView and VectorViewMut instead, ie:

pub trait NonLinearOp: Op {
    /// Compute the operator at a given state and time.
    fn call_inplace(&self, x: Self::VView, t: Self::T, y: Self::VViewMut);
    ...

This allows algorithms to call these functions with views rather than references to owned vectors. One usecase for this is to concatentate solves with varying parameters into a larger statevector

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions