/* * Copyright (C) 2021 Christopher J. Howard * * This file is part of Antkeeper source code. * * Antkeeper source code is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Antkeeper source code is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Antkeeper source code. If not, see . */ #ifndef ANTKEEPER_MATH_MATRIX_OPERATORS_HPP #define ANTKEEPER_MATH_MATRIX_OPERATORS_HPP #include "math/matrix-type.hpp" #include "math/matrix-functions.hpp" /// @copydoc math::add(const math::matrix&, const math::matrix&) template math::matrix operator+(const math::matrix& x, const math::matrix& y); /// @copydoc math::mul(const math::matrix&, const math::matrix&) template math::matrix operator*(const math::matrix& x, const math::matrix& y); /// @copydoc math::mul(const math::matrix&, T) template math::matrix operator*(const math::matrix& m, T s); /// @copydoc math::mul(const math::matrix&, T) template math::matrix operator*(T s, const math::matrix& m); /// @copydoc math::mul(const math::matrix&, const math::vector&) template math::vector operator*(const math::matrix& m, const math::vector& v); /// @copydoc math::sub(const math::matrix&, const math::matrix&) template math::matrix operator-(const math::matrix& x, const math::matrix& y); template inline math::matrix operator+(const math::matrix& x, const math::matrix& y) { return add(x, y); } template inline math::matrix operator*(const math::matrix& x, const math::matrix& y) { return mul(x, y); } template inline math::matrix operator*(const math::matrix& m, T s) { return mul(m, s); } template inline math::matrix operator*(T s, const math::matrix& m) { return mul(m, s); } template inline math::vector operator*(const math::matrix& m, const math::vector& v) { return mul(m, v); } template inline math::matrix operator-(const math::matrix& x, const math::matrix& y) { return sub(x, y); } #endif // ANTKEEPER_MATH_MATRIX_OPERATORS_HPP