Удаление combite3 функций, изменение названий параметров функицй combine и exclude

This commit is contained in:
Andrey Pokidov 2026-04-03 15:10:57 +07:00
parent 54c762da14
commit 5425206401
10 changed files with 277 additions and 220 deletions

View file

@ -53,6 +53,10 @@
<Option compilerVar="CC" />
</Unit>
<Unit filename="printing_utils.h" />
<Unit filename="turn3_combination.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="turn3_combination.h" />
<Unit filename="vector3_pair_difference.c">
<Option compilerVar="CC" />
</Unit>

View file

Internal server error - Personal Git Server: Beyond coding. We Forge.

500

Internal server error

Forgejo version: 11.0.1+gitea-1.22.0

@ -1,128 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <basic-geometry.h>
#ifdef _WIN64
#include <windows.h>
#else
#include <time.h>
#endif // _WINDOWS_
#include "printing_utils.h"
#include "vector3_pair_difference.h"
#include "turn3_combination.h"
#include "affine3.h"
typedef struct {
BGC_FP32_Turn3 versor1, versor2, result;
} structure_fp32_t;
structure_fp32_t* allocate_structures(const unsigned int amount)
{
return calloc(amount, sizeof(structure_fp32_t));
}
structure_fp32_t* make_structures(const unsigned int amount)
{
structure_fp32_t* list = allocate_structures(amount);
if (list == 0) {
return 0;
}
const float multiplier = 2.0f / RAND_MAX;
for (unsigned int i = 0; i < amount; i++) {
bgc_fp32_turn3_set_values(
&list[i].versor1,
rand() * multiplier - 1.0f,
rand() * multiplier - 1.0f,
rand() * multiplier - 1.0f,
rand() * multiplier - 1.0f
);
bgc_fp32_turn3_set_values(
&list[i].versor2,
rand() * multiplier - 1.0f,
rand() * multiplier - 1.0f,
rand() * multiplier - 1.0f,
rand() * multiplier - 1.0f
);
bgc_fp32_turn3_reset(&list[i].result);
}
return list;
}
void list_work(const uint_fast32_t amount, structure_fp32_t* list)
{
for (uint_fast32_t j = 0; j < 1000; j++) {
for (uint_fast32_t i = 0; i < amount; i++) {
bgc_fp32_turn3_combine(&list[i].result, &list[i].versor1, &list[i].versor2);
}
}
}
/*
int main()
{
const unsigned int amount = 1000000;
structure_fp32_t* list = make_structures(amount);
#ifdef _WIN64
ULONGLONG start, end;
start = GetTickCount64();
srand((unsigned int)(start & 0xfffffff));
start = GetTickCount64();
#else
struct timespec start, end;
clock_gettime(0, &start);
srand((unsigned int)(start.tv_nsec & 0xfffffff));
clock_gettime(CLOCK_REALTIME, &start);
#endif // _WIN64
list_work(amount, list);
#ifdef _WIN64
end = GetTickCount64();
printf("Time: %lld\n", end - start);