#ifndef COMMON_VECTOR_UTILS_H_
#define COMMON_VECTOR_UTILS_H_
#include <cmath>
#include <cstddef>
#include <ostream>
#include <type_traits>
#include "common/debug.h"
namespace angle
{
template <size_t Dimension, typename Type>
class Vector;
Vector2;
Vector3;
Vector4;
Vector2I;
Vector3I;
Vector4I;
Vector2U;
Vector3U;
Vector4U;
template <size_t Dimension, typename Type>
class VectorBase
{ … };
template <size_t Dimension, typename Type>
std::ostream &operator<<(std::ostream &ostream, const VectorBase<Dimension, Type> &vector);
Vector<2, Type>;
template <typename Type>
std::ostream &operator<<(std::ostream &ostream, const Vector<2, Type> &vector);
Vector<3, Type>;
template <typename Type>
std::ostream &operator<<(std::ostream &ostream, const Vector<3, Type> &vector);
Vector<4, Type>;
template <typename Type>
std::ostream &operator<<(std::ostream &ostream, const Vector<4, Type> &vector);
template <size_t Dimension, typename Type>
VectorBase<Dimension, Type>::VectorBase(Type element)
{ … }
template <size_t Dimension, typename Type>
template <typename Type2>
VectorBase<Dimension, Type>::VectorBase(const VectorBase<Dimension, Type2> &other)
{ … }
template <size_t Dimension, typename Type>
template <typename Arg1, typename Arg2, typename... Args>
VectorBase<Dimension, Type>::VectorBase(const Arg1 &arg1, const Arg2 &arg2, const Args &...args)
{ … }
template <size_t Dimension, typename Type>
template <size_t CurrentIndex, size_t OtherDimension, typename OtherType, typename... Args>
void VectorBase<Dimension, Type>::initWithList(const Vector<OtherDimension, OtherType> &arg1,
const Args &...args)
{ … }
template <size_t Dimension, typename Type>
template <size_t CurrentIndex, typename OtherType, typename... Args>
typename std::enable_if<std::is_arithmetic<OtherType>::value>::type
VectorBase<Dimension, Type>::initWithList(OtherType arg1, const Args &...args)
{ … }
template <size_t Dimension, typename Type>
template <size_t CurrentIndex>
void VectorBase<Dimension, Type>::initWithList() const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::Load(const Type *source)
{ … }
template <size_t Dimension, typename Type>
void VectorBase<Dimension, Type>::Store(const Vector<Dimension, Type> &source, Type *destination)
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::operator+() const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::operator-() const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::operator+(
const Vector<Dimension, Type> &other) const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::operator-(
const Vector<Dimension, Type> &other) const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::operator*(
const Vector<Dimension, Type> &other) const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::operator/(
const Vector<Dimension, Type> &other) const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::operator*(Type other) const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::operator/(Type other) const
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator+=(
const Vector<Dimension, Type> &other)
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator-=(
const Vector<Dimension, Type> &other)
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator*=(
const Vector<Dimension, Type> &other)
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator/=(
const Vector<Dimension, Type> &other)
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator*=(Type other)
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator/=(Type other)
{ … }
template <size_t Dimension, typename Type>
bool VectorBase<Dimension, Type>::operator==(const VectorBase<Dimension, Type> &other) const
{ … }
template <size_t Dimension, typename Type>
bool VectorBase<Dimension, Type>::operator!=(const VectorBase<Dimension, Type> &other) const
{ … }
template <size_t Dimension, typename Type>
Type VectorBase<Dimension, Type>::length() const
{ … }
template <size_t Dimension, typename Type>
Type VectorBase<Dimension, Type>::lengthSquared() const
{ … }
template <size_t Dimension, typename Type>
Type VectorBase<Dimension, Type>::dot(const VectorBase<Dimension, Type> &other) const
{ … }
template <size_t Dimension, typename Type>
std::ostream &operator<<(std::ostream &ostream, const VectorBase<Dimension, Type> &vector)
{ … }
template <size_t Dimension, typename Type>
Vector<Dimension, Type> VectorBase<Dimension, Type>::normalized() const
{ … }
template <typename Type>
std::ostream &operator<<(std::ostream &ostream, const Vector<2, Type> &vector)
{ … }
template <typename Type>
Vector<3, Type> Vector<3, Type>::cross(const Vector<3, Type> &other) const
{ … }
template <typename Type>
std::ostream &operator<<(std::ostream &ostream, const Vector<3, Type> &vector)
{ … }
template <typename Type>
std::ostream &operator<<(std::ostream &ostream, const Vector<4, Type> &vector)
{ … }
}
#endif