/**
This file is a part of our_dick
Copyright (C) 2020 rexy712
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
#ifndef REXY_VEC_HPP
#define REXY_VEC_HPP
#include "mat.hpp"
namespace math{
template
class vector : public matrix_base
{
private:
using base = matrix_base;
public:
using value_type = typename base::value_type;
using size_type = typename base::size_type;
using pointer = typename base::pointer;
using const_pointer = typename base::const_pointer;
using reference = typename base::reference;
using const_reference = typename base::const_reference;
public:
using base::base;
constexpr vector(const vector&) = default;
constexpr vector(vector&&) = default;
~vector() = default;
//Assignement
constexpr vector& operator=(const vector&) = default;
constexpr vector& operator=(vector&&) = default;
template
constexpr vector& operator=(const vector& m);
constexpr reference operator[](size_type i);
constexpr const_reference operator[](size_type i)const;
constexpr reference x();
constexpr const_reference x()const;
template
constexpr reference y();
template
constexpr const_reference y()const;
template
constexpr reference z();
template
constexpr const_reference z()const;
template
constexpr reference w();
template
constexpr const_reference w()const;
};
template
constexpr auto operator*(const matrix& left, const vector& right);
template
constexpr auto operator*(const vector& left, const vector& right);
template::value,int> = 0>
constexpr auto operator*(const vector& left, U&& right);
template::value,int> = 0>
constexpr auto operator*(U&& left, const vector& right);
template::value,int> = 0>
constexpr auto operator/(const vector& left, U&& right);
template
constexpr auto operator+(const vector& left, const vector& right);
template
constexpr auto operator-(const vector& left, const vector& right);
template
constexpr auto operator-(const vector& left);
template::value,int> = 0>
constexpr decltype(auto) operator*=(vector& left, U&& right);
template::value,int> = 0>
constexpr decltype(auto) operator/=(vector& left, U&& right);
template
constexpr decltype(auto) operator+=(vector& left, const vector& right);
template
constexpr decltype(auto) operator-=(vector& left, const vector& right);
}
#include "vec.tpp"
#endif