# Trait SpSolverLstsq

```
pub trait SpSolverLstsq<E>: SpSolverLstsqCore<E>where
E: ComplexField,{
// Required methods
fn solve_lstsq_in_place(&self, rhs: impl ColBatchMut<E>);
fn solve_lstsq_conj_in_place(&self, rhs: impl ColBatchMut<E>);
fn solve_lstsq<ViewE, B>(&self, rhs: B) -> <B as ColBatch<ViewE>>::Owned
where ViewE: Conjugate<Canonical = E>,
B: ColBatch<ViewE>;
fn solve_lstsq_conj<ViewE, B>(
&self,
rhs: B,
) -> <B as ColBatch<ViewE>>::Owned
where ViewE: Conjugate<Canonical = E>,
B: ColBatch<ViewE>;
}
```

## Expand description

Solver that can compute the least squares solution of an overdetermined linear system.

## Required Methods§

#### fn solve_lstsq_in_place(&self, rhs: impl ColBatchMut<E>)

#### fn solve_lstsq_in_place(&self, rhs: impl ColBatchMut<E>)

Solves the equation `self * X = rhs`

, in the sense of least squares, and stores the
result in the top rows of `rhs`

.

#### fn solve_lstsq_conj_in_place(&self, rhs: impl ColBatchMut<E>)

#### fn solve_lstsq_conj_in_place(&self, rhs: impl ColBatchMut<E>)

Solves the equation `conjugate(self) * X = rhs`

, in the sense of least squares, and
stores the result in the top rows of `rhs`

.

#### fn solve_lstsq<ViewE, B>(&self, rhs: B) -> <B as ColBatch<ViewE>>::Owned

#### fn solve_lstsq<ViewE, B>(&self, rhs: B) -> <B as ColBatch<ViewE>>::Owned

Solves the equation `self * X = rhs`

, and returns the result.

#### fn solve_lstsq_conj<ViewE, B>(&self, rhs: B) -> <B as ColBatch<ViewE>>::Owned

#### fn solve_lstsq_conj<ViewE, B>(&self, rhs: B) -> <B as ColBatch<ViewE>>::Owned

Solves the equation `conjugate(self) * X = rhs`

, and returns the result.

## 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.*