# Template Class identity_matrix

- Defined in File matrix.hpp

## Inheritance Relationships

### Base Type

- `public cif::matrix_expression< identity_matrix< float > >` (Template Class matrix_expression)

## Class Documentation

template<typename F = float>
class identity_matrix : public cif::matrix_expression<identity_matrix<float>>

  implementation of symmetric matrix_expression with a value of 1 for the diagonal values and 0 for all the others.

  matrix is m x n, addressing i,j is 0 <= i < m and 0 <= j < n element m i,j is mapped to [i * n + j] and thus storage is row major

  Template Parameters:

    F – The type of the stored values

  Public Types

  using value_type = F

    the value type

  Public Functions

  inline identity_matrix(std::size_t n)

    constructor taking a dimension n

  inline constexpr std::size_t dim_m() const

    Return dimension m.

  inline constexpr std::size_t dim_n() const

    Return dimension n.

  inline constexpr value_type operator()(std::size_t i, std::size_t j) const

    Return the value of element [ i, j ]