Переименование s0 -> s, x1 -> x, x2 -> y, x3 -> z, что должно упростить читаемость кода. Также обновление документации

This commit is contained in:
Andrey Pokidov 2026-03-29 22:06:01 +07:00
parent d83ab7160d
commit b8d383da33
38 changed files with 2104 additions and 2070 deletions

View file

@ -210,64 +210,64 @@ inline void bgc_fp64_dual_vector3_multiply_by_conjugate_dual_number(BGC_FP64_Dua
inline void bgc_fp32_dual_vector3_multiply_by_matrix3x3(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const vector, const BGC_FP32_Matrix3x3* const matrix)
{
const float real_x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
const float real_x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
const float real_x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
const float real_x = vector->real_part.x * matrix->r1c1 + vector->real_part.y * matrix->r2c1 + vector->real_part.z * matrix->r3c1;
const float real_y = vector->real_part.x * matrix->r1c2 + vector->real_part.y * matrix->r2c2 + vector->real_part.z * matrix->r3c2;
const float real_z = vector->real_part.x * matrix->r1c3 + vector->real_part.y * matrix->r2c3 + vector->real_part.z * matrix->r3c3;
const float dual_x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
const float dual_x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
const float dual_x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
const float dual_x = vector->real_part.x * matrix->r1c1 + vector->real_part.y * matrix->r2c1 + vector->real_part.z * matrix->r3c1;
const float dual_y = vector->real_part.x * matrix->r1c2 + vector->real_part.y * matrix->r2c2 + vector->real_part.z * matrix->r3c2;
const float dual_z = vector->real_part.x * matrix->r1c3 + vector->real_part.y * matrix->r2c3 + vector->real_part.z * matrix->r3c3;
product->real_part.x1 = real_x1;
product->real_part.x2 = real_x2;
product->real_part.x3 = real_x3;
product->real_part.x = real_x;
product->real_part.y = real_y;
product->real_part.z = real_z;
product->real_part.x1 = real_x1;
product->real_part.x2 = real_x2;
product->real_part.x3 = real_x3;
product->real_part.x = real_x;
product->real_part.y = real_y;
product->real_part.z = real_z;
}
inline void bgc_fp64_dual_vector3_multiply_by_matrix3x3(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const vector, const BGC_FP64_Matrix3x3* const matrix)
{
const double real_x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
const double real_x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
const double real_x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
const double real_x = vector->real_part.x * matrix->r1c1 + vector->real_part.y * matrix->r2c1 + vector->real_part.z * matrix->r3c1;
const double real_y = vector->real_part.x * matrix->r1c2 + vector->real_part.y * matrix->r2c2 + vector->real_part.z * matrix->r3c2;
const double real_z = vector->real_part.x * matrix->r1c3 + vector->real_part.y * matrix->r2c3 + vector->real_part.z * matrix->r3c3;
const double dual_x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
const double dual_x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
const double dual_x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
const double dual_x = vector->real_part.x * matrix->r1c1 + vector->real_part.y * matrix->r2c1 + vector->real_part.z * matrix->r3c1;
const double dual_y = vector->real_part.x * matrix->r1c2 + vector->real_part.y * matrix->r2c2 + vector->real_part.z * matrix->r3c2;
const double dual_z = vector->real_part.x * matrix->r1c3 + vector->real_part.y * matrix->r2c3 + vector->real_part.z * matrix->r3c3;
product->real_part.x1 = real_x1;
product->real_part.x2 = real_x2;
product->real_part.x3 = real_x3;
product->real_part.x = real_x;
product->real_part.y = real_y;
product->real_part.z = real_z;
product->real_part.x1 = real_x1;
product->real_part.x2 = real_x2;
product->real_part.x3 = real_x3;
product->real_part.x = real_x;
product->real_part.y = real_y;
product->real_part.z = real_z;
}
// ===== Restrict Left Dual Vector Product ====== //
inline void _bgc_fp32_restrict_dual_vector3_multiply_by_matrix3x3(BGC_FP32_DualVector3* restrict const product, const BGC_FP32_DualVector3* const vector, const BGC_FP32_Matrix3x3* const matrix)
{
product->real_part.x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
product->real_part.x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
product->real_part.x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
product->real_part.x = vector->real_part.x * matrix->r1c1 + vector->real_part.y * matrix->r2c1 + vector->real_part.z * matrix->r3c1;
product->real_part.y = vector->real_part.x * matrix->r1c2 + vector->real_part.y * matrix->r2c2 + vector->real_part.z * matrix->r3c2;
product->real_part.z = vector->real_part.x * matrix->r1c3 + vector->real_part.y * matrix->r2c3 + vector->real_part.z * matrix->r3c3;
product->real_part.x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
product->real_part.x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
product->real_part.x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
product->real_part.x = vector->real_part.x * matrix->r1c1 + vector->real_part.y * matrix->r2c1 + vector->real_part.z * matrix->r3c1;
product->real_part.y = vector->real_part.x * matrix->r1c2 + vector->real_part.y * matrix->r2c2 + vector->real_part.z * matrix->r3c2;
product->real_part.z = vector->real_part.x * matrix->r1c3 + vector->real_part.y * matrix->r2c3 + vector->real_part.z * matrix->r3c3;
}
inline void _bgc_fp64_restrict_dual_vector3_multiply_by_matrix3x3(BGC_FP64_DualVector3* restrict const product, const BGC_FP64_DualVector3* const vector, const BGC_FP64_Matrix3x3* const matrix)
{
product->real_part.x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
product->real_part.x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
product->real_part.x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
product->real_part.x = vector->real_part.x * matrix->r1c1 + vector->real_part.y * matrix->r2c1 + vector->real_part.z * matrix->r3c1;
product->real_part.y = vector->real_part.x * matrix->r1c2 + vector->real_part.y * matrix->r2c2 + vector->real_part.z * matrix->r3c2;
product->real_part.z = vector->real_part.x * matrix->r1c3 + vector->real_part.y * matrix->r2c3 + vector->real_part.z * matrix->r3c3;
product->real_part.x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
product->real_part.x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
product->real_part.x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
product->real_part.x = vector->real_part.x * matrix->r1c1 + vector->real_part.y * matrix->r2c1 + vector->real_part.z * matrix->r3c1;
product->real_part.y = vector->real_part.x * matrix->r1c2 + vector->real_part.y * matrix->r2c2 + vector->real_part.z * matrix->r3c2;
product->real_part.z = vector->real_part.x * matrix->r1c3 + vector->real_part.y * matrix->r2c3 + vector->real_part.z * matrix->r3c3;
}
// =================== Divide =================== //