Продолжение переименования
This commit is contained in:
parent
3b6efaafa9
commit
120e651517
19 changed files with 457 additions and 421 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
versor_fp32_t versor1, versor2, result;
|
versor_fp32_t versor1, versor2, result;
|
||||||
matrix3x3_fp32_t matrix;
|
//matrix3x3_fp32_t matrix;
|
||||||
vector3_fp32_t vector1, vector2;
|
vector3_fp32_t vector1, vector2;
|
||||||
} structure_fp32_t;
|
} structure_fp32_t;
|
||||||
|
|
||||||
|
|
@ -31,7 +31,7 @@ structure_fp32_t* make_structures(const unsigned int amount)
|
||||||
const float multiplier = 2.0f / RAND_MAX;
|
const float multiplier = 2.0f / RAND_MAX;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < amount; i++) {
|
for (unsigned int i = 0; i < amount; i++) {
|
||||||
versor_fp32_set_values(
|
versor_set_values_fp32(
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
|
|
@ -39,7 +39,7 @@ structure_fp32_t* make_structures(const unsigned int amount)
|
||||||
&list[i].versor1
|
&list[i].versor1
|
||||||
);
|
);
|
||||||
|
|
||||||
versor_fp32_set_values(
|
versor_set_values_fp32(
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
|
|
@ -49,9 +49,9 @@ structure_fp32_t* make_structures(const unsigned int amount)
|
||||||
|
|
||||||
versor_reset_fp32(&list[i].result);
|
versor_reset_fp32(&list[i].result);
|
||||||
|
|
||||||
matrix3x3_fp32_set_to_identity(&list[i].matrix);
|
//matrix3x3_set_to_identity_fp32(&list[i].matrix);
|
||||||
|
|
||||||
vector3_set_fp32(
|
vector3_set_values_fp32(
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
|
|
@ -86,9 +86,10 @@ void print_vector_fp64(const vector3_fp64_t* vector)
|
||||||
|
|
||||||
void item_work(structure_fp32_t* item)
|
void item_work(structure_fp32_t* item)
|
||||||
{
|
{
|
||||||
versor_fp32_combine(&item->versor1, &item->versor1, &item->result);
|
for (int j = 0; j < 1000; j++) {
|
||||||
versor_fp32_make_rotation_matrix(&item->result, &item->matrix);
|
versor_combine_fp32(&item->versor1, &item->versor2, &item->result);
|
||||||
matrix3x3_fp32_right_product(&item->matrix, &item->vector1, &item->vector2);
|
versor_turn_vector_fp32(&item->result, &item->vector1, &item->vector2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|
@ -121,13 +122,12 @@ int main()
|
||||||
#endif // _WIN64
|
#endif // _WIN64
|
||||||
|
|
||||||
for (unsigned int i = 0; i < amount; i++) {
|
for (unsigned int i = 0; i < amount; i++) {
|
||||||
for (int j = 0; j < 1000; j++) {
|
//for (int j = 0; j < 1000; j++) {
|
||||||
//item_work(list + i);
|
item_work(list + i);
|
||||||
versor_fp32_combine(&list[i].versor1, &list[i].versor2, &list[i].result);
|
//structure_fp32_t* item = list + i;
|
||||||
versor_fp32_make_rotation_matrix(&list[i].result, &list[i].matrix);
|
//versor_combine_fp32(&item->versor1, &item->versor2, &item->result);
|
||||||
matrix3x3_fp32_right_product(&list[i].matrix, &list[i].vector1, &list[i].vector2);
|
//versor_turn_vector_fp32(&item->result, &item->vector1, &item->vector2);
|
||||||
//versor_fp32_turn(&list[i].result, &list[i].vector1, &list[i].vector2);
|
//}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "vector2_fp32_test.h"
|
#include "fp32_vector2_test.h"
|
||||||
|
|
||||||
const int TEST_FP32_VECTOR2_AMOUNT_1 = 5;
|
const int TEST_FP32_VECTOR2_AMOUNT_1 = 5;
|
||||||
|
|
||||||
|
|
@ -31,7 +31,7 @@ int test_vector2_fp32_square_modulus()
|
||||||
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
|
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
|
||||||
square_modulus = vector2_get_square_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
|
square_modulus = vector2_get_square_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
|
||||||
|
|
||||||
if (!test_fp32_are_equal(square_modulus, FP32_VECTOR2_SQUARE_MODULUS_1[i], TEST_FP32_TWO_EPSYLON)) {
|
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_SQUARE_MODULUS_1[i], TEST_FP32_TWO_EPSYLON)) {
|
||||||
print_test_failed();
|
print_test_failed();
|
||||||
return TEST_RESULT_FAILED;
|
return TEST_RESULT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
@ -54,7 +54,7 @@ int test_vector2_fp32_modulus()
|
||||||
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
|
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
|
||||||
square_modulus = vector2_get_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
|
square_modulus = vector2_get_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
|
||||||
|
|
||||||
if (!test_fp32_are_equal(square_modulus, FP32_VECTOR2_MODULUS_1[i], TEST_FP32_EPSYLON)) {
|
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_MODULUS_1[i], TEST_FP32_EPSYLON)) {
|
||||||
print_test_failed();
|
print_test_failed();
|
||||||
return TEST_RESULT_FAILED;
|
return TEST_RESULT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
@ -74,17 +74,17 @@ const vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1_2_SUM[] = {
|
||||||
{ -122.0f, -19.6217f }
|
{ -122.0f, -19.6217f }
|
||||||
};
|
};
|
||||||
|
|
||||||
int test_vector2_fp32_add()
|
int test_vector2_add_fp32()
|
||||||
{
|
{
|
||||||
print_test_name("vector2_fp32_t add");
|
print_test_name("vector2_fp32_t add");
|
||||||
|
|
||||||
vector2_fp32_t vector;
|
vector2_fp32_t vector;
|
||||||
|
|
||||||
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
|
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
|
||||||