Merge branch 'master' into lMaxNorm-proposal

This commit is contained in:
Liam
2019-08-25 09:03:13 +01:00
committed by GitHub
688 changed files with 1469 additions and 1375 deletions

View File

@@ -4,6 +4,8 @@
#include <vector>
#include <ctime>
#include <cstdio>
#if GLM_LANG & GLM_LANG_CXX11_FLAG
#include <chrono>
namespace isPowerOfTwo
@@ -643,12 +645,12 @@ namespace findNSB
Error += run<glm::uint16>();
Error += run<glm::uint32>();
Error += run<glm::uint64>();
/*
Error += run<glm::int8>();
Error += run<glm::int16>();
Error += run<glm::int32>();
Error += run<glm::int64>();
*/
return Error;
}
}//namespace findNSB
@@ -673,3 +675,12 @@ int main()
return Error;
}
#else
int main()
{
return 0;
}
#endif

View File

@@ -486,7 +486,7 @@ namespace findNSB
int test()
{
int Error = 0;
/*
Error += run<1, glm::uint8>();
Error += run<2, glm::uint8>();
Error += run<3, glm::uint8>();
@@ -500,14 +500,34 @@ namespace findNSB
Error += run<1, glm::uint32>();
Error += run<2, glm::uint32>();
Error += run<3, glm::uint32>();
*/
Error += run<4, glm::uint32>();
/*
Error += run<1, glm::uint64>();
Error += run<2, glm::uint64>();
Error += run<3, glm::uint64>();
Error += run<4, glm::uint64>();
*/
Error += run<1, glm::int8>();
Error += run<2, glm::int8>();
Error += run<3, glm::int8>();
Error += run<4, glm::int8>();
Error += run<1, glm::int16>();
Error += run<2, glm::int16>();
Error += run<3, glm::int16>();
Error += run<4, glm::int16>();
Error += run<1, glm::int32>();
Error += run<2, glm::int32>();
Error += run<3, glm::int32>();
Error += run<4, glm::int32>();
Error += run<1, glm::int64>();
Error += run<2, glm::int64>();
Error += run<3, glm::int64>();
Error += run<4, glm::int64>();
return Error;
}
}//namespace findNSB

View File

@@ -1,6 +1,7 @@
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/norm.hpp>
int test_lMaxNorm()
{
int Error(0);
@@ -14,6 +15,57 @@ int test_lMaxNorm()
float norm = glm::lMaxNorm(glm::vec3(2, 3, 1));
Error += glm::epsilonEqual(norm, 3.f, 0.00001f) ? 0 : 1;
}
return Error;
}
int test_lxNorm()
{
int Error(0);
{
unsigned int depth_1 = 1;
float normA = glm::lxNorm(glm::vec3(2, 3, 1), depth_1);
float normB = glm::l1Norm(glm::vec3(2, 3, 1));
Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1;
Error += glm::epsilonEqual(normA, 6.f, 0.00001f) ? 0 : 1;
}
{
unsigned int depth_1 = 1;
float normA = glm::lxNorm(glm::vec3(-1, -2, -3), depth_1);
float normB = glm::l1Norm(glm::vec3(-1, -2, -3));
Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1;
Error += glm::epsilonEqual(normA, 6.f, 0.00001f) ? 0 : 1;
}
{
unsigned int depth_2 = 2;
float normA = glm::lxNorm(glm::vec3(2, 3, 1), depth_2);
float normB = glm::l2Norm(glm::vec3(2, 3, 1));
Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1;
Error += glm::epsilonEqual(normA, 3.741657387f, 0.00001f) ? 0 : 1;
}
{
unsigned int depth_2 = 2;
float normA = glm::lxNorm(glm::vec3(-1, -2, -3), depth_2);
float normB = glm::l2Norm(glm::vec3(-1, -2, -3));
Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1;
Error += glm::epsilonEqual(normA, 3.741657387f, 0.00001f) ? 0 : 1;
}
{
unsigned int oddDepth = 3;
float norm = glm::lxNorm(glm::vec3(2, 3, 1), oddDepth);
Error += glm::epsilonEqual(norm, 3.301927249f, 0.00001f) ? 0 : 1;
}
{
unsigned int oddDepth = 3;
float norm = glm::lxNorm(glm::vec3(-1, -2, -3), oddDepth);
Error += glm::epsilonEqual(norm, 3.301927249f, 0.00001f) ? 0 : 1;
}
return Error;
}
@@ -23,6 +75,7 @@ int main()
int Error(0);
Error += test_lMaxNorm();
Error += test_lxNorm();
return Error;
}