template<typename T1, typename T2 = T1>
numeric::Matrix2 class

Matrix2.

Template parameters
T1
T2

Constructors, destructors, conversion operators

Matrix2(T1&& x, T2&& y) constexpr noexcept
Construct a new Matrix2 object.

Public functions

auto x() const -> const T1 & -> auto constexpr
auto y() const -> const T2 & -> auto constexpr

Arithmetic operators

definie +, -, *, /, +=, -=, *=, /=, etc.

auto operator-() const -> Matrix2< T1, T2 > -> auto constexpr
Negate.
template<typename U1, typename U2>
auto operator+=(const Matrix2<U1, U2>& other) -> Matrix2< T1, T2 > & -> CONSTEXPR14 auto
Add.
template<typename U1, typename U2>
auto operator-=(const Matrix2<U1, U2>& other) -> Matrix2< T1, T2 > & -> CONSTEXPR14 auto
Substract.
template<typename R>
auto operator*=(const R& alpha) -> Matrix2< T1, T2 > & -> CONSTEXPR14 auto
Multiply.
template<typename R>
auto operator/=(const R& alpha) -> Matrix2< T1, T2 > & -> CONSTEXPR14 auto
Divide.
template<typename U1, typename U2>
auto mdot(const Vector2<U1, U2>& other) const -> Vector2< U1, U2 > -> auto constexpr
Multiply with Vector2.
auto det() const -> double -> auto constexpr
Det.
template<typename U1, typename U2>
auto operator+(Matrix2<T1, T2> x, const Matrix2<U1, U2>& y) -> Matrix2< T1, T2 > -> friend auto constexpr
Add.
template<typename U1, typename U2>
auto operator-(Matrix2<T1, T2> x, const Matrix2<U1, U2>& y) -> Matrix2< T1, T2 > -> friend auto constexpr
Substract.
template<typename R>
auto operator*(Matrix2<T1, T2> x, const R& alpha) -> Matrix2< T1, T2 > -> friend auto constexpr
Multiply by a scalar.
template<typename R>
auto operator*(const R& alpha, Matrix2<T1, T2> x) -> Matrix2< T1, T2 > -> friend auto constexpr
Multiply (by a scalar)
template<typename R>
auto operator/(Matrix2<T1, T2> x, const R& alpha) -> Matrix2< T1, T2 > -> friend auto constexpr
Divide (by a scalar)

Function documentation

template<typename T1, typename T2>
numeric::Matrix2<T1, T2>::Matrix2(T1&& x, T2&& y) constexpr noexcept

Construct a new Matrix2 object.

Parameters
in
in

template<typename T1, typename T2>
auto numeric::Matrix2<T1, T2>::x() const -> const T1 & constexpr

Returns constexpr const T1&

template<typename T1, typename T2>
auto numeric::Matrix2<T1, T2>::y() const -> const T2 & constexpr

Returns constexpr const T2&

template<typename T1, typename T2>
auto numeric::Matrix2<T1, T2>::operator-() const -> Matrix2< T1, T2 > constexpr

Negate.

Returns Matrix2<T1, T2>

template<typename T1, typename T2> template<typename U1, typename U2>
CONSTEXPR14 auto numeric::Matrix2<T1, T2>::operator+=(const Matrix2<U1, U2>& other) -> Matrix2< T1, T2 > &

Add.

Template parameters
U1
U2
Parameters
other in
Returns Matrix2<T1, T2>&

template<typename T1, typename T2> template<typename U1, typename U2>
CONSTEXPR14 auto numeric::Matrix2<T1, T2>::operator-=(const Matrix2<U1, U2>& other) -> Matrix2< T1, T2 > &

Substract.

Template parameters
U1
U2
Parameters
other in
Returns Matrix2<T1, T2>&

template<typename T1, typename T2> template<typename R>
CONSTEXPR14 auto numeric::Matrix2<T1, T2>::operator*=(const R& alpha) -> Matrix2< T1, T2 > &

Multiply.

Template parameters
R
Parameters
alpha in
Returns Matrix2<T1, T2>&

template<typename T1, typename T2> template<typename R>
CONSTEXPR14 auto numeric::Matrix2<T1, T2>::operator/=(const R& alpha) -> Matrix2< T1, T2 > &

Divide.

Template parameters
R
Parameters
alpha in
Returns Matrix2<T1, T2>&

template<typename T1, typename T2> template<typename U1, typename U2>
auto numeric::Matrix2<T1, T2>::mdot(const Vector2<U1, U2>& other) const -> Vector2< U1, U2 > constexpr

Multiply with Vector2.

Template parameters
U1
U2
Parameters
other in
Returns Vector2<U1, U2>

template<typename T1, typename T2>
auto numeric::Matrix2<T1, T2>::det() const -> double constexpr

Det.

Returns double

template<typename T1, typename T2> template<typename U1, typename U2>
friend auto numeric::Matrix2<T1, T2>::operator+(Matrix2<T1, T2> x, const Matrix2<U1, U2>& y) -> Matrix2< T1, T2 > constexpr

Add.

Template parameters
U1
U2
Parameters
in
in
Returns Matrix2<T1, T2>

template<typename T1, typename T2> template<typename U1, typename U2>
friend auto numeric::Matrix2<T1, T2>::operator-(Matrix2<T1, T2> x, const Matrix2<U1, U2>& y) -> Matrix2< T1, T2 > constexpr

Substract.

Template parameters
U1
U2
Parameters
in
in
Returns Matrix2<T1, T2>

template<typename T1, typename T2> template<typename R>
friend auto numeric::Matrix2<T1, T2>::operator*(Matrix2<T1, T2> x, const R& alpha) -> Matrix2< T1, T2 > constexpr

Multiply by a scalar.

Template parameters
R
Parameters
in
alpha in
Returns Matrix2<T1, T2>

template<typename T1, typename T2> template<typename R>
friend auto numeric::Matrix2<T1, T2>::operator*(const R& alpha, Matrix2<T1, T2> x) -> Matrix2< T1, T2 > constexpr

Multiply (by a scalar)

Template parameters
R
Parameters
alpha in
in
Returns Matrix2<T1, T2>

template<typename T1, typename T2> template<typename R>
friend auto numeric::Matrix2<T1, T2>::operator/(Matrix2<T1, T2> x, const R& alpha) -> Matrix2< T1, T2 > constexpr

Divide (by a scalar)

Template parameters
R
Parameters
in
alpha in
Returns Matrix2<T1, T2>