pub trait Solve<A: Scalar> {
// Required methods
fn solve_inplace<'a, S: DataMut<Elem = A>>(
&self,
b: &'a mut ArrayBase<S, Ix1>,
) -> Result<&'a mut ArrayBase<S, Ix1>>;
fn solve_t_inplace<'a, S: DataMut<Elem = A>>(
&self,
b: &'a mut ArrayBase<S, Ix1>,
) -> Result<&'a mut ArrayBase<S, Ix1>>;
fn solve_h_inplace<'a, S: DataMut<Elem = A>>(
&self,
b: &'a mut ArrayBase<S, Ix1>,
) -> Result<&'a mut ArrayBase<S, Ix1>>;
// Provided methods
fn solve<S: Data<Elem = A>>(
&self,
b: &ArrayBase<S, Ix1>,
) -> Result<Array1<A>> { ... }
fn solve_into<S: DataMut<Elem = A>>(
&self,
b: ArrayBase<S, Ix1>,
) -> Result<ArrayBase<S, Ix1>> { ... }
fn solve_t<S: Data<Elem = A>>(
&self,
b: &ArrayBase<S, Ix1>,
) -> Result<Array1<A>> { ... }
fn solve_t_into<S: DataMut<Elem = A>>(
&self,
b: ArrayBase<S, Ix1>,
) -> Result<ArrayBase<S, Ix1>> { ... }
fn solve_h<S: Data<Elem = A>>(
&self,
b: &ArrayBase<S, Ix1>,
) -> Result<Array1<A>> { ... }
fn solve_h_into<S: DataMut<Elem = A>>(
&self,
b: ArrayBase<S, Ix1>,
) -> Result<ArrayBase<S, Ix1>> { ... }
}Expand description
An interface for solving systems of linear equations.
There are three groups of methods:
solve*(normal) methods solveA * x = bforx.solve_t*(transpose) methods solveA^T * x = bforx.solve_h*(Hermitian conjugate) methods solveA^H * x = bforx.
Within each group, there are three methods that handle ownership differently:
*methods take a reference toband returnxas a new array.*_intomethods take ownership ofb, store the result in it, and return it.*_inplacemethods take a mutable reference toband store the result in that array.
If you plan to solve many equations with the same A matrix but different
b vectors, it’s faster to factor the A matrix once using the
Factorize trait, and then solve using the LUFactorized struct.
Required Methods§
Sourcefn solve_inplace<'a, S: DataMut<Elem = A>>(
&self,
b: &'a mut ArrayBase<S, Ix1>,
) -> Result<&'a mut ArrayBase<S, Ix1>>
fn solve_inplace<'a, S: DataMut<Elem = A>>( &self, b: &'a mut ArrayBase<S, Ix1>, ) -> Result<&'a mut ArrayBase<S, Ix1>>
Solves a system of linear equations A * x = b where A is self, b
is the argument, and x is the successful result.
§Panics
Panics if the length of b is not the equal to the number of columns
of A.
Sourcefn solve_t_inplace<'a, S: DataMut<Elem = A>>(
&self,
b: &'a mut ArrayBase<S, Ix1>,
) -> Result<&'a mut ArrayBase<S, Ix1>>
fn solve_t_inplace<'a, S: DataMut<Elem = A>>( &self, b: &'a mut ArrayBase<S, Ix1>, ) -> Result<&'a mut ArrayBase<S, Ix1>>
Solves a system of linear equations A^T * x = b where A is self, b
is the argument, and x is the successful result.
§Panics
Panics if the length of b is not the equal to the number of rows of
A.
Sourcefn solve_h_inplace<'a, S: DataMut<Elem = A>>(
&self,
b: &'a mut ArrayBase<S, Ix1>,
) -> Result<&'a mut ArrayBase<S, Ix1>>
fn solve_h_inplace<'a, S: DataMut<Elem = A>>( &self, b: &'a mut ArrayBase<S, Ix1>, ) -> Result<&'a mut ArrayBase<S, Ix1>>
Solves a system of linear equations A^H * x = b where A is self, b
is the argument, and x is the successful result.
§Panics
Panics if the length of b is not the equal to the number of rows of
A.
Provided Methods§
Sourcefn solve<S: Data<Elem = A>>(&self, b: &ArrayBase<S, Ix1>) -> Result<Array1<A>>
fn solve<S: Data<Elem = A>>(&self, b: &ArrayBase<S, Ix1>) -> Result<Array1<A>>
Solves a system of linear equations A * x = b where A is self, b
is the argument, and x is the successful result.
§Panics
Panics if the length of b is not the equal to the number of columns
of A.
Sourcefn solve_into<S: DataMut<Elem = A>>(
&self,
b: ArrayBase<S, Ix1>,
) -> Result<ArrayBase<S, Ix1>>
fn solve_into<S: DataMut<Elem = A>>( &self, b: ArrayBase<S, Ix1>, ) -> Result<ArrayBase<S, Ix1>>
Solves a system of linear equations A * x = b where A is self, b
is the argument, and x is the successful result.
§Panics
Panics if the length of b is not the equal to the number of columns
of A.
Sourcefn solve_t<S: Data<Elem = A>>(&self, b: &ArrayBase<S, Ix1>) -> Result<Array1<A>>
fn solve_t<S: Data<Elem = A>>(&self, b: &ArrayBase<S, Ix1>) -> Result<Array1<A>>
Solves a system of linear equations A^T * x = b where A is self, b
is the argument, and x is the successful result.
§Panics
Panics if the length of b is not the equal to the number of rows of
A.
Sourcefn solve_t_into<S: DataMut<Elem = A>>(
&self,
b: ArrayBase<S, Ix1>,
) -> Result<ArrayBase<S, Ix1>>
fn solve_t_into<S: DataMut<Elem = A>>( &self, b: ArrayBase<S, Ix1>, ) -> Result<ArrayBase<S, Ix1>>
Solves a system of linear equations A^T * x = b where A is self, b
is the argument, and x is the successful result.
§Panics
Panics if the length of b is not the equal to the number of rows of
A.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.