<commit_before>#pragma once

#include <ionConfig.h>

#include "SVector.h"
#include "SVector3.h"


template <typename T>
class SVector4 : public SVector<T, 4, SVector4<T> >
{

public:

	T & X, & Y, & Z, & W;

	//! Default constructor
	ION_FUNC_DEF SVector4()
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		set((T) 0);
	}
	
	//! Scalar constructor
	ION_FUNC_DEF SVector4(T const in)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		set(in);
	}

	//! Explicit constructor
	ION_FUNC_DEF SVector4(T const x, T const y, T const z, T const w)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		Values[0] = x;
		Values[1] = y;
		Values[2] = z;
		Values[3] = w;
	}

	//! Copy constructor
	ION_FUNC_DEF SVector4(SVector4<T> const & vec)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		set(vec);
	}
	
	//! Generic vector constructor
	template <typename U, u32 OtherDimension>
	ION_FUNC_DEF SVector4(SVectorBase<U, OtherDimension> const & vec)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		set(vec);
	}
	
	//! Generic vector constructor
	ION_FUNC_DEF SVector4(SVectorBase<T, 3> const & vec, T const W = 1)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		Values[0] = vec[0];
		Values[1] = vec[1];
		Values[2] = vec[2];
		Values[3] = W;
	}

	//! Assignment operator
	ION_FUNC_DEF SVector4<T> & operator = (SVector4<T> const & vec)
	{
		set(vec);

		return * this;
	}
	
	//! Generic vector assignment operator
	template <typename U, u32 OtherDimension>
	ION_FUNC_DEF SVector4<T> & operator = (SVectorBase<U, OtherDimension> const & vec)
	{
		set(vec);

		return * this;
	}

	ION_FUNC_DEF SVector3<T> xyz() const
	{
		return SVector3<T>(Values[0], Values[1], Values[2]);
	}

};


typedef SVector4<f32> SVector4f;
typedef SVector4<f64> SVector4d;<commit_msg>+ Added glm::vec4 cast for SVector4<commit_after>#pragma once

#include <ionConfig.h>

#include "SVector.h"
#include "SVector3.h"


template <typename T>
class SVector4 : public SVector<T, 4, SVector4<T> >
{

public:

	T & X, & Y, & Z, & W;

	//! Default constructor
	ION_FUNC_DEF SVector4()
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		set((T) 0);
	}
	
	//! Scalar constructor
	ION_FUNC_DEF SVector4(T const in)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		set(in);
	}

	//! Explicit constructor
	ION_FUNC_DEF SVector4(T const x, T const y, T const z, T const w)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		Values[0] = x;
		Values[1] = y;
		Values[2] = z;
		Values[3] = w;
	}

	//! GLM constructor
	template <typename U>
	ION_FUNC_DEF SVector4(glm::detail::tvec4<U> const & v)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		Values[0] = (T) v.x;
		Values[1] = (T) v.y;
		Values[2] = (T) v.z;
		Values[3] = (T) v.w;
	}

	//! Copy constructor
	ION_FUNC_DEF SVector4(SVector4<T> const & vec)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		set(vec);
	}
	
	//! Generic vector constructor
	template <typename U, u32 OtherDimension>
	ION_FUNC_DEF SVector4(SVectorBase<U, OtherDimension> const & vec)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		set(vec);
	}
	
	//! Generic vector constructor
	ION_FUNC_DEF SVector4(SVectorBase<T, 3> const & vec, T const W = 1)
		: X(Values[0]), Y(Values[1]), Z(Values[2]), W(Values[3])
	{
		Values[0] = vec[0];
		Values[1] = vec[1];
		Values[2] = vec[2];
		Values[3] = W;
	}

	//! Assignment operator
	ION_FUNC_DEF SVector4<T> & operator = (SVector4<T> const & vec)
	{
		set(vec);

		return * this;
	}
	
	//! Generic vector assignment operator
	template <typename U, u32 OtherDimension>
	ION_FUNC_DEF SVector4<T> & operator = (SVectorBase<U, OtherDimension> const & vec)
	{
		set(vec);

		return * this;
	}

	ION_FUNC_DEF SVector3<T> xyz() const
	{
		return SVector3<T>(Values[0], Values[1], Values[2]);
	}

	//! GLM constructor
	template <typename U>
	ION_FUNC_DEF operator glm::detail::tvec4<U> ()
	{
		return glm::detail::tvec4<U>(X, Y, Z, W);
	}

};


typedef SVector4<f32> SVector4f;
typedef SVector4<f64> SVector4d;
{'fraction_non_alphanumeric': 0.18754578754578755, 'fraction_numerical': 0.03711843711843712, 'mean_word_length': 4.139272271016311, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1632839', 'n_tokens_mistral': 1858, 'n_tokens_neox': 1725, 'n_words': 378}