Рефакторинг и оптимизация вычислений / Refactoring and optimization of computations
This commit is contained in:
parent
03e390c1d0
commit
2655e43cb4
15 changed files with 810 additions and 829 deletions
|
|
@ -52,7 +52,7 @@ BgFP32Versor * make_random_versors(const unsigned int amount)
|
||||||
|
|
||||||
void print_versor(const BgFP32Versor* versor)
|
void print_versor(const BgFP32Versor* versor)
|
||||||
{
|
{
|
||||||
printf("(%f, %f, %f, %f)\n", versor->s0, versor->x1, versor->x2, versor->x3);
|
printf("Versor (%f, %f, %f, %f); Delta = %e\n", versor->s0, versor->x1, versor->x2, versor->x3, bg_fp32_versor_get_modulus(versor) - 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_vector(const BgFP32Vector3* vector)
|
void print_vector(const BgFP32Vector3* vector)
|
||||||
|
|
@ -125,11 +125,11 @@ int main()
|
||||||
const unsigned int amount = 1000000;
|
const unsigned int amount = 1000000;
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
ULONGLONG now;
|
ULONGLONG now, start, end;
|
||||||
now = GetTickCount64();
|
now = GetTickCount64();
|
||||||
srand((unsigned int)(now & 0xfffffff));
|
srand((unsigned int)(now & 0xfffffff));
|
||||||
#else
|
#else
|
||||||
struct timespec now;
|
struct timespec now, start, end;
|
||||||
clock_gettime(0, &now);
|
clock_gettime(0, &now);
|
||||||
srand((unsigned int)(now.tv_nsec & 0xfffffff));
|
srand((unsigned int)(now.tv_nsec & 0xfffffff));
|
||||||
#endif // _WIN64
|
#endif // _WIN64
|
||||||
|
|
@ -159,10 +159,14 @@ int main()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||