Переименование функций для универсализации названий, добавление функций умножения вектора на дуальное число, а также исправление реализации функции умножения кватерниона на дуальное число на более безопасную реализацию

This commit is contained in:
Andrey Pokidov 2026-03-27 20:54:11 +07:00
parent 405af2f3a7
commit 078512c3d5
10 changed files with 234 additions and 98 deletions

View file

@ -63,23 +63,23 @@ extern inline void bgc_fp64_complex_subtract(BGC_FP64_Complex* const difference,
extern inline void bgc_fp32_complex_subtract_scaled(BGC_FP32_Complex* const difference, const BGC_FP32_Complex* const basic_number, const BGC_FP32_Complex* const scalable_number, const float scale);
extern inline void bgc_fp64_complex_subtract_scaled(BGC_FP64_Complex* const difference, const BGC_FP64_Complex* const basic_number, const BGC_FP64_Complex* const scalable_number, const double scale);
extern inline void bgc_fp32_complex_multiply_by_real(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const float multiplier);
extern inline void bgc_fp64_complex_multiply_by_real(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const double multiplier);
extern inline void bgc_fp32_complex_multiply_by_real_number(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const float multiplier);
extern inline void bgc_fp64_complex_multiply_by_real_number(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const double multiplier);
extern inline void bgc_fp32_complex_multiply_by_complex(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const BGC_FP32_Complex* const multiplier);
extern inline void bgc_fp64_complex_multiply_by_complex(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const BGC_FP64_Complex* const multiplier);
extern inline void bgc_fp32_complex_multiply_by_complex_number(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const BGC_FP32_Complex* const multiplier);
extern inline void bgc_fp64_complex_multiply_by_complex_number(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const BGC_FP64_Complex* const multiplier);
extern inline void bgc_fp32_complex_multiply_by_conjugate(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const BGC_FP32_Complex* const multiplier_to_conjugate);
extern inline void bgc_fp64_complex_multiply_by_conjugate(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const BGC_FP64_Complex* const multiplier_to_conjugate);
extern inline void bgc_fp32_complex_multiply_by_conjugate_complex_number(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const BGC_FP32_Complex* const multiplier_to_conjugate);
extern inline void bgc_fp64_complex_multiply_by_conjugate_complex_number(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const BGC_FP64_Complex* const multiplier_to_conjugate);
extern inline int bgc_fp32_complex_divide_by_real(BGC_FP32_Complex* const quotient, const BGC_FP32_Complex* const dividend, const float divisor);
extern inline int bgc_fp64_complex_divide_by_real(BGC_FP64_Complex* const quotient, const BGC_FP64_Complex* const dividend, const double divisor);
extern inline int bgc_fp32_complex_divide_by_real_number(BGC_FP32_Complex* const quotient, const BGC_FP32_Complex* const dividend, const float divisor);
extern inline int bgc_fp64_complex_divide_by_real_number(BGC_FP64_Complex* const quotient, const BGC_FP64_Complex* const dividend, const double divisor);
extern inline int bgc_fp32_complex_divide_by_complex(BGC_FP32_Complex* const quotient, const BGC_FP32_Complex* const divident, const BGC_FP32_Complex* const divisor);
extern inline int bgc_fp64_complex_divide_by_complex(BGC_FP64_Complex* const quotient, const BGC_FP64_Complex* const divident, const BGC_FP64_Complex* const divisor);
extern inline int bgc_fp32_complex_divide_by_complex_number(BGC_FP32_Complex* const quotient, const BGC_FP32_Complex* const divident, const BGC_FP32_Complex* const divisor);
extern inline int bgc_fp64_complex_divide_by_complex_number(BGC_FP64_Complex* const quotient, const BGC_FP64_Complex* const divident, const BGC_FP64_Complex* const divisor);
extern inline int bgc_fp32_complex_divide_by_conjugate(BGC_FP32_Complex* const quotient, const BGC_FP32_Complex* const divident, const BGC_FP32_Complex* const divisor_to_conjugate);
extern inline int bgc_fp64_complex_divide_by_conjugate(BGC_FP64_Complex* const quotient, const BGC_FP64_Complex* const divident, const BGC_FP64_Complex* const divisor_to_conjugate);
extern inline int bgc_fp32_complex_divide_by_conjugate_complex_number(BGC_FP32_Complex* const quotient, const BGC_FP32_Complex* const divident, const BGC_FP32_Complex* const divisor_to_conjugate);
extern inline int bgc_fp64_complex_divide_by_conjugate_complex_number(BGC_FP64_Complex* const quotient, const BGC_FP64_Complex* const divident, const BGC_FP64_Complex* const divisor_to_conjugate);
extern inline void bgc_fp32_complex_get_mean2(BGC_FP32_Complex* const mean, const BGC_FP32_Complex* const number1, const BGC_FP32_Complex* const number2);
extern inline void bgc_fp64_complex_get_mean2(BGC_FP64_Complex* const mean, const BGC_FP64_Complex* const number1, const BGC_FP64_Complex* const number2);

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

@ -381,13 +381,13 @@ inline void bgc_fp64_complex_subtract_scaled(BGC_FP64_Complex* const difference,
// ========== Multiply By Real Number =========== //
inline void bgc_fp32_complex_multiply_by_real(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const float multiplier)
inline void bgc_fp32_complex_multiply_by_real_number(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const float multiplier)
{
product->real = multiplicand->real * multiplier;
product->imaginary = multiplicand->imaginary * multiplier;
}
inline void bgc_fp64_complex_multiply_by_real(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const double multiplier)
inline void bgc_fp64_complex_multiply_by_real_number(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const double multiplier)
{
product->real = multiplicand->real * multiplier;
product->imaginary = multiplicand->imaginary * multiplier;
@ -395,7 +395,7 @@ inline void bgc_fp64_complex_multiply_by_real(BGC_FP64_Complex* const product, c
// ========= Multiply By Complex Number ========= //
inline void bgc_fp32_complex_multiply_by_complex(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const BGC_FP32_Complex* const multiplier)
inline void bgc_fp32_complex_multiply_by_complex_number(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const BGC_FP32_Complex* const multiplier)
{
const float real = multiplicand->real * multiplier->real - multiplicand->imaginary * multiplier->imaginary;
const float imaginary = multiplicand->real * multiplier->imaginary + multiplicand->imaginary * multiplier->real;
@ -404,7 +404,7 @@ inline void bgc_fp32_complex_multiply_by_complex(BGC_FP32_Complex* const product
product->imaginary = imaginary;
}
inline void bgc_fp64_complex_multiply_by_complex(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const BGC_FP64_Complex* const multiplier)
inline void bgc_fp64_complex_multiply_by_complex_number(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const BGC_FP64_Complex* const multiplier)
{
const double real = multiplicand->real * multiplier->real - multiplicand->imaginary * multiplier->imaginary;
const double imaginary = multiplicand->real * multiplier->imaginary + multiplicand->imaginary * multiplier->real;
@ -415,7 +415,7 @@ inline void bgc_fp64_complex_multiply_by_complex(BGC_FP64_Complex* const product
// ======== Multiply By Conjugate Number ======== //
inline void bgc_fp32_complex_multiply_by_conjugate(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const BGC_FP32_Complex* const multiplier_to_conjugate)
inline void bgc_fp32_complex_multiply_by_conjugate_complex_number(BGC_FP32_Complex* const product, const BGC_FP32_Complex* const multiplicand, const BGC_FP32_Complex* const multiplier_to_conjugate)
{
const float real = multiplicand->real * multiplier_to_conjugate->real + multiplicand->imaginary * multiplier_to_conjugate->imaginary;
const float imaginary = multiplicand->imaginary * multiplier_to_conjugate->real - multiplicand->real * multiplier_to_conjugate->imaginary;
@ -424,7 +424,7 @@ inline void bgc_fp32_complex_multiply_by_conjugate(BGC_FP32_Complex* const produ
product->imaginary = imaginary;
}
inline void bgc_fp64_complex_multiply_by_conjugate(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const BGC_FP64_Complex* const multiplier_to_conjugate)
inline void bgc_fp64_complex_multiply_by_conjugate_complex_number(BGC_FP64_Complex* const product, const BGC_FP64_Complex* const multiplicand, const BGC_FP64_Complex* const multiplier_to_conjugate)
{
const double real = multiplicand->real * multiplier_to_conjugate->real + multiplicand->imaginary * multiplier_to_conjugate->imaginary;
const double imaginary = multiplicand->imaginary * multiplier_to_conjugate->real - multiplicand->real * multiplier_to_conjugate->imaginary;
@ -435,31 +435,31 @@ inline void bgc_fp64_complex_multiply_by_conjugate(BGC_FP64_Complex* const produ
// =========== Divide by Real Number ============ //
inline int bgc_fp32_complex_divide_by_real(BGC_FP32_Complex* const quotient, const BGC_FP32_Complex* const dividend, const float divisor)
inline int bgc_fp32_complex_divide_by_real_number(BGC_FP32_Complex* const quotient, const BGC_FP32_Complex* const dividend, const float divisor)
{
if (bgc_fp32_is_zero(divisor) || isnan(divisor)) {
return BGC_FAILURE;
}