# shrinkage::Solver

Shrinkage for Rust · 0.3.0

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver.rs>)

```rust
pub trait Solver<P>
```

A solver for a supported problem type. 

Implementations own their compatibility bounds and result and error types. Unsupported typed combinations have no implementation. Runtime selections may return [`FitError::UnsupportedCombination`](<1b3b3442a395454abc564cf4b94d07f97e67975dd92cef1ff14dba46f928b87f#variant-UnsupportedCombination>) with a supported alternative. 

<a id="associated-types"></a>

## Associated types

<a id="associated-type-Error"></a>

### `Error`

```rust
type Error;
```

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver.rs>)

Input, numerical, or backend failure. 

<a id="associated-type-Fit"></a>

### `Fit`

```rust
type Fit;
```

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver.rs>)

Owned result returned after fitting. 

<a id="methods"></a>

## Methods

<a id="method-solve"></a>

### `solve`

```rust
fn solve(
    &self,
    problem: &P
) -> Result<<Self as Solver>::Fit, <Self as Solver>::Error>
```

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver.rs>)

Fit a problem using this solver. 

<a id="method-solve-documentation-errors"></a>

#### Errors

Returns an error if validation or a required numerical operation fails. 

<a id="impl-a93fa160ff272473d36a375556b86fff8edfd884243e1107ac6cebf1d47c9958"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/problem/runtime.rs>)

```rust
impl Solver<Problem<Box<dyn RuntimeDesign + '_>, Box<dyn SmoothDatafit<Error = FitError> + '_>, Box<dyn ProximalPenalty<Error = FitError> + '_>>> for shrinkage::CoordinateDescent
```

<a id="impl-988bd5ef1eb00d670a89ec9d87f9bff36a3d8b4768e2a6d4e03b41db330c5bb8"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/problem/runtime.rs>)

```rust
impl<D: SmoothDatafit, P: ProximalPenalty> Solver<Problem<Box<dyn RuntimeDesign + '_>, D, P>> for shrinkage::ProximalGradient<Vec<f64>>
```

<a id="impl-c98a93b565b3bf7dfb8820d3072809c32b7976f967a0a29deed1a3ced2f92da6"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/proximal.rs>)

```rust
impl<M, D, P, V> Solver<Problem<&M, D, P>> for ProximalGradient<V> where M: RawColumns<f64> + ColumnStats<f64> + MatVecInto<V> + MatTransposeVecInto<V> + ?Sized, D: SmoothDatafit, P: ProximalPenalty, V: ProximalVector
```

<a id="impl-33e9f3be78bec4e6b7e159d18c90887e51bcd45508a8f82a43fe1f3df7c37231"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/irls.rs>)

```rust
impl<M, D, P> Solver<Problem<&M, D, P>> for Irls where M: RawColumns<f64> + ColumnStats<f64> + ?Sized, D: QuadraticModelDatafit, P: CoordinatePenalty
```

<a id="impl-72736c4fbabe0cadc9050a6a123310797549b5e3b3281cd67d3f1b499d2ae697"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/proximal/multivariate.rs>)

```rust
impl<M, P, V> Solver<Problem<&M, MultivariateGaussian<'_>, AxisPenalty<P>>> for shrinkage::ProximalGradient<V> where M: RawColumns<f64> + ColumnStats<f64> + MatVecInto<V> + MatTransposeVecInto<V> + ?Sized, P: ProximalPenalty, V: ProximalVector
```

<a id="impl-d4f9004d8868597f92dc06ff48e3f9461e58f68c6ba90f37c192b1245f925eb3"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/hybrid/irls.rs>)

```rust
impl<M, V, P> Solver<Problem<&M, Binomial<'_>, P>> for HybridCoordinateDescent<V> where M: RawColumns<f64> + ColumnStats<f64> + MatVecInto<V> + MatTransposeVecInto<V> + ?Sized, V: ProximalVector, P: ReducedCoordinatePenalty
```

<a id="impl-eb138a829bbcf171c09e97ddac534760473d645ff09af2a0b0cc4b3ae11e7883"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/hybrid.rs>)

```rust
impl<M, V> Solver<Problem<&M, Gaussian<'_>, ChainFusedLasso>> for HybridCoordinateDescent<V> where M: RawColumns<f64> + ColumnStats<f64> + MatVecInto<V> + MatTransposeVecInto<V> + ?Sized, V: ProximalVector
```

<a id="impl-922c9aea132b463a0c1b336cdf2a08500e6b9124018a84d76f3d90c9fb8548d9"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/hybrid.rs>)

```rust
impl<M, V> Solver<Problem<&M, Gaussian<'_>, ClusteredLasso>> for HybridCoordinateDescent<V> where M: RawColumns<f64> + ColumnStats<f64> + MatVecInto<V> + MatTransposeVecInto<V> + ?Sized, V: ProximalVector
```

<a id="impl-340fd9ee2f10f208887c00cdc5bfa0d730301ade8be911e486aeac9ba0101587"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/hybrid.rs>)

```rust
impl<M, V> Solver<Problem<&M, Gaussian<'_>, Slope>> for HybridCoordinateDescent<V> where M: RawColumns<f64> + ColumnStats<f64> + MatVecInto<V> + MatTransposeVecInto<V> + ?Sized, V: ProximalVector
```

<a id="impl-3c949e54ceacfd1c4e6e5ed41e05b28553801a6ef3db99564f0087df0fedd8b4"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/problem.rs>)

```rust
impl<M> Solver<Problem<&M, Gaussian<'_>, L1>> for CoordinateDescent where M: RawColumns<f64> + ColumnStats<f64> + ?Sized
```

<a id="impl-33820495b1364e800232fe3f3457f212e074b7b2b484d840ffaeff451bac8983"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/proximal/multivariate.rs>)

```rust
impl<P: ProximalPenalty> Solver<Problem<Box<dyn RuntimeDesign + '_>, MultivariateGaussian<'_>, AxisPenalty<P>>> for shrinkage::ProximalGradient<Vec<f64>>
```

<a id="impl-5d77e3aa7e5c8fae320cf517509afccf5a8f20a1f45e1f9e6bad916d0073f18c"></a>

## [Implementation of Solver](<f80ebf14b213d3129f84bb1ccc4912d7d7123fed16e872d24da1a9f5ef741b0a>)

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/solver/hybrid.rs>)

```rust
impl<V> Solver<Problem<Box<dyn RuntimeDesign + '_>, Box<dyn SmoothDatafit<Error = FitError> + '_>, Box<dyn ProximalPenalty<Error = FitError> + '_>>> for HybridCoordinateDescent<V>
```
