Compare commits

..

No commits in common. "3c8ad61435c66352ab1d061e70f8a5f69a5636e4" and "2010504e84e0db2245b24afac69838d0d85353b2" have entirely different histories.

7 changed files with 0 additions and 120 deletions

View File

@ -74,11 +74,6 @@ private:
return std::sqrt(dot3(v, v));
}
[[nodiscard]] inline float magnitude3_sq(vec4 v) noexcept
{
return dot3(v, v);
}
[[nodiscard]] inline vec4 norm3(vec4 v) noexcept
{
const float inv = 1.0f / magnitude3(v); // normalize xyz, keep w

View File

@ -101,12 +101,6 @@ vf4 magnitude3(vf4 v) noexcept
return _mm_sqrt_ps(dot3(v, v));
}
[[nodiscard]] TNVX_INLINE
vf4 magnitude3_sq(vf4 v) noexcept
{
return dot3(v, v);
}
[[nodiscard]] TNVX_INLINE
vf4 norm3(vf4 v) noexcept
{

View File

@ -1,35 +0,0 @@
#pragma once
#include "core.h"
#include "expression.h"
#include "traits.h"
#include "concepts.h"
namespace tnvx
{
template<vec_expr E>
struct Magn3Sq : Expr<Magn3Sq<E>>
{
TNVX_INLINE
explicit Magn3Sq(const E& e) noexcept;
[[nodiscard]] TNVX_INLINE
vf4 eval() const noexcept;
[[nodiscard]] TNVX_INLINE
operator float() const noexcept;
private:
tnvx_ref_or_value_t<E> _e;
};
template<vec_expr E> inline constexpr bool is_scalar_expr<Magn3Sq<E>> = true;
template<vec_expr E>
[[nodiscard]] TNVX_INLINE
Magn3Sq<E> magnitude3_sq(const E& e) noexcept;
}
#include "magnitude3_sq_impl.hpp"

View File

@ -1,37 +0,0 @@
#pragma once
#include "magnitude3_sq.h"
namespace tnvx
{
template<vec_expr E>
TNVX_INLINE
Magn3Sq<E>::Magn3Sq(const E& e) noexcept
: _e(e)
{
}
template<vec_expr E>
TNVX_INLINE
vf4 Magn3Sq<E>::eval() const noexcept
{
return detail::magnitude3_sq(_e.eval());
}
template<vec_expr E>
TNVX_INLINE
Magn3Sq<E>::operator float() const noexcept
{
return detail::to_float(eval());
}
template<vec_expr E>
TNVX_INLINE
Magn3Sq<E> magnitude3_sq(const E& e) noexcept
{
return Magn3Sq<E>(e);
}
}

View File

@ -9,7 +9,6 @@
#include "expressions/dot3.h"
#include "expressions/dot4.h"
#include "expressions/magnitude3.h"
#include "expressions/magnitude3_sq.h"
#include "expressions/norm3.h"
#include "expressions/cross3.h"
#include "expressions/vec4.h"

View File

@ -123,24 +123,6 @@ TEST(naive_vec4, magnitude_b)
EXPECT_FLOAT_EQ(check, result);
}
TEST(naive_vec4, magnitude3_sq_a)
{
vec4 a = { 1.0f, 0.0f, 0.0f, 0.0f };
float check = 1.0f;
float result = magnitude3_sq(a);
EXPECT_FLOAT_EQ(check, result);
}
TEST(naive_vec4, magnitude3_sq_b)
{
vec4 a = { 1.0f, 0.0f, 1.0f, 1.0f };
float check = 2.0f;
float result = magnitude3_sq(a);
EXPECT_FLOAT_EQ(check, result);
}
TEST(naive_vec4, expression_a)
{
vec4 a = { 1.0f, 1.0f, 1.0f, 1.0f };

View File

@ -121,24 +121,6 @@ TEST(vec4, magnitude_b)
EXPECT_FLOAT_EQ(check, result);
}
TEST(vec4, magnitude3_sq_a)
{
vec4 a = { 1.0f, 0.0f, 0.0f, 0.0f };
float check = 1.0f;
float result = magnitude3_sq(a);
EXPECT_FLOAT_EQ(check, result);
}
TEST(vec4, magnitude3_sq_b)
{
vec4 a = { 1.0f, 0.0f, 1.0f, 1.0f };
float check = 2.0f;
float result = magnitude3_sq(a);
EXPECT_FLOAT_EQ(check, result);
}
TEST(vec4, expression_a)
{
vec4 a = { 1.0f, 1.0f, 1.0f, 1.0f };