# shrinkage::StoppingCriterion

Shrinkage for Rust · 0.3.0

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

```rust
pub enum StoppingCriterion
```

A convergence check with tolerances in its own units. 

<a id="variants"></a>

## Variants

<a id="variant-DualityGap"></a>

### `DualityGap`

```rust
DualityGap { absolute: f64, relative: f64 }
```

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

Stop when the absolute Gaussian lasso duality gap is at most `absolute + relative * reference_loss`. 

<a id="variant-DualityGap-field-absolute"></a>

#### `absolute`

```rust
absolute: f64
```

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

Absolute gap tolerance. 

<a id="variant-DualityGap-field-relative"></a>

#### `relative`

```rust
relative: f64
```

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

Gap tolerance relative to the fixed zero-coefficient loss. 

<a id="variant-KktViolation"></a>

### `KktViolation`

```rust
KktViolation { absolute: f64 }
```

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

Stop when the maximum absolute KKT violation is at most `absolute`. 

<a id="variant-KktViolation-field-absolute"></a>

#### `absolute`

```rust
absolute: f64
```

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

Absolute KKT tolerance. 

<a id="variant-ProximalGradientMapping"></a>

### `ProximalGradientMapping`

```rust
ProximalGradientMapping { absolute: f64 }
```

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

Stop when the infinity norm of the proximal-gradient mapping, including the unpenalized intercept derivative, is at most `absolute`. 

<a id="variant-ProximalGradientMapping-field-absolute"></a>

#### `absolute`

```rust
absolute: f64
```

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

Absolute stationarity tolerance on the optimization scale. 

<a id="impl-028b7fa55e9d72a1e6f6e52dcc17a81bd152df6586a8823b7da9ed073a566043"></a>

## Inherent implementation

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

```rust
impl StoppingCriterion
```

<a id="method-duality_gap-028b7fa55e9d72a1e6f6e52dcc17a81bd152df6586a8823b7da9ed073a566043"></a>

### `duality_gap`

```rust
pub const fn duality_gap(relative: f64) -> Self
```

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

Select a relative duality-gap tolerance. 

<a id="method-kkt_violation-028b7fa55e9d72a1e6f6e52dcc17a81bd152df6586a8823b7da9ed073a566043"></a>

### `kkt_violation`

```rust
pub const fn kkt_violation(absolute: f64) -> Self
```

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

Select an absolute KKT tolerance. 

<a id="method-proximal_gradient_mapping-028b7fa55e9d72a1e6f6e52dcc17a81bd152df6586a8823b7da9ed073a566043"></a>

### `proximal_gradient_mapping`

```rust
pub const fn proximal_gradient_mapping(absolute: f64) -> Self
```

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

Select an absolute proximal-gradient mapping tolerance. 

<a id="impl-39ea171debf5b174b4b99a55bfebafe8d2589c6a6e13be613a4ad95a5e8f919a"></a>

## Implementation of Clone

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

```rust
impl Clone for StoppingCriterion
```

<a id="method-clone-39ea171debf5b174b4b99a55bfebafe8d2589c6a6e13be613a4ad95a5e8f919a"></a>

### `clone`

```rust
fn clone(&self) -> Self
```

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

<a id="impl-313ecc9e47f09d67360dc709f31439f250121314bc84ea6154cb021f27202cc0"></a>

## Implementation of Copy

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

```rust
impl Copy for StoppingCriterion
```

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

## Implementation of Debug

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

```rust
impl Debug for StoppingCriterion
```

<a id="method-fmt-fcce12b509b1f570b565bb25e79829315b7abf6d2b6dd144995a43ec6ed9b30a"></a>

### `fmt`

```rust
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
```

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

<a id="impl-1a41c4fbe612ade3bf6740497bfd927e7cdee845f5bd10dfa390e6ff73104f30"></a>

## Implementation of PartialEq

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

```rust
impl PartialEq for StoppingCriterion
```

<a id="method-eq-1a41c4fbe612ade3bf6740497bfd927e7cdee845f5bd10dfa390e6ff73104f30"></a>

### `eq`

```rust
fn eq(&self, other: &Self) -> bool
```

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

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

## Implementation of StructuralPartialEq

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

```rust
impl StructuralPartialEq for StoppingCriterion
```

<a id="impl-50058197ff9b7fe3d8c048a58f2bb434dc980d02e1b3efd25e3af812320fc814"></a>

## Implementation of Freeze

```rust
impl Freeze for StoppingCriterion
```

<a id="impl-75066a15be02d67489a0ce5e2c49a4075fe02af397faa7c46a971baf8d9ad231"></a>

## Implementation of RefUnwindSafe

```rust
impl RefUnwindSafe for StoppingCriterion
```

<a id="impl-591447c020d019aad5353a300607368754e3a9c2b76711567167044cf43c3049"></a>

## Implementation of Send

```rust
impl Send for StoppingCriterion
```

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

## Implementation of Sync

```rust
impl Sync for StoppingCriterion
```

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

## Implementation of Unpin

```rust
impl Unpin for StoppingCriterion
```

<a id="impl-901a7f47539c0f5dce396192cbca8d9fdbe4ee628c6a8aa35bf3d53533a47079"></a>

## Implementation of UnsafeUnpin

```rust
impl UnsafeUnpin for StoppingCriterion
```

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

## Implementation of UnwindSafe

```rust
impl UnwindSafe for StoppingCriterion
```

<a id="impl-1e5682dc18e03c648aa9b125290c107c1e8d96ce8a179a8532e4057da4daf0cd"></a>

## Implementation of Any

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

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

## Implementation of Boilerplate

```rust
impl<T> Boilerplate for T where T: Copy + Send + Sync + Debug + PartialEq + 'static
```

<a id="impl-6c0b25c2c92cdb117802d9c0a4c70afc9a8bfb0da875bc6e66191e2349fcdf3f"></a>

## Implementation of Borrow

```rust
impl<T> Borrow<T> for T where T: ?Sized
```

<a id="impl-796e80d926348273a22b04d8e84f510693b11c06ec57c3c3e2e8c1524094a85c"></a>

## Implementation of BorrowMut

```rust
impl<T> BorrowMut<T> for T where T: ?Sized
```

<a id="impl-8360e4092e7ec4a05a26dd304cd739398f0cacc50c8d08dd5be0223d1a08d02e"></a>

## Implementation of ByRef

```rust
impl<T> ByRef<T> for T
```

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

## Implementation of CastableFrom

```rust
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT where ST: ?Sized, DT: ?Sized
```

<a id="impl-97b65e7dfc44b5ecaa495a3a19fe737914a1e9f8532200cf8f46191314e7d777"></a>

## Implementation of CastableFrom

```rust
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT where ST: ?Sized, DT: ?Sized
```

<a id="impl-86d7da2bfd1140cc1675dfe6a975e6a2762338ab32731152da0723858ef3aa81"></a>

## Implementation of CloneToUninit

```rust
impl<T> CloneToUninit for T where T: Clone
```

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

## Implementation of From

```rust
impl<T> From<T> for T
```

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

## Implementation of Imply

```rust
impl<T, U> Imply<T> for U where T: ?Sized, U: ?Sized
```

<a id="impl-85eec431edd188129f88290bbcb748e4d2fdc97f7efef3c162b8c252286ffec0"></a>

## Implementation of Into

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

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

## Implementation of IntoEither

```rust
impl<T> IntoEither for T
```

<a id="impl-5655b1ef858b34a584cb80104f040c8a4063ced0d281311a0833ed12aefde86e"></a>

## Implementation of Pointable

```rust
impl<T> Pointable for T
```

<a id="impl-8cc2aa01198fc9fa44f08b889f62988d70d2a7f4f0f11f4666d4c08bdaddb22a"></a>

## Implementation of Read

```rust
impl<T> Read<Exclusive, BecauseExclusive> for T where T: ?Sized
```

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

## Implementation of Same

```rust
impl<T> Same for T
```

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

## Implementation of Scalar

```rust
impl<T> Scalar for T where T: 'static + Clone + PartialEq + Debug
```

<a id="impl-7ee6ff38d6674f5edfe4734359062c2a67a572cff5899a89704764822b931c7f"></a>

## Implementation of SupersetOf

```rust
impl<SS, SP> SupersetOf<SS> for SP where SS: SubsetOf<SP>
```

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

## Implementation of ToOwned

```rust
impl<T> ToOwned for T where T: Clone
```

<a id="impl-83960135d00d98080c95a08867729696e36811280c2dd9cf34c1b4fe21c81e18"></a>

## Implementation of TryFrom

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

<a id="impl-1cc495bcaa5112ffb304e7f0de674feca391fd97f47bec86033a9225b72ac05c"></a>

## Implementation of TryInto

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