<commit_before>
#pragma once



#define _USE_MATH_DEFINES // Enable non-standard math defines (MSVC)
#include <math.h>





template <typename T>
// tolua_begin
class Vector3
{

	TOLUA_TEMPLATE_BIND((T, int, float, double))

public:

	T x, y, z;


	inline Vector3(void) : x(0), y(0), z(0) {}
	inline Vector3(T a_x, T a_y, T a_z) : x(a_x), y(a_y), z(a_z) {}


	// Hardcoded copy constructors (tolua++ does not support function templates .. yet)
	Vector3(const Vector3<float>  & a_Rhs) : x((T) a_Rhs.x), y((T) a_Rhs.y), z((T) a_Rhs.z) {}
	Vector3(const Vector3<double> & a_Rhs) : x((T) a_Rhs.x), y((T) a_Rhs.y), z((T) a_Rhs.z) {}
	Vector3(const Vector3<int>    & a_Rhs) : x((T) a_Rhs.x), y((T) a_Rhs.y), z((T) a_Rhs.z) {}


	// tolua_end
	template <typename _T>
	Vector3(const Vector3<_T> & a_Rhs) : x(a_Rhs.x), y(a_Rhs.y), z(a_Rhs.z) {}

	template <typename _T>
	Vector3(const Vector3<_T> * a_Rhs) : x(a_Rhs->x), y(a_Rhs->y), z(a_Rhs->z) {}
	// tolua_begin


	inline void Set(T a_x, T a_y, T a_z)
	{
		x = a_x;
		y = a_y;
		z = a_z;
	}

	inline void Normalize(void)
	{
		double Len = 1.0 / Length();

		x = (T)(x * Len);
		y = (T)(y * Len);
		z = (T)(z * Len);
	}

	inline Vector3<T> NormalizeCopy(void) const
	{
		double Len = 1.0 / Length();

		return Vector3<T>(
			(T)(x * Len),
			(T)(y * Len),
			(T)(z * Len)
		);
	}

	inline void NormalizeCopy(Vector3<T> & a_Rhs) const
	{
		double Len = 1.0 / Length();

		a_Rhs.Set(
			(T)(x * Len),
			(T)(y * Len),
			(T)(z * Len)
		);
	}

	inline double Length(void) const
	{
		return sqrt((double)(x * x + y * y + z * z));
	}

	inline double SqrLength(void) const
	{
		return x * x + y * y + z * z;
	}

	inline T Dot(const Vector3<T> & a_Rhs) const
	{
		return x * a_Rhs.x + y * a_Rhs.y + z * a_Rhs.z;
	}

	inline Vector3<T> Cross(const Vector3<T> & a_Rhs) const
	{
		return Vector3<T>(
			y * a_Rhs.z - z * a_Rhs.y,
			z * a_Rhs.x - x * a_Rhs.z,
			x * a_Rhs.y - y * a_Rhs.x
		);
	}

	inline bool Equals(const Vector3<T> & a_Rhs) const
	{
		return x == a_Rhs.x && y == a_Rhs.y && z == a_Rhs.z;
	}

	inline bool operator == (const Vector3<T> & a_Rhs) const
	{
		return Equals(a_Rhs);
	}

	inline bool operator < (const Vector3<T> & a_Rhs)
	{
		// return (x < a_Rhs.x) && (y < a_Rhs.y) && (z < a_Rhs.z); ?
		return (x < a_Rhs.x) || (x == a_Rhs.x && y < a_Rhs.y) || (x == a_Rhs.x && y == a_Rhs.y && z < a_Rhs.z);
	}

	inline void Move(T a_X, T a_Y, T a_Z)
	{
		x += a_X;
		y += a_Y;
		z += a_Z;
	}

	inline void Move(const Vector3<T> & a_Diff)
	{
		x += a_Diff.x;
		y += a_Diff.y;
		z += a_Diff.z;
	}

	// tolua_end

	inline void operator += (const Vector3<T> & a_Rhs)
	{
		x += a_Rhs.x;
		y += a_Rhs.y;
		z += a_Rhs.z;
	}

	inline void operator -= (const Vector3<T> & a_Rhs)
	{
		x -= a_Rhs.x;
		y -= a_Rhs.y;
		z -= a_Rhs.z;
	}

	inline void operator *= (const Vector3<T> & a_Rhs)
	{
		x *= a_Rhs.x;
		y *= a_Rhs.y;
		z *= a_Rhs.z;
	}

	inline void operator *= (T a_v)
	{
		x *= a_v;
		y *= a_v;
		z *= a_v;
	}

	template <typename T2> inline Vector3<T> & operator =(const Vector3<T2> & a_Rhs)
	{
		x = (T)a_Rhs.x;
		y = (T)a_Rhs.y;
		z = (T)a_Rhs.z;
		return *this;
	}

	// tolua_begin
	
	inline Vector3<T> operator + (const Vector3<T>& a_Rhs) const
	{
		return Vector3<T>(
			x + a_Rhs.x,
			y + a_Rhs.y,<commit_msg>Implemented a true assignment operator for Vector3.<commit_after>
#pragma once



#define _USE_MATH_DEFINES // Enable non-standard math defines (MSVC)
#include <math.h>





template <typename T>
// tolua_begin
class Vector3
{

	TOLUA_TEMPLATE_BIND((T, int, float, double))

public:

	T x, y, z;


	inline Vector3(void) : x(0), y(0), z(0) {}
	inline Vector3(T a_x, T a_y, T a_z) : x(a_x), y(a_y), z(a_z) {}


	// Hardcoded copy constructors (tolua++ does not support function templates .. yet)
	Vector3(const Vector3<float>  & a_Rhs) : x((T) a_Rhs.x), y((T) a_Rhs.y), z((T) a_Rhs.z) {}
	Vector3(const Vector3<double> & a_Rhs) : x((T) a_Rhs.x), y((T) a_Rhs.y), z((T) a_Rhs.z) {}
	Vector3(const Vector3<int>    & a_Rhs) : x((T) a_Rhs.x), y((T) a_Rhs.y), z((T) a_Rhs.z) {}


	// tolua_end
	template <typename _T>
	Vector3(const Vector3<_T> & a_Rhs) : x(a_Rhs.x), y(a_Rhs.y), z(a_Rhs.z) {}

	template <typename _T>
	Vector3(const Vector3<_T> * a_Rhs) : x(a_Rhs->x), y(a_Rhs->y), z(a_Rhs->z) {}
	// tolua_begin


	inline void Set(T a_x, T a_y, T a_z)
	{
		x = a_x;
		y = a_y;
		z = a_z;
	}

	inline void Normalize(void)
	{
		double Len = 1.0 / Length();

		x = (T)(x * Len);
		y = (T)(y * Len);
		z = (T)(z * Len);
	}

	inline Vector3<T> NormalizeCopy(void) const
	{
		double Len = 1.0 / Length();

		return Vector3<T>(
			(T)(x * Len),
			(T)(y * Len),
			(T)(z * Len)
		);
	}

	inline void NormalizeCopy(Vector3<T> & a_Rhs) const
	{
		double Len = 1.0 / Length();

		a_Rhs.Set(
			(T)(x * Len),
			(T)(y * Len),
			(T)(z * Len)
		);
	}

	inline double Length(void) const
	{
		return sqrt((double)(x * x + y * y + z * z));
	}

	inline double SqrLength(void) const
	{
		return x * x + y * y + z * z;
	}

	inline T Dot(const Vector3<T> & a_Rhs) const
	{
		return x * a_Rhs.x + y * a_Rhs.y + z * a_Rhs.z;
	}

	inline Vector3<T> Cross(const Vector3<T> & a_Rhs) const
	{
		return Vector3<T>(
			y * a_Rhs.z - z * a_Rhs.y,
			z * a_Rhs.x - x * a_Rhs.z,
			x * a_Rhs.y - y * a_Rhs.x
		);
	}

	inline bool Equals(const Vector3<T> & a_Rhs) const
	{
		return x == a_Rhs.x && y == a_Rhs.y && z == a_Rhs.z;
	}

	inline bool operator == (const Vector3<T> & a_Rhs) const
	{
		return Equals(a_Rhs);
	}

	inline bool operator < (const Vector3<T> & a_Rhs)
	{
		// return (x < a_Rhs.x) && (y < a_Rhs.y) && (z < a_Rhs.z); ?
		return (x < a_Rhs.x) || (x == a_Rhs.x && y < a_Rhs.y) || (x == a_Rhs.x && y == a_Rhs.y && z < a_Rhs.z);
	}

	inline void Move(T a_X, T a_Y, T a_Z)
	{
		x += a_X;
		y += a_Y;
		z += a_Z;
	}

	inline void Move(const Vector3<T> & a_Diff)
	{
		x += a_Diff.x;
		y += a_Diff.y;
		z += a_Diff.z;
	}

	// tolua_end

	inline void operator += (const Vector3<T> & a_Rhs)
	{
		x += a_Rhs.x;
		y += a_Rhs.y;
		z += a_Rhs.z;
	}

	inline void operator -= (const Vector3<T> & a_Rhs)
	{
		x -= a_Rhs.x;
		y -= a_Rhs.y;
		z -= a_Rhs.z;
	}

	inline void operator *= (const Vector3<T> & a_Rhs)
	{
		x *= a_Rhs.x;
		y *= a_Rhs.y;
		z *= a_Rhs.z;
	}

	inline void operator *= (T a_v)
	{
		x *= a_v;
		y *= a_v;
		z *= a_v;
	}

	inline Vector3<T> & operator = (const Vector3<T> & a_Rhs)
	{
		x = a_Rhs.x;
		y = a_Rhs.y;
		z = a_Rhs.z;
		return *this;
	}

	template <typename T2> inline Vector3<T> & operator = (const Vector3<T2> & a_Rhs)
	{
		x = (T)a_Rhs.x;
		y = (T)a_Rhs.y;
		z = (T)a_Rhs.z;
		return *this;
	}

	// tolua_begin
	
	inline Vector3<T> operator + (const Vector3<T>& a_Rhs) const
	{
		return Vector3<T>(
			x + a_Rhs.x,
			y + a_Rhs.y,
{'fraction_non_alphanumeric': 0.1919629518972214, 'fraction_numerical': 0.013295488497161638, 'mean_word_length': 2.727728285077951, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7505939', 'n_tokens_mistral': 3573, 'n_tokens_neox': 3331, 'n_words': 755}