# [−][src]Trait alga::linear::NormedSpace

    pub trait NormedSpace: VectorSpace<Field = Self::ComplexField> {
        type RealField: RealField;
        type ComplexField: ComplexField<RealField = Self::RealField>;
        fn norm_squared(&self) -> Self::RealField;
        fn norm(&self) -> Self::RealField;
        fn normalize(&self) -> Self;
        fn normalize_mut(&mut self) -> Self::RealField;
        fn try_normalize(&self, eps: Self::RealField) -> Option<Self>;
        fn try_normalize_mut(
            &mut self,
            eps: Self::RealField
        ) -> Option<Self::RealField>;
    }

A normed vector space.

## Associated Types

### `type RealField: RealField`

The result of the norm (not necessarily the same same as the field used by this vector space).

### `type ComplexField: ComplexField<RealField = Self::RealField>`

The field of this space must be this complex number.

Loading content...

## Required methods

### `fn norm_squared(&self) -> Self::RealField`

The squared norm of this vector.

### `fn norm(&self) -> Self::RealField`

The norm of this vector.

### `fn normalize(&self) -> Self`

Returns a normalized version of this vector.

### `fn normalize_mut(&mut self) -> Self::RealField`

Normalizes this vector in-place and returns its norm.

### `fn try_normalize(&self, eps: Self::RealField) -> Option<Self>`

Returns a normalized version of this vector unless its norm as smaller or equal to `eps`.

### `fn try_normalize_mut(&mut self, eps: Self::RealField) -> Option<Self::RealField>`

Normalizes this vector in-place or does nothing if its norm is smaller or equal to `eps`.

If the normalization succeeded, returns the old normal of this vector.

Loading content...

## Implementations on Foreign Types

### `impl<N: RealField> NormedSpace for Complex<N>`[src]

#### `type RealField = N`

#### `type ComplexField = N`

#### `fn norm_squared(&self) -> Self::RealField`[src]

#### `fn norm(&self) -> Self::RealField`[src]

#### `fn normalize(&self) -> Self`[src]

#### `fn normalize_mut(&mut self) -> Self::RealField`[src]

#### `fn try_normalize(&self, eps: Self::RealField) -> Option<Self>`[src]

#### `fn try_normalize_mut(&mut self, eps: Self::RealField) -> Option<Self::RealField>`[src]

Loading content...

## Implementors

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)