# shrinkage::MatrixDesign

Shrinkage for Rust · 0.3.0

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

```rust
pub struct MatrixDesign<'a, M: ?Sized, V = Vec<f64>>
```

A borrowed concrete LazyMatrix backend for runtime proximal composition. 

`V` is the native vector accepted by the backend's products. This adapter retains static column access and never depends on a datafit or penalty type. 

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

## Inherent implementation

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

```rust
impl<'a, M: ?Sized, V> MatrixDesign<'a, M, V>
```

<a id="method-new-c3a47d35896949cf7124c99c5e2519fc62c9c51cfdf24f3d26af65c58560f595"></a>

### `new`

```rust
pub fn new(matrix: &'a M) -> Self
```

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

Borrow a backend; validation and normalization occur during fitting. 

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

## [Implementation of RuntimeDesign](<87877080e6d8127e48166e3cbed062c7ff789669a6c296a69957c065250fe2af>)

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

```rust
impl<M, V> RuntimeDesign for MatrixDesign<'_, M, V> where M: RawColumns<f64> + ColumnStats<f64> + MatVecInto<V> + MatTransposeVecInto<V> + ?Sized, <M as >::Error: Error + 'static, V: ProximalVector + 'static
```

<a id="method-ncols-d2a6233f98f70abe5a6376700d0519a5f54f86f80ca68050fcfc6ded18fa0179"></a>

### `ncols`

```rust
fn ncols(&self) -> usize
```

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

<a id="method-nrows-d2a6233f98f70abe5a6376700d0519a5f54f86f80ca68050fcfc6ded18fa0179"></a>

### `nrows`

```rust
fn nrows(&self) -> usize
```

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

<a id="method-prepare-d2a6233f98f70abe5a6376700d0519a5f54f86f80ca68050fcfc6ded18fa0179"></a>

### `prepare`

```rust
fn prepare(
    &self,
    normalization: Normalization,
    centers: Option<&[f64]>,
    scales: Option<&[f64]>,
    fit_intercept: bool
) -> Result<Box<dyn ProximalDesign<Error = BackendError> + '_>, FitError<BackendError>>
```

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

<a id="impl-550724839d5b347aba9af5b54011c451cd9bc357daa21fcc853fef9d5c63f9bd"></a>

## Implementation of Freeze

```rust
impl<'a, M, V> Freeze for MatrixDesign<'a, M, V> where &'a M: Freeze, PhantomData<V>: Freeze, M: ?Sized
```

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

## Implementation of RefUnwindSafe

```rust
impl<'a, M, V> RefUnwindSafe for MatrixDesign<'a, M, V> where &'a M: RefUnwindSafe, PhantomData<V>: RefUnwindSafe, M: ?Sized
```

<a id="impl-0930bee07f567318b66db50834c47d492f1f1472f2a0f0fb28d3f57611f11df3"></a>

## Implementation of Send

```rust
impl<'a, M, V> Send for MatrixDesign<'a, M, V> where &'a M: Send, PhantomData<V>: Send, M: ?Sized
```

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

## Implementation of Sync

```rust
impl<'a, M, V> Sync for MatrixDesign<'a, M, V> where &'a M: Sync, PhantomData<V>: Sync, M: ?Sized
```

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

## Implementation of Unpin

```rust
impl<'a, M, V> Unpin for MatrixDesign<'a, M, V> where &'a M: Unpin, PhantomData<V>: Unpin, M: ?Sized
```

<a id="impl-443d0ae4280a9ae5875090df756ec8359a55e9973ef6e591b7348b1f4cb129cc"></a>

## Implementation of UnsafeUnpin

```rust
impl<'a, M, V> UnsafeUnpin for MatrixDesign<'a, M, V> where &'a M: UnsafeUnpin, PhantomData<V>: UnsafeUnpin, M: ?Sized
```

<a id="impl-87cfb588bfc0aeb07d69013ed9055f03f5cd48eb0edf140be8366b3781abc070"></a>

## Implementation of UnwindSafe

```rust
impl<'a, M, V> UnwindSafe for MatrixDesign<'a, M, V> where &'a M: UnwindSafe, PhantomData<V>: UnwindSafe, M: ?Sized
```

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

## Implementation of Any

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

<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-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-7ee6ff38d6674f5edfe4734359062c2a67a572cff5899a89704764822b931c7f"></a>

## Implementation of SupersetOf

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

<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>
```
