# One¶

template<typename T>
struct One<T, std::enable_if_t<IsMatrix<T>>>

Defined in matrix.hpp.

Specialization of the adapter One for types T such that the value of IsMatrix<T> is true.

Tparam

T the type of matrices.

inline T operator()(T const &x) const

Returns the identity matrix.

param x

a matrix of type T.

returns

a matrix of type T.

exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

$$O(m ^ 2)$$ where $$m$$ is the number of rows of the matrix x.

Warning

This function only works for square matrices.

See static StaticMatrix StaticMatrix::identity, or static DynamicMatrix DynamicMatrix::identity(size_t n) for further details.