Переименование s0 -> s, x1 -> x, x2 -> y, x3 -> z, что должно упростить читаемость кода. Также обновление документации
This commit is contained in:
parent
d83ab7160d
commit
b8d383da33
38 changed files with 2104 additions and 2070 deletions
|
|
@ -48,9 +48,9 @@ BGC_FP32_Affine3* _create_bgc_affine3_random_list(int affine_amount)
|
|||
get_random_value_fp32()
|
||||
);
|
||||
|
||||
position.shift.x1 = get_random_value_fp32();
|
||||
position.shift.x2 = get_random_value_fp32();
|
||||
position.shift.x3 = get_random_value_fp32();
|
||||
position.shift.x = get_random_value_fp32();
|
||||
position.shift.y = get_random_value_fp32();
|
||||
position.shift.z = get_random_value_fp32();
|
||||
|
||||
bgc_fp32_position3_get_affine(&affines[i], &position);
|
||||
}
|
||||
|
|
@ -72,9 +72,9 @@ BGC_FP32_Vector3* _create_bgc_vector3_random_list(int amount)
|
|||
}
|
||||
|
||||
for (int i = 0; i < amount; i++) {
|
||||
vectors[i].x1 = get_random_value_fp32();
|
||||
vectors[i].x2 = get_random_value_fp32();
|
||||
vectors[i].x3 = get_random_value_fp32();
|
||||
vectors[i].x = get_random_value_fp32();
|
||||
vectors[i].y = get_random_value_fp32();
|
||||
vectors[i].z = get_random_value_fp32();
|
||||
}
|
||||
|
||||
return vectors;
|
||||
|
|
@ -146,7 +146,7 @@ float test_bgc_affine3_performance(int affine_amount, int vector_per_affine)
|
|||
time = (float)(end.tv_sec - start.tv_sec) + (end.tv_nsec - start.tv_nsec) * 0.000000001f;
|
||||
#endif // _WIN64
|
||||
|
||||
printf("Result vector [0] = (%f, %f, %f)\n", result_vectors[0].x1, result_vectors[0].x2, result_vectors[0].x3);
|
||||
printf("Result vector [0] = (%f, %f, %f)\n", result_vectors[0].x, result_vectors[0].y, result_vectors[0].z);
|
||||
|
||||
free(result_vectors);
|
||||
free(source_vectors);
|
||||
|
|
|
|||
|
|
@ -53,22 +53,22 @@ structure_fp32_t* make_structures(const unsigned int amount)
|
|||
|
||||
void print_quaternion_fp32(const BGC_FP32_Quaternion* quaternion)
|
||||
{
|
||||
printf("Quaternion FP32(s0 = %0.12f, x1 = %0.12f, x2 = %0.12f, x3 = %0.12f)\n", quaternion->s0, quaternion->x1, quaternion->x2, quaternion->x3);
|
||||
printf("Quaternion FP32(s = %0.12f, x = %0.12f, y = %0.12f, z = %0.12f)\n", quaternion->s, quaternion->x, quaternion->y, quaternion->z);
|
||||
}
|
||||
|
||||
void print_quaternion_fp64(const BGC_FP64_Quaternion* quaternion)
|
||||
{
|
||||
printf("Quaternion FP64(s0 = %0.12f, x1 = %0.12f, x2 = %0.12f, x3 = %0.12f)\n", quaternion->s0, quaternion->x1, quaternion->x2, quaternion->x3);
|
||||
printf("Quaternion FP64(s = %0.12f, x = %0.12f, y = %0.12f, z = %0.12f)\n", quaternion->s, quaternion->x, quaternion->y, quaternion->z);
|
||||
}
|
||||
|
||||
void print_vector_fp32(const BGC_FP32_Vector3* vector)
|
||||
{
|
||||
printf("(%f, %f, %f) / %f\n", vector->x1, vector->x2, vector->x3, bgc_fp32_vector3_get_length(vector));
|
||||
printf("(%f, %f, %f) / %f\n", vector->x, vector->y, vector->z, bgc_fp32_vector3_get_length(vector));
|
||||
}
|
||||
|
||||
void print_vector_fp64(const BGC_FP64_Vector3* vector)
|
||||
{
|
||||
printf("(%lf, %lf, %lf) / %lf\n", vector->x1, vector->x2, vector->x3, bgc_fp64_vector3_get_length(vector));
|
||||
printf("(%lf, %lf, %lf) / %lf\n", vector->x, vector->y, vector->z, bgc_fp64_vector3_get_length(vector));
|
||||
}
|
||||
|
||||
void list_work(const uint_fast32_t amount, structure_fp32_t* list)
|
||||
|
|
|
|||
|
|
@ -214,48 +214,48 @@ inline void bgc_fp64_dual_quaternion_get_dual_conjugate(BGC_FP64_DualQuaternion*
|
|||
|
||||
inline void bgc_fp32_dual_quaternion_fully_conjugate(BGC_FP32_DualQuaternion* const quaternion)
|
||||
{
|
||||
quaternion->real_part.x1 = -quaternion->real_part.x1;
|
||||
quaternion->real_part.x2 = -quaternion->real_part.x2;
|
||||
quaternion->real_part.x3 = -quaternion->real_part.x3;
|
||||
quaternion->real_part.x = -quaternion->real_part.x;
|
||||
quaternion->real_part.y = -quaternion->real_part.y;
|
||||
quaternion->real_part.z = -quaternion->real_part.z;
|
||||
|
||||
quaternion->dual_part.s0 = -quaternion->dual_part.s0;
|
||||
quaternion->dual_part.s = -quaternion->dual_part.s;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_quaternion_fully_conjugate(BGC_FP64_DualQuaternion* const quaternion)
|
||||
{
|
||||
quaternion->real_part.x1 = -quaternion->real_part.x1;
|
||||
quaternion->real_part.x2 = -quaternion->real_part.x2;
|
||||
quaternion->real_part.x3 = -quaternion->real_part.x3;
|
||||
quaternion->real_part.x = -quaternion->real_part.x;
|
||||
quaternion->real_part.y = -quaternion->real_part.y;
|
||||
quaternion->real_part.z = -quaternion->real_part.z;
|
||||
|
||||
quaternion->dual_part.s0 = -quaternion->dual_part.s0;
|
||||
quaternion->dual_part.s = -quaternion->dual_part.s;
|
||||
}
|
||||
|
||||
// ============ Get Fully Conjugate ============= //
|
||||
|
||||
inline void bgc_fp32_dual_quaternion_get_fully_conjugate(BGC_FP32_DualQuaternion* const conjugate, const BGC_FP32_DualQuaternion* const quaternion)
|
||||
{
|
||||
conjugate->real_part.s0 = quaternion->real_part.s0;
|
||||
conjugate->real_part.x1 = -quaternion->real_part.x1;
|
||||
conjugate->real_part.x2 = -quaternion->real_part.x2;
|
||||
conjugate->real_part.x3 = -quaternion->real_part.x3;
|
||||
conjugate->real_part.s = quaternion->real_part.s;
|
||||
conjugate->real_part.x = -quaternion->real_part.x;
|
||||
conjugate->real_part.y = -quaternion->real_part.y;
|
||||
conjugate->real_part.z = -quaternion->real_part.z;
|
||||
|
||||
conjugate->dual_part.s0 = -quaternion->dual_part.s0;
|
||||
conjugate->dual_part.x1 = quaternion->dual_part.x1;
|
||||
conjugate->dual_part.x2 = quaternion->dual_part.x2;
|
||||
conjugate->dual_part.x3 = quaternion->dual_part.x3;
|
||||
conjugate->dual_part.s = -quaternion->dual_part.s;
|
||||
conjugate->dual_part.x = quaternion->dual_part.x;
|
||||
conjugate->dual_part.y = quaternion->dual_part.y;
|
||||
conjugate->dual_part.z = quaternion->dual_part.z;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_quaternion_get_fully_conjugate(BGC_FP64_DualQuaternion* const conjugate, const BGC_FP64_DualQuaternion* const quaternion)
|
||||
{
|
||||
conjugate->real_part.s0 = quaternion->real_part.s0;
|
||||
conjugate->real_part.x1 = -quaternion->real_part.x1;
|
||||
conjugate->real_part.x2 = -quaternion->real_part.x2;
|
||||
conjugate->real_part.x3 = -quaternion->real_part.x3;
|
||||
conjugate->real_part.s = quaternion->real_part.s;
|
||||
conjugate->real_part.x = -quaternion->real_part.x;
|
||||
conjugate->real_part.y = -quaternion->real_part.y;
|
||||
conjugate->real_part.z = -quaternion->real_part.z;
|
||||
|
||||
conjugate->dual_part.s0 = -quaternion->dual_part.s0;
|
||||
conjugate->dual_part.x1 = quaternion->dual_part.x1;
|
||||
conjugate->dual_part.x2 = quaternion->dual_part.x2;
|
||||
conjugate->dual_part.x3 = quaternion->dual_part.x3;
|
||||
conjugate->dual_part.s = -quaternion->dual_part.s;
|
||||
conjugate->dual_part.x = quaternion->dual_part.x;
|
||||
conjugate->dual_part.y = quaternion->dual_part.y;
|
||||
conjugate->dual_part.z = quaternion->dual_part.z;
|
||||
}
|
||||
|
||||
// ================= Normalize ================== //
|
||||
|
|
|
|||
|
|
@ -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 =================== //
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ extern inline int bgc_fp64_matrix2x2_is_rotation(const BGC_FP64_Matrix2x2* const
|
|||
extern inline void bgc_fp32_matrix2x2_copy(BGC_FP32_Matrix2x2* const destination, const BGC_FP32_Matrix2x2* const source);
|
||||
extern inline void bgc_fp64_matrix2x2_copy(BGC_FP64_Matrix2x2* const destination, const BGC_FP64_Matrix2x2* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* const matrix1, BGC_FP32_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* const matrix1, BGC_FP64_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* const matrix, BGC_FP32_Matrix2x2* const matriy);
|
||||
extern inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* const matrix, BGC_FP64_Matrix2x2* const matriy);
|
||||
|
||||
extern inline void bgc_fp64_matrix2x2_convert_to_fp32(BGC_FP32_Matrix2x2* const destination, const BGC_FP64_Matrix2x2* const source);
|
||||
extern inline void bgc_fp32_matrix2x2_convert_to_fp64(BGC_FP64_Matrix2x2* const destination, const BGC_FP32_Matrix2x2* const source);
|
||||
|
|
@ -57,8 +57,8 @@ extern inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* const column,
|
|||
extern inline void bgc_fp32_matrix2x2_set_column(BGC_FP32_Matrix2x2* const matrix, const int column_number, const BGC_FP32_Vector2* const column);
|
||||
extern inline void bgc_fp64_matrix2x2_set_column(BGC_FP64_Matrix2x2* const matrix, const int column_number, const BGC_FP64_Vector2* const column);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Matrix2x2* const matriy);
|
||||
extern inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Matrix2x2* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_add_scaled(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const basic_matrix, const BGC_FP32_Matrix2x2* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x2_add_scaled(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const basic_matrix, const BGC_FP64_Matrix2x2* const scalable_matrix, const double scale);
|
||||
|
|
@ -78,11 +78,11 @@ extern inline void bgc_fp64_matrix2x2_multiply_by_vector2(BGC_FP64_Vector2* cons
|
|||
extern inline void _bgc_fp32_restrict_matrix2x2_multiply_by_vector2(BGC_FP32_Vector2* restrict const product, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Vector2* const vector);
|
||||
extern inline void _bgc_fp64_restrict_matrix2x2_multiply_by_vector2(BGC_FP64_Vector2* restrict const product, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Vector2* const vector);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Matrix2x2* const matriy);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Matrix2x2* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Matrix3x2* const matriy);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Matrix3x2* const matriy);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x2_divide_by_real_number(BGC_FP32_Matrix2x2* const quotient, const BGC_FP32_Matrix2x2* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix2x2_divide_by_real_number(BGC_FP64_Matrix2x2* const quotient, const BGC_FP64_Matrix2x2* const dividend, const double divisor);
|
||||
|
|
|
|||
|
|
@ -175,46 +175,46 @@ inline void bgc_fp64_matrix2x2_copy(BGC_FP64_Matrix2x2* const destination, const
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* const matrix1, BGC_FP32_Matrix2x2* const matrix2)
|
||||
inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* const matrix, BGC_FP32_Matrix2x2* const matriy)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
const float r1c1 = matriy->r1c1;
|
||||
const float r1c2 = matriy->r1c2;
|
||||
|
||||
const float r2c1 = matrix2->r2c1;
|
||||
const float r2c2 = matrix2->r2c2;
|
||||
const float r2c1 = matriy->r2c1;
|
||||
const float r2c2 = matriy->r2c2;
|
||||
|
||||
matrix2->r1c1 = matrix1->r1c1;
|
||||
matrix2->r1c2 = matrix1->r1c2;
|
||||
matriy->r1c1 = matrix->r1c1;
|
||||
matriy->r1c2 = matrix->r1c2;
|
||||
|
||||
matrix2->r2c1 = matrix1->r2c1;
|
||||
matrix2->r2c2 = matrix1->r2c2;
|
||||
matriy->r2c1 = matrix->r2c1;
|
||||
matriy->r2c2 = matrix->r2c2;
|
||||
|
||||
matrix1->r1c1 = r1c1;
|
||||
matrix1->r1c2 = r1c2;
|
||||
matrix->r1c1 = r1c1;
|
||||
matrix->r1c2 = r1c2;
|
||||
|
||||
matrix1->r2c1 = r2c1;
|
||||
matrix1->r2c2 = r2c2;
|
||||
matrix->r2c1 = r2c1;
|
||||
matrix->r2c2 = r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* const matrix1, BGC_FP64_Matrix2x2* const matrix2)
|
||||
inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* const matrix, BGC_FP64_Matrix2x2* const matriy)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
const double r1c1 = matriy->r1c1;
|
||||
const double r1c2 = matriy->r1c2;
|
||||
|
||||
const double r2c1 = matrix2->r2c1;
|
||||
const double r2c2 = matrix2->r2c2;
|
||||
const double r2c1 = matriy->r2c1;
|
||||
const double r2c2 = matriy->r2c2;
|
||||
|
||||
matrix2->r1c1 = matrix1->r1c1;
|
||||
matrix2->r1c2 = matrix1->r1c2;
|
||||
matriy->r1c1 = matrix->r1c1;
|
||||
matriy->r1c2 = matrix->r1c2;
|
||||
|
||||
matrix2->r2c1 = matrix1->r2c1;
|
||||
matrix2->r2c2 = matrix1->r2c2;
|
||||
matriy->r2c1 = matrix->r2c1;
|
||||
matriy->r2c2 = matrix->r2c2;
|
||||
|
||||
matrix1->r1c1 = r1c1;
|
||||
matrix1->r1c2 = r1c2;
|
||||
matrix->r1c1 = r1c1;
|
||||
matrix->r1c2 = r1c2;
|
||||
|
||||
matrix1->r2c1 = r2c1;
|
||||
matrix1->r2c2 = r2c2;
|
||||
matrix->r2c1 = r2c1;
|
||||
matrix->r2c2 = r2c2;
|
||||
}
|
||||
|
||||
// ================== Convert =================== //
|
||||
|
|
@ -346,37 +346,37 @@ inline void bgc_fp64_matrix2x2_get_transposed(BGC_FP64_Matrix2x2* const transpos
|
|||
inline void bgc_fp32_matrix2x2_get_row(BGC_FP32_Vector2* const row, const BGC_FP32_Matrix2x2* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
row->x = matrix->r1c1;
|
||||
row->y = matrix->r1c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2) {
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
row->x = matrix->r2c1;
|
||||
row->y = matrix->r2c2;
|
||||
return;
|
||||
}
|
||||
|
||||
row->x1 = 0.0f;
|
||||
row->x2 = 0.0f;
|
||||
row->x = 0.0f;
|
||||
row->y = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_row(BGC_FP64_Vector2* const row, const BGC_FP64_Matrix2x2* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
row->x = matrix->r1c1;
|
||||
row->y = matrix->r1c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2) {
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
row->x = matrix->r2c1;
|
||||
row->y = matrix->r2c2;
|
||||
return;
|
||||
}
|
||||
|
||||
row->x1 = 0.0;
|
||||
row->x2 = 0.0;
|
||||
row->x = 0.0;
|
||||
row->y = 0.0;
|
||||
}
|
||||
|
||||
// ================== Set Row =================== //
|
||||
|
|
@ -384,28 +384,28 @@ inline void bgc_fp64_matrix2x2_get_row(BGC_FP64_Vector2* const row, const BGC_FP
|
|||
inline void bgc_fp32_matrix2x2_set_row(BGC_FP32_Matrix2x2* const matrix, const int row_number, const BGC_FP32_Vector2* const row)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
matrix->r1c1 = row->x;
|
||||
matrix->r1c2 = row->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2) {
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
matrix->r2c1 = row->x;
|
||||
matrix->r2c2 = row->y;
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_set_row(BGC_FP64_Matrix2x2* const matrix, const int row_number, const BGC_FP64_Vector2* const row)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
matrix->r1c1 = row->x;
|
||||
matrix->r1c2 = row->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2) {
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
matrix->r2c1 = row->x;
|
||||
matrix->r2c2 = row->y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -414,37 +414,37 @@ inline void bgc_fp64_matrix2x2_set_row(BGC_FP64_Matrix2x2* const matrix, const i
|
|||
inline void bgc_fp32_matrix2x2_get_column(BGC_FP32_Vector2* const column, const BGC_FP32_Matrix2x2* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
column->x = matrix->r1c1;
|
||||
column->y = matrix->r2c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2) {
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
column->x = matrix->r1c2;
|
||||
column->y = matrix->r2c2;
|
||||
return;
|
||||
}
|
||||
|
||||
column->x1 = 0.0f;
|
||||
column->x2 = 0.0f;
|
||||
column->x = 0.0f;
|
||||
column->y = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* const column, const BGC_FP64_Matrix2x2* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
column->x = matrix->r1c1;
|
||||
column->y = matrix->r2c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2) {
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
column->x = matrix->r1c2;
|
||||
column->y = matrix->r2c2;
|
||||
return;
|
||||
}
|
||||
|
||||
column->x1 = 0.0;
|
||||
column->x2 = 0.0;
|
||||
column->x = 0.0;
|
||||
column->y = 0.0;
|
||||
}
|
||||
|
||||
// ================= Set Column ================= //
|
||||
|
|
@ -452,49 +452,49 @@ inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* const column, const
|
|||
inline void bgc_fp32_matrix2x2_set_column(BGC_FP32_Matrix2x2* const matrix, const int column_number, const BGC_FP32_Vector2* const column)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
matrix->r1c1 = column->x;
|
||||
matrix->r2c1 = column->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2) {
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
matrix->r1c2 = column->x;
|
||||
matrix->r2c2 = column->y;
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_set_column(BGC_FP64_Matrix2x2* const matrix, const int column_number, const BGC_FP64_Vector2* const column)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
matrix->r1c1 = column->x;
|
||||
matrix->r2c1 = column->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2) {
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
matrix->r1c2 = column->x;
|
||||
matrix->r2c2 = column->y;
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix2x2* const matrix2)
|
||||
inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Matrix2x2* const matriy)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
sum->r1c1 = matrix->r1c1 + matriy->r1c1;
|
||||
sum->r1c2 = matrix->r1c2 + matriy->r1c2;
|
||||
|
||||
sum->r2c1 = matrix1->r2c1 + matrix2->r2c1;
|
||||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
sum->r2c1 = matrix->r2c1 + matriy->r2c1;
|
||||
sum->r2c2 = matrix->r2c2 + matriy->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix2x2* const matrix2)
|
||||
inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Matrix2x2* const matriy)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
sum->r1c1 = matrix->r1c1 + matriy->r1c1;
|
||||
sum->r1c2 = matrix->r1c2 + matriy->r1c2;
|
||||
|
||||
sum->r2c1 = matrix1->r2c1 + matrix2->r2c1;
|
||||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
sum->r2c1 = matrix->r2c1 + matriy->r2c1;
|
||||
sum->r2c2 = matrix->r2c2 + matriy->r2c2;
|
||||
}
|
||||
|
||||
// ================= Add Scaled ================= //
|
||||
|
|
@ -581,45 +581,45 @@ inline void bgc_fp64_matrix2x2_multiply_by_real_number(BGC_FP64_Matrix2x2* const
|
|||
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_vector2(BGC_FP32_Vector2* const product, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Vector2* const vector)
|
||||
{
|
||||
const float x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
const float x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
const float x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y;
|
||||
const float y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y;
|
||||
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x = x;
|
||||
product->y = y;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_vector2(BGC_FP64_Vector2* const product, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Vector2* const vector)
|
||||
{
|
||||
const double x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
const double x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
const double x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y;
|
||||
const double y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y;
|
||||
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x = x;
|
||||
product->y = y;
|
||||
}
|
||||
|
||||
// ======= Restrict Right Vector Product ======== //
|
||||
|
||||
inline void _bgc_fp32_restrict_matrix2x2_multiply_by_vector2(BGC_FP32_Vector2* restrict const product, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Vector2* const vector)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
product->x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y;
|
||||
product->y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y;
|
||||
}
|
||||
|
||||
inline void _bgc_fp64_restrict_matrix2x2_multiply_by_vector2(BGC_FP64_Vector2* restrict const product, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Vector2* const vector)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
product->x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y;
|
||||
product->y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y;
|
||||
}
|
||||
|
||||
// ========== Matrix Product 2x2 at 2x2 ========= //
|
||||
// ========== Matrix Product 2y at 2y ========= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix2x2* const matrix2)
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Matrix2x2* const matriy)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
const float r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1;
|
||||
const float r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2;
|
||||
|
||||
const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1;
|
||||
const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2;
|
||||
const float r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1;
|
||||
const float r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2;
|
||||
|
||||
product->r1c1 = r1c1;
|
||||
product->r1c2 = r1c2;
|
||||
|
|
@ -628,13 +628,13 @@ inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* const p
|
|||
product->r2c2 = r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix2x2* const matrix2)
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Matrix2x2* const matriy)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
const double r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1;
|
||||
const double r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2;
|
||||
|
||||
const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1;
|
||||
const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2;
|
||||
const double r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1;
|
||||
const double r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2;
|
||||
|
||||
product->r1c1 = r1c1;
|
||||
product->r1c2 = r1c2;
|
||||
|
|
@ -643,17 +643,17 @@ inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* const p
|
|||
product->r2c2 = r2c2;
|
||||
}
|
||||
|
||||
// ========== Matrix Product 2x2 at 3x2 ========= //
|
||||
// ========== Matrix Product 2y at 3y ========= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix3x2* const matrix2)
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Matrix3x2* const matriy)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
const float r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3;
|
||||
const float r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1;
|
||||
const float r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2;
|
||||
const float r1c3 = matrix->r1c1 * matriy->r1c3 + matrix->r1c2 * matriy->r2c3;
|
||||
|
||||
const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1;
|
||||
const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2;
|
||||
const float r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3;
|
||||
const float r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1;
|
||||
const float r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2;
|
||||
const float r2c3 = matrix->r2c1 * matriy->r1c3 + matrix->r2c2 * matriy->r2c3;
|
||||
|
||||
product->r1c1 = r1c1;
|
||||
product->r1c2 = r1c2;
|
||||
|
|
@ -664,15 +664,15 @@ inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* const p
|
|||
product->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix3x2* const matrix2)
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Matrix3x2* const matriy)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
const double r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3;
|
||||
const double r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1;
|
||||
const double r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2;
|
||||
const double r1c3 = matrix->r1c1 * matriy->r1c3 + matrix->r1c2 * matriy->r2c3;
|
||||
|
||||
const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1;
|
||||
const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2;
|
||||
const double r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3;
|
||||
const double r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1;
|
||||
const double r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2;
|
||||
const double r2c3 = matrix->r2c1 * matriy->r1c3 + matrix->r2c2 * matriy->r2c3;
|
||||
|
||||
product->r1c1 = r1c1;
|
||||
product->r1c2 = r1c2;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ extern inline void bgc_fp64_matrix2x3_reset(BGC_FP64_Matrix2x3* const matrix);
|
|||
extern inline void bgc_fp32_matrix2x3_copy(BGC_FP32_Matrix2x3* const destination, const BGC_FP32_Matrix2x3* const source);
|
||||
extern inline void bgc_fp64_matrix2x3_copy(BGC_FP64_Matrix2x3* const destination, const BGC_FP64_Matrix2x3* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* const matrix1, BGC_FP32_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* const matrix1, BGC_FP64_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* const matrix, BGC_FP32_Matrix2x3* const matriy);
|
||||
extern inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* const matrix, BGC_FP64_Matrix2x3* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_convert_to_fp64(BGC_FP64_Matrix2x3* const destination, const BGC_FP32_Matrix2x3* const source);
|
||||
extern inline void bgc_fp64_matrix2x3_convert_to_fp32(BGC_FP32_Matrix2x3* const destination, const BGC_FP64_Matrix2x3* const source);
|
||||
|
|
@ -27,8 +27,8 @@ extern inline void bgc_fp64_matrix2x3_get_column(BGC_FP64_Vector3* const column,
|
|||
extern inline void bgc_fp32_matrix2x3_set_column(BGC_FP32_Matrix2x3* const matrix, const int number, const BGC_FP32_Vector3* const column);
|
||||
extern inline void bgc_fp64_matrix2x3_set_column(BGC_FP64_Matrix2x3* const matrix, const int number, const BGC_FP64_Vector3* const column);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Matrix2x3* const matriy);
|
||||
extern inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Matrix2x3* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_add_scaled(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const basic_matrix, const BGC_FP32_Matrix2x3* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x3_add_scaled(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const basic_matrix, const BGC_FP64_Matrix2x3* const scalable_matrix, const double scale);
|
||||
|
|
@ -45,11 +45,11 @@ extern inline void bgc_fp64_matrix2x3_multiply_by_real_number(BGC_FP64_Matrix2x3
|
|||
extern inline void bgc_fp32_matrix2x3_multiply_by_vector2(BGC_FP32_Vector3* const product, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Vector2* const vector);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_vector2(BGC_FP64_Vector3* const product, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Vector2* const vector);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Matrix2x2* const matriy);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Matrix2x2* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_matrix3x2(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_matrix3x2(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Matrix3x2* const matriy);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Matrix3x2* const matriy);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x3_divide_by_real_number(BGC_FP32_Matrix2x3* const quotient, const BGC_FP32_Matrix2x3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix2x3_divide_by_real_number(BGC_FP64_Matrix2x3* const quotient, const BGC_FP64_Matrix2x3* const dividend, const double divisor);
|
||||
|
|
|
|||
|
|
@ -60,64 +60,64 @@ inline void bgc_fp64_matrix2x3_copy(BGC_FP64_Matrix2x3* const destination, const
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* const matrix1, BGC_FP32_Matrix2x3* const matrix2)
|
||||
inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* const matrix, BGC_FP32_Matrix2x3* const matriy)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
const float r1c1 = matriy->r1c1;
|
||||
const float r1c2 = matriy->r1c2;
|
||||
|
||||
const float r2c1 = matrix2->r2c1;
|
||||
const float r2c2 = matrix2->r2c2;
|
||||
const float r2c1 = matriy->r2c1;
|
||||
const float r2c2 = matriy->r2c2;
|
||||
|
||||
const float r3c1 = matrix2->r3c1;
|
||||
const float r3c2 = matrix2->r3c2;
|
||||
const float r3c1 = matriy->r3c1;
|
||||
const float r3c2 = matriy->r3c2;
|
||||
|
||||
matrix2->r1c1 = matrix1->r1c1;
|
||||
matrix2->r1c2 = matrix1->r1c2;
|
||||
matriy->r1c1 = matrix->r1c1;
|
||||
matriy->r1c2 = matrix->r1c2;
|
||||
|
||||
matrix2->r2c1 = matrix1->r2c1;
|
||||
matrix2->r2c2 = matrix1->r2c2;
|
||||
matriy->r2c1 = matrix->r2c1;
|
||||
matriy->r2c2 = matrix->r2c2;
|
||||
|
||||
matrix2->r3c1 = matrix1->r3c1;
|
||||
matrix2->r3c2 = matrix1->r3c2;
|
||||
matriy->r3c1 = matrix->r3c1;
|
||||
matriy->r3c2 = matrix->r3c2;
|
||||
|
||||
matrix1->r1c1 = r1c1;
|
||||
matrix1->r1c2 = r1c2;
|
||||
matrix->r1c1 = r1c1;
|
||||
matrix->r1c2 = r1c2;
|
||||
|
||||
matrix1->r2c1 = r2c1;
|
||||
matrix1->r2c2 = r2c2;
|
||||
matrix->r2c1 = r2c1;
|
||||
matrix->r2c2 = r2c2;
|
||||
|
||||
matrix1->r3c1 = r3c1;
|
||||
matrix1->r3c2 = r3c2;
|
||||
matrix->r3c1 = r3c1;
|
||||
matrix->r3c2 = r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* const matrix1, BGC_FP64_Matrix2x3* const matrix2)
|
||||
inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* const matrix, BGC_FP64_Matrix2x3* const matriy)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
const double r1c1 = matriy->r1c1;
|
||||
const double r1c2 = matriy->r1c2;
|
||||
|
||||
const double r2c1 = matrix2->r2c1;
|
||||
const double r2c2 = matrix2->r2c2;
|
||||
const double r2c1 = matriy->r2c1;
|
||||
const double r2c2 = matriy->r2c2;
|
||||
|
||||
const double r3c1 = matrix2->r3c1;
|
||||
const double r3c2 = matrix2->r3c2;
|
||||
const double r3c1 = matriy->r3c1;
|
||||
const double r3c2 = matriy->r3c2;
|
||||
|
||||
matrix2->r1c1 = matrix1->r1c1;
|
||||
matrix2->r1c2 = matrix1->r1c2;
|
||||
matriy->r1c1 = matrix->r1c1;
|
||||
matriy->r1c2 = matrix->r1c2;
|
||||
|
||||
matrix2->r2c1 = matrix1->r2c1;
|
||||
matrix2->r2c2 = matrix1->r2c2;
|
||||
matriy->r2c1 = matrix->r2c1;
|
||||
matriy->r2c2 = matrix->r2c2;
|
||||
|
||||
matrix2->r3c1 = matrix1->r3c1;
|
||||
matrix2->r3c2 = matrix1->r3c2;
|
||||
matriy->r3c1 = matrix->r3c1;
|
||||
matriy->r3c2 = matrix->r3c2;
|
||||
|
||||
matrix1->r1c1 = r1c1;
|
||||
matrix1->r1c2 = r1c2;
|
||||
matrix->r1c1 = r1c1;
|
||||
matrix->r1c2 = r1c2;
|
||||
|
||||
matrix1->r2c1 = r2c1;
|
||||
matrix1->r2c2 = r2c2;
|
||||
matrix->r2c1 = r2c1;
|
||||
matrix->r2c2 = r2c2;
|
||||
|
||||
matrix1->r3c1 = r3c1;
|
||||
matrix1->r3c2 = r3c2;
|
||||
matrix->r3c1 = r3c1;
|
||||
matrix->r3c2 = r3c2;
|
||||
}
|
||||
|
||||
// ================== Convert =================== //
|
||||
|
|
@ -177,49 +177,49 @@ inline void bgc_fp64_matrix2x3_get_transposed(BGC_FP64_Matrix2x3* const transpos
|
|||
inline void bgc_fp32_matrix2x3_get_row(BGC_FP32_Vector2* const row, const BGC_FP32_Matrix2x3* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
row->x = matrix->r1c1;
|
||||
row->y = matrix->r1c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2) {
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
row->x = matrix->r2c1;
|
||||
row->y = matrix->r2c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 3) {
|
||||
row->x1 = matrix->r3c1;
|
||||
row->x2 = matrix->r3c2;
|
||||
row->x = matrix->r3c1;
|
||||
row->y = matrix->r3c2;
|
||||
return;
|
||||
}
|
||||
|
||||
row->x1 = 0.0f;
|
||||
row->x2 = 0.0f;
|
||||
row->x = 0.0f;
|
||||
row->y = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_get_row(BGC_FP64_Vector2* const row, const BGC_FP64_Matrix2x3* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
row->x = matrix->r1c1;
|
||||
row->y = matrix->r1c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2) {
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
row->x = matrix->r2c1;
|
||||
row->y = matrix->r2c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 3) {
|
||||
row->x1 = matrix->r3c1;
|
||||
row->x2 = matrix->r3c2;
|
||||
row->x = matrix->r3c1;
|
||||
row->y = matrix->r3c2;
|
||||
return;
|
||||
}
|
||||
|
||||
row->x1 = 0.0f;
|
||||
row->x2 = 0.0f;
|
||||
row->x = 0.0f;
|
||||
row->y = 0.0f;
|
||||
}
|
||||
|
||||
// ================== Set Row =================== //
|
||||
|
|
@ -227,40 +227,40 @@ inline void bgc_fp64_matrix2x3_get_row(BGC_FP64_Vector2* const row, const BGC_FP
|
|||
inline void bgc_fp32_matrix2x3_set_row(BGC_FP32_Matrix2x3* const matrix, const int row_number, const BGC_FP32_Vector2* const row)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
matrix->r1c1 = row->x;
|
||||
matrix->r1c2 = row->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2) {
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
matrix->r2c1 = row->x;
|
||||
matrix->r2c2 = row->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 3) {
|
||||
matrix->r3c1 = row->x1;
|
||||
matrix->r3c2 = row->x2;
|
||||
matrix->r3c1 = row->x;
|
||||
matrix->r3c2 = row->y;
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_set_row(BGC_FP64_Matrix2x3* const matrix, const int row_number, const BGC_FP64_Vector2* const row)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
matrix->r1c1 = row->x;
|
||||
matrix->r1c2 = row->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2) {
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
matrix->r2c1 = row->x;
|
||||
matrix->r2c2 = row->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 3) {
|
||||
matrix->r3c1 = row->x1;
|
||||
matrix->r3c2 = row->x2;
|
||||
matrix->r3c1 = row->x;
|
||||
matrix->r3c2 = row->y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -269,32 +269,32 @@ inline void bgc_fp64_matrix2x3_set_row(BGC_FP64_Matrix2x3* const matrix, const i
|
|||
inline void bgc_fp32_matrix2x3_get_column(BGC_FP32_Vector3* const column, const BGC_FP32_Matrix2x3* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
column->x3 = matrix->r3c1;
|
||||
column->x = matrix->r1c1;
|
||||
column->y = matrix->r2c1;
|
||||
column->z = matrix->r3c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2) {
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
column->x3 = matrix->r3c2;
|
||||
column->x = matrix->r1c2;
|
||||
column->y = matrix->r2c2;
|
||||
column->z = matrix->r3c2;
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_get_column(BGC_FP64_Vector3* const column, const BGC_FP64_Matrix2x3* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
column->x3 = matrix->r3c1;
|
||||
column->x = matrix->r1c1;
|
||||
column->y = matrix->r2c1;
|
||||
column->z = matrix->r3c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2) {
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
column->x3 = matrix->r3c2;
|
||||
column->x = matrix->r1c2;
|
||||
column->y = matrix->r2c2;
|
||||
column->z = matrix->r3c2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -303,59 +303,59 @@ inline void bgc_fp64_matrix2x3_get_column(BGC_FP64_Vector3* const column, const
|
|||
inline void bgc_fp32_matrix2x3_set_column(BGC_FP32_Matrix2x3* const matrix, const int column_number, const BGC_FP32_Vector3* const column)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
matrix->r3c1 = column->x3;
|
||||
matrix->r1c1 = column->x;
|
||||
matrix->r2c1 = column->y;
|
||||
matrix->r3c1 = column->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2) {
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
matrix->r3c2 = column->x3;
|
||||
matrix->r1c2 = column->x;
|
||||
matrix->r2c2 = column->y;
|
||||
matrix->r3c2 = column->z;
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_set_column(BGC_FP64_Matrix2x3* const matrix, const int column_number, const BGC_FP64_Vector3* const column)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
matrix->r3c1 = column->x3;
|
||||
matrix->r1c1 = column->x;
|
||||
matrix->r2c1 = column->y;
|
||||
matrix->r3c1 = column->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2) {
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
matrix->r3c2 = column->x3;
|
||||
matrix->r1c2 = column->x;
|
||||
matrix->r2c2 = column->y;
|
||||
matrix->r3c2 = column->z;
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix2x3* const matrix2)
|
||||
inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Matrix2x3* const matriy)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
sum->r1c1 = matrix->r1c1 + matriy->r1c1;
|
||||
sum->r1c2 = matrix->r1c2 + matriy->r1c2;
|
||||
|
||||
sum->r2c1 = matrix1->r2c1 + matrix2->r2c1;
|
||||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
sum->r2c1 = matrix->r2c1 + matriy->r2c1;
|
||||
sum->r2c2 = matrix->r2c2 + matriy->r2c2;
|
||||
|
||||
sum->r3c1 = matrix1->r3c1 + matrix2->r3c1;
|
||||
sum->r3c2 = matrix1->r3c2 + matrix2->r3c2;
|
||||
sum->r3c1 = matrix->r3c1 + matriy->r3c1;
|
||||
sum->r3c2 = matrix->r3c2 + matriy->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix2x3* const matrix2)
|
||||
inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Matrix2x3* const matriy)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
sum->r1c1 = matrix->r1c1 + matriy->r1c1;
|
||||
sum->r1c2 = matrix->r1c2 + matriy->r1c2;
|
||||
|
||||
sum->r2c1 = matrix1->r2c1 + matrix2->r2c1;
|
||||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
sum->r2c1 = matrix->r2c1 + matriy->r2c1;
|
||||
sum->r2c2 = matrix->r2c2 + matriy->r2c2;
|
||||
|
||||
sum->r3c1 = matrix1->r3c1 + matrix2->r3c1;
|
||||
sum->r3c2 = matrix1->r3c2 + matrix2->r3c2;
|
||||
sum->r3c1 = matrix->r3c1 + matriy->r3c1;
|
||||
sum->r3c2 = matrix->r3c2 + matriy->r3c2;
|
||||
}
|
||||
|
||||
// ================= Add Scaled ================= //
|
||||
|
|
@ -466,31 +466,31 @@ inline void bgc_fp64_matrix2x3_multiply_by_real_number(BGC_FP64_Matrix2x3* const
|
|||
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_vector2(BGC_FP32_Vector3* const product, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Vector2* vector)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
product->x3 = matrix->r3c1 * vector->x1 + matrix->r3c2 * vector->x2;
|
||||
product->x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y;
|
||||
product->y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y;
|
||||
product->z = matrix->r3c1 * vector->x + matrix->r3c2 * vector->y;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_vector2(BGC_FP64_Vector3* const product, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Vector2* vector)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
product->x3 = matrix->r3c1 * vector->x1 + matrix->r3c2 * vector->x2;
|
||||
product->x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y;
|
||||
product->y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y;
|
||||
product->z = matrix->r3c1 * vector->x + matrix->r3c2 * vector->y;
|
||||
}
|
||||
|
||||
|
||||
// ========== Matrix Product 2x3 at 2x2 ========= //
|
||||
// ========== Matrix Product 2z at 2y ========= //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix2x2* const matrix2)
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Matrix2x2* const matriy)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
const float r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1;
|
||||
const float r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2;
|
||||
|
||||
const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1;
|
||||
const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2;
|
||||
const float r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1;
|
||||
const float r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2;
|
||||
|
||||
const float r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1;
|
||||
const float r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2;
|
||||
const float r3c1 = matrix->r3c1 * matriy->r1c1 + matrix->r3c2 * matriy->r2c1;
|
||||
const float r3c2 = matrix->r3c1 * matriy->r1c2 + matrix->r3c2 * matriy->r2c2;
|
||||
|
||||
product->r1c1 = r1c1;
|
||||
product->r1c2 = r1c2;
|
||||
|
|
@ -502,16 +502,16 @@ inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* const p
|
|||
product->r3c2 = r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix2x2* const matrix2)
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Matrix2x2* const matriy)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
const double r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1;
|
||||
const double r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2;
|
||||
|
||||
const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1;
|
||||
const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2;
|
||||
const double r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1;
|
||||
const double r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2;
|
||||
|
||||
const double r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1;
|
||||
const double r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2;
|
||||
const double r3c1 = matrix->r3c1 * matriy->r1c1 + matrix->r3c2 * matriy->r2c1;
|
||||
const double r3c2 = matrix->r3c1 * matriy->r1c2 + matrix->r3c2 * matriy->r2c2;
|
||||
|
||||
product->r1c1 = r1c1;
|
||||
product->r1c2 = r1c2;
|
||||
|
|
@ -523,36 +523,36 @@ inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* const p
|
|||
product->r3c2 = r3c2;
|
||||
}
|
||||
|
||||
// ========== Matrix Product 2x3 at 3x2 ========= //
|
||||
// ========== Matrix Product 2z at 3y ========= //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_matrix3x2(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix3x2* const matrix2)
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_matrix3x2(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Matrix3x2* const matriy)
|
||||
{
|
||||
product->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
product->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
product->r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3;
|
||||
product->r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1;
|
||||
product->r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2;
|
||||
product->r1c3 = matrix->r1c1 * matriy->r1c3 + matrix->r1c2 * matriy->r2c3;
|
||||
|
||||
product->r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1;
|
||||
product->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2;
|
||||
product->r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3;
|
||||
product->r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1;
|
||||
product->r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2;
|
||||
product->r2c3 = matrix->r2c1 * matriy->r1c3 + matrix->r2c2 * matriy->r2c3;
|
||||
|
||||
product->r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1;
|
||||
product->r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2;
|
||||
product->r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3;
|
||||
product->r3c1 = matrix->r3c1 * matriy->r1c1 + matrix->r3c2 * matriy->r2c1;
|
||||
product->r3c2 = matrix->r3c1 * matriy->r1c2 + matrix->r3c2 * matriy->r2c2;
|
||||
product->r3c3 = matrix->r3c1 * matriy->r1c3 + matrix->r3c2 * matriy->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix3x2* const matrix2)
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Matrix3x2* const matriy)
|
||||
{
|
||||
product->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
product->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
product->r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3;
|
||||
product->r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1;
|
||||
product->r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2;
|
||||
product->r1c3 = matrix->r1c1 * matriy->r1c3 + matrix->r1c2 * matriy->r2c3;
|
||||
|
||||
product->r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1;
|
||||
product->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2;
|
||||
product->r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3;
|
||||
product->r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1;
|
||||
product->r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2;
|
||||
product->r2c3 = matrix->r2c1 * matriy->r1c3 + matrix->r2c2 * matriy->r2c3;
|
||||
|
||||
product->r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1;
|
||||
product->r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2;
|
||||
product->r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3;
|
||||
product->r3c1 = matrix->r3c1 * matriy->r1c1 + matrix->r3c2 * matriy->r2c1;
|
||||
product->r3c2 = matrix->r3c1 * matriy->r1c2 + matrix->r3c2 * matriy->r2c2;
|
||||
product->r3c3 = matrix->r3c1 * matriy->r1c3 + matrix->r3c2 * matriy->r2c3;
|
||||
}
|
||||
|
||||
// =================== Divide =================== //
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ extern inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* const matrix);
|
|||
extern inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* const destination, const BGC_FP32_Matrix3x2* const source);
|
||||
extern inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* const destination, const BGC_FP64_Matrix3x2* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* const matrix1, BGC_FP32_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* const matrix1, BGC_FP64_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* const matrix, BGC_FP32_Matrix3x2* const matriy);
|
||||
extern inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* const matrix, BGC_FP64_Matrix3x2* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* const destination, const BGC_FP32_Matrix3x2* const source);
|
||||
extern inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* const destination, const BGC_FP64_Matrix3x2* const source);
|
||||
|
|
@ -27,8 +27,8 @@ extern inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* const column,
|
|||
extern inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* const matrix, const int column_number, const BGC_FP32_Vector2* const column);
|
||||
extern inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* const matrix, const int column_number, const BGC_FP64_Vector2* const column);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Matrix3x2* const matriy);
|
||||
extern inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Matrix3x2* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_add_scaled(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const basic_matrix, const BGC_FP32_Matrix3x2* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x2_add_scaled(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const basic_matrix, const BGC_FP64_Matrix3x2* const scalable_matrix, const double scale);
|
||||
|
|
@ -45,11 +45,11 @@ extern inline void bgc_fp64_matrix3x2_multiply_by_real_number(BGC_FP64_Matrix3x2
|
|||
extern inline void bgc_fp32_matrix3x2_multiply_by_vector3(BGC_FP32_Vector2* const product, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Vector3* const vector);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_vector3(BGC_FP64_Vector2* const product, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Vector3* const vector);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Matrix2x3* const matriy);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Matrix2x3* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Matrix3x3* const matriy);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Matrix3x3* const matriy);
|
||||
|
||||
extern inline int bgc_fp32_matrix3x2_divide_by_real_number(BGC_FP32_Matrix3x2* const quotient, const BGC_FP32_Matrix3x2* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix3x2_divide_by_real_number(BGC_FP64_Matrix3x2* const quotient, const BGC_FP64_Matrix3x2* const dividend, const double divisor);
|
||||
|
|
|
|||
|
|
@ -56,58 +56,58 @@ inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* const destination, const
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* const matrix1, BGC_FP32_Matrix3x2* const matrix2)
|
||||
inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* const matrix, BGC_FP32_Matrix3x2* const matriy)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
const float r1c3 = matrix2->r1c3;
|
||||
const float r1c1 = matriy->r1c1;
|
||||
const float r1c2 = matriy->r1c2;
|
||||
const float r1c3 = matriy->r1c3;
|
||||
|
||||
const float r2c1 = matrix2->r2c1;
|
||||
const float r2c2 = matrix2->r2c2;
|
||||
const float r2c3 = matrix2->r2c3;
|
||||
const float r2c1 = matriy->r2c1;
|
||||
const float r2c2 = matriy->r2c2;
|
||||
const float r2c3 = matriy->r2c3;
|
||||
|
||||
matrix2->r1c1 = matrix1->r1c1;
|
||||
matrix2->r1c2 = matrix1->r1c2;
|
||||
matrix2->r1c3 = matrix1->r1c3;
|
||||
matriy->r1c1 = matrix->r1c1;
|
||||
matriy->r1c2 = matrix->r1c2;
|
||||
matriy->r1c3 = matrix->r1c3;
|
||||
|
||||
matrix2->r2c1 = matrix1->r2c1;
|
||||
matrix2->r2c2 = matrix1->r2c2;
|
||||
matrix2->r2c3 = matrix1->r2c3;
|
||||
matriy->r2c1 = matrix->r2c1;
|
||||
matriy->r2c2 = matrix->r2c2;
|
||||
matriy->r2c3 = matrix->r2c3;
|
||||
|
||||
matrix1->r1c1 = r1c1;
|
||||
matrix1->r1c2 = r1c2;
|
||||
matrix1->r1c3 = r1c3;
|
||||
matrix->r1c1 = r1c1;
|
||||
matrix->r1c2 = r1c2;
|
||||
matrix->r1c3 = r1c3;
|
||||
|
||||
matrix1->r2c1 = r2c1;
|
||||
matrix1->r2c2 = r2c2;
|
||||
matrix1->r2c3 = r2c3;
|
||||
matrix->r2c1 = r2c1;
|
||||
matrix->r2c2 = r2c2;
|
||||
matrix->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* const matrix1, BGC_FP64_Matrix3x2* const matrix2)
|
||||
inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* const matrix, BGC_FP64_Matrix3x2* const matriy)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
const double r1c3 = matrix2->r1c3;
|
||||
const double r1c1 = matriy->r1c1;
|
||||
const double r1c2 = matriy->r1c2;
|
||||
const double r1c3 = matriy->r1c3;
|
||||
|
||||
const double r2c1 = matrix2->r2c1;
|
||||
const double r2c2 = matrix2->r2c2;
|
||||
const double r2c3 = matrix2->r2c3;
|
||||
const double r2c1 = matriy->r2c1;
|
||||
const double r2c2 = matriy->r2c2;
|
||||
const double r2c3 = matriy->r2c3;
|
||||
|
||||
matrix2->r1c1 = matrix1->r1c1;
|
||||
matrix2->r1c2 = matrix1->r1c2;
|
||||
matrix2->r1c3 = matrix1->r1c3;
|
||||
matriy->r1c1 = matrix->r1c1;
|
||||
matriy->r1c2 = matrix->r1c2;
|
||||
matriy->r1c3 = matrix->r1c3;
|
||||
|
||||
matrix2->r2c1 = matrix1->r2c1;
|
||||
matrix2->r2c2 = matrix1->r2c2;
|
||||
matrix2->r2c3 = matrix1->r2c3;
|
||||
matriy->r2c1 = matrix->r2c1;
|
||||
matriy->r2c2 = matrix->r2c2;
|
||||
matriy->r2c3 = matrix->r2c3;
|
||||
|
||||
matrix1->r1c1 = r1c1;
|
||||
matrix1->r1c2 = r1c2;
|
||||
matrix1->r1c3 = r1c3;
|
||||
matrix->r1c1 = r1c1;
|
||||
matrix->r1c2 = r1c2;
|
||||
matrix->r1c3 = r1c3;
|
||||
|
||||
matrix1->r2c1 = r2c1;
|
||||
matrix1->r2c2 = r2c2;
|
||||
matrix1->r2c3 = r2c3;
|
||||
matrix->r2c1 = r2c1;
|
||||
matrix->r2c2 = r2c2;
|
||||
matrix->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
// ================== Convert =================== //
|
||||
|
|
@ -164,46 +164,46 @@ inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* const row, const BGC_FP
|
|||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
row->x3 = matrix->r1c3;
|
||||
row->x = matrix->r1c1;
|
||||
row->y = matrix->r1c2;
|
||||
row->z = matrix->r1c3;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2)
|
||||
{
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
row->x3 = matrix->r2c3;
|
||||
row->x = matrix->r2c1;
|
||||
row->y = matrix->r2c2;
|
||||
row->z = matrix->r2c3;
|
||||
return;
|
||||
}
|
||||
|
||||
row->x1 = 0.0f;
|
||||
row->x2 = 0.0f;
|
||||
row->x3 = 0.0f;
|
||||
row->x = 0.0f;
|
||||
row->y = 0.0f;
|
||||
row->z = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* const row, const BGC_FP64_Matrix3x2* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
row->x3 = matrix->r1c3;
|
||||
row->x = matrix->r1c1;
|
||||
row->y = matrix->r1c2;
|
||||
row->z = matrix->r1c3;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2)
|
||||
{
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
row->x3 = matrix->r2c3;
|
||||
row->x = matrix->r2c1;
|
||||
row->y = matrix->r2c2;
|
||||
row->z = matrix->r2c3;
|
||||
return;
|
||||
}
|
||||
|
||||
row->x1 = 0.0f;
|
||||
row->x2 = 0.0f;
|
||||
row->x3 = 0.0f;
|
||||
row->x = 0.0f;
|
||||
row->y = 0.0f;
|
||||
row->z = 0.0f;
|
||||
}
|
||||
|
||||
// ================== Set Row =================== //
|
||||
|
|
@ -212,17 +212,17 @@ inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* const matrix, const i
|
|||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
matrix->r1c3 = row->x3;
|
||||
matrix->r1c1 = row->x;
|
||||
matrix->r1c2 = row->y;
|
||||
matrix->r1c3 = row->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2)
|
||||
{
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
matrix->r2c3 = row->x3;
|
||||
matrix->r2c1 = row->x;
|
||||
matrix->r2c2 = row->y;
|
||||
matrix->r2c3 = row->z;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -230,17 +230,17 @@ inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* const matrix, const i
|
|||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
matrix->r1c3 = row->x3;
|
||||
matrix->r1c1 = row->x;
|
||||
matrix->r1c2 = row->y;
|
||||
matrix->r1c3 = row->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2)
|
||||
{
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
matrix->r2c3 = row->x3;
|
||||
matrix->r2c1 = row->x;
|
||||
matrix->r2c2 = row->y;
|
||||
matrix->r2c3 = row->z;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -250,54 +250,54 @@ inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* const column, const
|
|||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
column->x = matrix->r1c1;
|
||||
column->y = matrix->r2c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2)
|
||||
{
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
column->x = matrix->r1c2;
|
||||
column->y = matrix->r2c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 3)
|
||||
{
|
||||
column->x1 = matrix->r1c3;
|
||||
column->x2 = matrix->r2c3;
|
||||
column->x = matrix->r1c3;
|
||||
column->y = matrix->r2c3;
|
||||
return;
|
||||
}
|
||||
|
||||
column->x1 = 0.0f;
|
||||
column->x2 = 0.0f;
|
||||
column->x = 0.0f;
|
||||
column->y = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* const column, const BGC_FP64_Matrix3x2* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
column->x = matrix->r1c1;
|
||||
column->y = matrix->r2c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2)
|
||||
{
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
column->x = matrix->r1c2;
|
||||
column->y = matrix->r2c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 3)
|
||||
{
|
||||
column->x1 = matrix->r1c3;
|
||||
column->x2 = matrix->r2c3;
|
||||
column->x = matrix->r1c3;
|
||||
column->y = matrix->r2c3;
|
||||
return;
|
||||
}
|
||||
|
||||
column->x1 = 0.0;
|
||||
column->x2 = 0.0;
|
||||
column->x = 0.0;
|
||||
column->y = 0.0;
|
||||
}
|
||||
|
||||
// ================= Set Column ================= //
|
||||
|
|
@ -306,22 +306,22 @@ inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* const matrix, cons
|
|||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
matrix->r1c1 = column->x;
|
||||
matrix->r2c1 = column->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2)
|
||||
{
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
matrix->r1c2 = column->x;
|
||||
matrix->r2c2 = column->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 3)
|
||||
{
|
||||
matrix->r1c3 = column->x1;
|
||||
matrix->r2c3 = column->x2;
|
||||
matrix->r1c3 = column->x;
|
||||
matrix->r2c3 = column->y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -329,47 +329,47 @@ inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* const matrix, cons
|
|||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
matrix->r1c1 = column->x;
|
||||
matrix->r2c1 = column->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2)
|
||||
{
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
matrix->r1c2 = column->x;
|
||||
matrix->r2c2 = column->y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 3)
|
||||
{
|
||||
matrix->r1c3 = column->x1;
|
||||
matrix->r2c3 = column->x2;
|
||||
matrix->r1c3 = column->x;
|
||||
matrix->r2c3 = column->y;
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix3x2* const matrix2)
|
||||
inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Matrix3x2* const matriy)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
sum->r1c3 = matrix1->r1c3 + matrix2->r1c3;
|
||||
sum->r1c1 = matrix->r1c1 + matriy->r1c1;
|
||||
sum->r1c2 = matrix->r1c2 + matriy->r1c2;
|
||||
sum->r1c3 = matrix->r1c3 + matriy->r1c3;
|
||||
|
||||
sum->r2c1 = matrix1->r2c1 + matrix2->r2c1;
|
||||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
sum->r2c3 = matrix1->r2c3 + matrix2->r2c3;
|
||||
sum->r2c1 = matrix->r2c1 + matriy->r2c1;
|
||||
sum->r2c2 = matrix->r2c2 + matriy->r2c2;
|
||||
sum->r2c3 = matrix->r2c3 + matriy->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix3x2* const matrix2)
|
||||
inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Matrix3x2* const matriy)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
sum->r1c3 = matrix1->r1c3 + matrix2->r1c3;
|
||||
sum->r1c1 = matrix->r1c1 + matriy->r1c1;
|
||||
sum->r1c2 = matrix->r1c2 + matriy->r1c2;
|
||||
sum->r1c3 = matrix->r1c3 + matriy->r1c3;
|
||||
|
||||
sum->r2c1 = matrix1->r2c1 + matrix2->r2c1;
|
||||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
sum->r2c3 = matrix1->r2c3 + matrix2->r2c3;
|
||||
sum->r2c1 = matrix->r2c1 + matriy->r2c1;
|
||||
sum->r2c2 = matrix->r2c2 + matriy->r2c2;
|
||||
sum->r2c3 = matrix->r2c3 + matriy->r2c3;
|
||||
}
|
||||
|
||||
// ================= Add Scaled ================= //
|
||||
|
|
@ -472,47 +472,47 @@ inline void bgc_fp64_matrix3x2_multiply_by_real_number(BGC_FP64_Matrix3x2* const
|
|||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_vector3(BGC_FP32_Vector2* const product, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Vector3* const vector)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||
product->x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y + matrix->r1c3 * vector->z;
|
||||
product->y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y + matrix->r2c3 * vector->z;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_vector3(BGC_FP64_Vector2* const product, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Vector3* const vector)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||
product->x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y + matrix->r1c3 * vector->z;
|
||||
product->y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y + matrix->r2c3 * vector->z;
|
||||
}
|
||||
|
||||
// ========== Matrix Product 3x2 at 2x3 ========= //
|
||||
// ========== Matrix Product 3y at 2z ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix2x3* const matrix2)
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Matrix2x3* const matriy)
|
||||
{
|
||||
product->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
product->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
product->r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1 + matrix->r1c3 * matriy->r3c1;
|
||||
product->r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2 + matrix->r1c3 * matriy->r3c2;
|
||||
|
||||
product->r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1;
|
||||
product->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2;
|
||||
product->r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1 + matrix->r2c3 * matriy->r3c1;
|
||||
product->r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2 + matrix->r2c3 * matriy->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix2x3* const matrix2)
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Matrix2x3* const matriy)
|
||||
{
|
||||
product->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
product->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
product->r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1 + matrix->r1c3 * matriy->r3c1;
|
||||
product->r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2 + matrix->r1c3 * matriy->r3c2;
|
||||
|
||||
product->r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1;
|
||||
product->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2;
|
||||
product->r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1 + matrix->r2c3 * matriy->r3c1;
|
||||
product->r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2 + matrix->r2c3 * matriy->r3c2;
|
||||
}
|
||||
|
||||
// ========== Matrix Product 3x2 at 3x2 ========= //
|
||||
// ========== Matrix Product 3y at 3y ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix3x3* const matrix2)
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Matrix3x3* const matriy)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
const float r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3 + matrix1->r1c3 * matrix2->r3c3;
|
||||
const float r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1 + matrix->r1c3 * matriy->r3c1;
|
||||
const float r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2 + matrix->r1c3 * matriy->r3c2;
|
||||
const float r1c3 = matrix->r1c1 * matriy->r1c3 + matrix->r1c2 * matriy->r2c3 + matrix->r1c3 * matriy->r3c3;
|
||||
|
||||
const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1;
|
||||
const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2;
|
||||
const float r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3 + matrix1->r2c3 * matrix2->r3c3;
|
||||
const float r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1 + matrix->r2c3 * matriy->r3c1;
|
||||
const float r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2 + matrix->r2c3 * matriy->r3c2;
|
||||
const float r2c3 = matrix->r2c1 * matriy->r1c3 + matrix->r2c2 * matriy->r2c3 + matrix->r2c3 * matriy->r3c3;
|
||||
|
||||
product->r1c1 = r1c1;
|
||||
product->r1c2 = r1c2;
|
||||
|
|
@ -523,15 +523,15 @@ inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* const p
|
|||
product->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix3x3* const matrix2)
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Matrix3x3* const matriy)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
const double r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3 + matrix1->r1c3 * matrix2->r3c3;
|
||||
const double r1c1 = matrix->r1c1 * matriy->r1c1 + matrix->r1c2 * matriy->r2c1 + matrix->r1c3 * matriy->r3c1;
|
||||
const double r1c2 = matrix->r1c1 * matriy->r1c2 + matrix->r1c2 * matriy->r2c2 + matrix->r1c3 * matriy->r3c2;
|
||||
const double r1c3 = matrix->r1c1 * matriy->r1c3 + matrix->r1c2 * matriy->r2c3 + matrix->r1c3 * matriy->r3c3;
|
||||
|
||||
const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1;
|
||||
const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2;
|
||||
const double r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3 + matrix1->r2c3 * matrix2->r3c3;
|
||||
const double r2c1 = matrix->r2c1 * matriy->r1c1 + matrix->r2c2 * matriy->r2c1 + matrix->r2c3 * matriy->r3c1;
|
||||
const double r2c2 = matrix->r2c1 * matriy->r1c2 + matrix->r2c2 * matriy->r2c2 + matrix->r2c3 * matriy->r3c2;
|
||||
const double r2c3 = matrix->r2c1 * matriy->r1c3 + matrix->r2c2 * matriy->r2c3 + matrix->r2c3 * matriy->r3c3;
|
||||
|
||||
product->r1c1 = r1c1;
|
||||
product->r1c2 = r1c2;
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ extern inline void bgc_fp64_matrix3x3_make_diagonal(BGC_FP64_Matrix3x3* const ma
|
|||
extern inline void bgc_fp32_matrix3x3_copy(BGC_FP32_Matrix3x3* const destination, const BGC_FP32_Matrix3x3* const source);
|
||||
extern inline void bgc_fp64_matrix3x3_copy(BGC_FP64_Matrix3x3* const destination, const BGC_FP64_Matrix3x3* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* const matrix1, BGC_FP32_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* const matrix1, BGC_FP64_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* const matrix, BGC_FP32_Matrix3x3* const matriy);
|
||||
extern inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* const matrix, BGC_FP64_Matrix3x3* const matriy);
|
||||
|
||||
extern inline void bgc_fp64_matrix3x3_convert_to_fp32(BGC_FP32_Matrix3x3* const destination, const BGC_FP64_Matrix3x3* const source);
|
||||
extern inline void bgc_fp32_matrix3x3_convert_to_fp64(BGC_FP64_Matrix3x3* const destination, const BGC_FP32_Matrix3x3* const source);
|
||||
|
|
@ -51,8 +51,8 @@ extern inline void bgc_fp64_matrix3x3_get_column(BGC_FP64_Vector3* const column,
|
|||
extern inline void bgc_fp32_matrix3x3_set_column(BGC_FP32_Matrix3x3* const matrix, const int column_number, const BGC_FP32_Vector3* const column);
|
||||
extern inline void bgc_fp64_matrix3x3_set_column(BGC_FP64_Matrix3x3* const matrix, const int column_number, const BGC_FP64_Vector3* const column);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const matrix1, const BGC_FP64_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Matrix3x3* const matriy);
|
||||
extern inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Matrix3x3* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_add_scaled(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const basic_matrix, const BGC_FP32_Matrix3x3* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x3_add_scaled(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const basic_matrix, const BGC_FP64_Matrix3x3* const scalable_matrix, const double scale);
|
||||
|
|
@ -78,11 +78,11 @@ extern inline void _bgc_fp64_restrict_matrix3x3_multiply_by_vector3(BGC_FP64_Vec
|
|||
extern inline void _bgc_fp32_restrict_matrix3x3_multiply_by_dual_vector3(BGC_FP32_DualVector3* restrict const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_DualVector3* const vector);
|
||||
extern inline void _bgc_fp64_restrict_matrix3x3_multiply_by_dual_vector3(BGC_FP64_DualVector3* restrict const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_DualVector3* const vector);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_matrix2x3(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_matrix2x3(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix3x3* const matrix1, const BGC_FP64_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_matrix2x3(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Matrix2x3* const matriy);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_matrix2x3(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Matrix2x3* const matriy);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_matrix3x3(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_matrix3x3(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix3x3* const matrix1, const BGC_FP64_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_matrix3x3(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Matrix3x3* const matriy);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_matrix3x3(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Matrix3x3* const matriy);
|
||||
|
||||
extern inline int bgc_fp32_matrix3x3_divide_by_real_number(BGC_FP32_Matrix3x3* const quotient, const BGC_FP32_Matrix3x3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix3x3_divide_by_real_number(BGC_FP64_Matrix3x3* const quotient, const BGC_FP64_Matrix3x3* const dividend, const double divisor);
|
||||
|
|
|
|||
|
|
@ -136,82 +136,82 @@ inline void bgc_fp64_matrix3x3_copy(BGC_FP64_Matrix3x3* const destination, const
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* const matrix1, BGC_FP32_Matrix3x3* const matrix2)
|
||||
inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* const matrix, BGC_FP32_Matrix3x3* const matriy)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
const float r1c3 = matrix2->r1c3;
|
||||
const float r1c1 = matriy->r1c1;
|
||||
const float r1c2 = matriy->r1c2;
|
||||
const float r1c3 = matriy->r1c3;
|
||||
|
||||
const float r2c1 = matrix2->r2c1;
|
||||
const float r2c2 = matrix2->r2c2;
|
||||
const float r2c3 = matrix2->r2c3;
|
||||
const float r2c1 = matriy->r2c1;
|
||||
const float r2c2 = matriy->r2c2;
|
||||
const float r2c3 = matriy->r2c3;
|
||||
|
||||
const float r3c1 = matrix2->r3c1;
|
||||
const float r3c2 = matrix2->r3c2;
|
||||
const float r3c3 = matrix2->r3c3;
|
||||
const float r3c1 = matriy->r3c1;
|
||||
const float r3c2 = matriy->r3c2;
|
||||
const float r3c3 = matriy->r3c3;
|
||||
|
||||
matrix2->r1c1 = matrix1->r1c1;
|
||||
matrix2->r1c2 = matrix1->r1c2;
|
||||
matrix2->r1c3 = matrix1->r1c3;
|
||||
matriy->r1c1 = matrix->r1c1;
|
||||
matriy->r1c2 = matrix->r1c2;
|
||||
matriy->r1c3 = matrix->r1c3;
|
||||
|
||||
matrix2->r2c1 = matrix1->r2c1;
|
||||
matrix2->r2c2 = matrix1->r2c2;
|
||||
matrix2->r2c3 = matrix1->r2c3;
|
||||
matriy->r2c1 = matrix->r2c1;
|
||||
matriy->r2c2 = matrix->r2c2;
|
||||
matriy->r2c3 = matrix->r2c3;
|
||||
|
||||
matrix2->r3c1 = matrix1->r3c1;
|
||||
matrix2->r3c2 = matrix1->r3c2;
|
||||
matrix2->r3c3 = matrix1->r3c3;
|
||||
matriy->r3c1 = matrix->r3c1;
|
||||
matriy->r3c2 = matrix->r3c2;
|
||||
matriy->r3c3 = matrix->r3c3;
|
||||
|
||||
matrix1->r1c1 = r1c1;
|
||||
matrix1->r1c2 = r1c2;
|
||||
matrix1->r1c3 = r1c3;
|
||||
matrix->r1c1 = r1c1;
|
||||
matrix->r1c2 = r1c2;
|
||||
matrix->r1c3 = r1c3;
|
||||
|
||||
matrix1->r2c1 = r2c1;
|
||||
matrix1->r2c2 = r2c2;
|
||||
matrix1->r2c3 = r2c3;
|
||||
matrix->r2c1 = r2c1;
|
||||
matrix->r2c2 = r2c2;
|
||||
matrix->r2c3 = r2c3;
|
||||
|
||||
matrix1->r3c1 = r3c1;
|
||||
matrix1->r3c2 = r3c2;
|
||||
matrix1->r3c3 = r3c3;
|
||||
matrix->r3c1 = r3c1;
|
||||
matrix->r3c2 = r3c2;
|
||||
matrix->r3c3 = r3c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* const matrix1, BGC_FP64_Matrix3x3* const matrix2)
|
||||
inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* const matrix, BGC_FP64_Matrix3x3* const matriy)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
const double r1c3 = matrix2->r1c3;
|
||||
const double r1c1 = matriy->r1c1;
|
||||
const double r1c2 = matriy->r1c2;
|
||||
const double r1c3 = matriy->r1c3;
|
||||
|
||||
const double r2c1 = matrix2->r2c1;
|
||||
const double r2c2 = matrix2->r2c2;
|
||||
const double r2c3 = matrix2->r2c3;
|
||||
const double r2c1 = matriy->r2c1;
|
||||
const double r2c2 = matriy->r2c2;
|
||||
const double r2c3 = matriy->r2c3;
|
||||
|
||||
const double r3c1 = matrix2->r3c1;
|
||||
const double r3c2 = matrix2->r3c2;
|
||||
const double r3c3 = matrix2->r3c3;
|
||||
const double r3c1 = matriy->r3c1;
|
||||
const double r3c2 = matriy->r3c2;
|
||||
const double r3c3 = matriy->r3c3;
|
||||
|
||||
matrix2->r1c1 = matrix1->r1c1;
|
||||
matrix2->r1c2 = matrix1->r1c2;
|
||||
matrix2->r1c3 = matrix1->r1c3;
|
||||
matriy->r1c1 = matrix->r1c1;
|
||||
matriy->r1c2 = matrix->r1c2;
|
||||
matriy->r1c3 = matrix->r1c3;
|
||||
|
||||
matrix2->r2c1 = matrix1->r2c1;
|
||||
matrix2->r2c2 = matrix1->r2c2;
|
||||
matrix2->r2c3 = matrix1->r2c3;
|
||||
matriy->r2c1 = matrix->r2c1;
|
||||
matriy->r2c2 = matrix->r2c2;
|
||||
matriy->r2c3 = matrix->r2c3;
|
||||
|
||||
matrix2->r3c1 = matrix1->r3c1;
|
||||
matrix2->r3c2 = matrix1->r3c2;
|
||||
matrix2->r3c3 = matrix1->r3c3;
|
||||
matriy->r3c1 = matrix->r3c1;
|
||||
matriy->r3c2 = matrix->r3c2;
|
||||
matriy->r3c3 = matrix->r3c3;
|
||||
|
||||
matrix1->r1c1 = r1c1;
|
||||
matrix1->r1c2 = r1c2;
|
||||
matrix1->r1c3 = r1c3;
|
||||
matrix->r1c1 = r1c1;
|
||||
matrix->r1c2 = r1c2;
|
||||
matrix->r1c3 = r1c3;
|
||||
|
||||
matrix1->r2c1 = r2c1;
|
||||
matrix1->r2c2 = r2c2;
|
||||
matrix1->r2c3 = r2c3;
|
||||
matrix->r2c1 = r2c1;
|
||||
matrix->r2c2 = r2c2;
|
||||
matrix->r2c3 = r2c3;
|
||||
|
||||
matrix1->r3c1 = r3c1;
|
||||
matrix1->r3c2 = r3c2;
|
||||
matrix1->r3c3 = r3c3;
|
||||
matrix->r3c1 = r3c1;
|
||||
matrix->r3c2 = r3c2;
|
||||
matrix->r3c3 = r3c3;
|
||||
}
|
||||
|
||||
// ================== Convert =================== //
|
||||
|
|
@ -426,62 +426,62 @@ inline void bgc_fp32_matrix3x3_get_row(BGC_FP32_Vector3* const row, const BGC_FP
|
|||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
row->x3 = matrix->r1c3;
|
||||
row->x = matrix->r1c1;
|
||||
row->y = matrix->r1c2;
|
||||
row->z = matrix->r1c3;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2)
|
||||
{
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
row->x3 = matrix->r2c3;
|
||||
row->x = matrix->r2c1;
|
||||
row->y = matrix->r2c2;
|
||||
row->z = matrix->r2c3;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 3)
|
||||
{
|
||||
row->x1 = matrix->r3c1;
|
||||
row->x2 = matrix->r3c2;
|
||||
row->x3 = matrix->r3c3;
|
||||
row->x = matrix->r3c1;
|
||||
row->y = matrix->r3c2;
|
||||
row->z = matrix->r3c3;
|
||||
return;
|
||||
}
|
||||
|
||||
row->x1 = 0.0f;
|
||||
row->x2 = 0.0f;
|
||||
row->x3 = 0.0f;
|
||||
row->x = 0.0f;
|
||||
row->y = 0.0f;
|
||||
row->z = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_get_row(BGC_FP64_Vector3* const row, const BGC_FP64_Matrix3x3* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
row->x3 = matrix->r1c3;
|
||||
row->x = matrix->r1c1;
|
||||
row->y = matrix->r1c2;
|
||||
row->z = matrix->r1c3;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2)
|
||||
{
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
row->x3 = matrix->r2c3;
|
||||
row->x = matrix->r2c1;
|
||||
row->y = matrix->r2c2;
|
||||
row->z = matrix->r2c3;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 3)
|
||||
{
|
||||
row->x1 = matrix->r3c1;
|
||||
row->x2 = matrix->r3c2;
|
||||
row->x3 = matrix->r3c3;
|
||||
row->x = matrix->r3c1;
|
||||
row->y = matrix->r3c2;
|
||||
row->z = matrix->r3c3;
|
||||
return;
|
||||
}
|
||||
|
||||
row->x1 = 0.0;
|
||||
row->x2 = 0.0;
|
||||
row->x3 = 0.0;
|
||||
row->x = 0.0;
|
||||
row->y = 0.0;
|
||||
row->z = 0.0;
|
||||
}
|
||||
|
||||
// ================== Set Row =================== //
|
||||
|
|
@ -490,25 +490,25 @@ inline void bgc_fp32_matrix3x3_set_row(BGC_FP32_Matrix3x3* const matrix, const i
|
|||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
matrix->r1c3 = row->x3;
|
||||
matrix->r1c1 = row->x;
|
||||
matrix->r1c2 = row->y;
|
||||
matrix->r1c3 = row->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2)
|
||||
{
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
matrix->r2c3 = row->x3;
|
||||
matrix->r2c1 = row->x;
|
||||
matrix->r2c2 = row->y;
|
||||
matrix->r2c3 = row->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 3)
|
||||
{
|
||||
matrix->r3c1 = row->x1;
|
||||
matrix->r3c2 = row->x2;
|
||||
matrix->r3c3 = row->x3;
|
||||
matrix->r3c1 = row->x;
|
||||
matrix->r3c2 = row->y;
|
||||
matrix->r3c3 = row->z;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -516,25 +516,25 @@ inline void bgc_fp64_matrix3x3_set_row(BGC_FP64_Matrix3x3* const matrix, const i
|
|||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
matrix->r1c3 = row->x3;
|
||||
matrix->r1c1 = row->x;
|
||||
matrix->r1c2 = row->y;
|
||||
matrix->r1c3 = row->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 2)
|
||||
{
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
matrix->r2c3 = row->x3;
|
||||
matrix->r2c1 = row->x;
|
||||
matrix->r2c2 = row->y;
|
||||
matrix->r2c3 = row->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (row_number == 3)
|
||||
{
|
||||
matrix->r3c1 = row->x1;
|
||||
matrix->r3c2 = row->x2;
|
||||
matrix->r3c3 = row->x3;
|
||||
matrix->r3c1 = row->x;
|
||||
matrix->r3c2 = row->y;
|
||||
matrix->r3c3 = row->z;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -544,62 +544,62 @@ inline void bgc_fp32_matrix3x3_get_column(BGC_FP32_Vector3* const column, const
|
|||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
column->x3 = matrix->r3c1;
|
||||
column->x = matrix->r1c1;
|
||||
column->y = matrix->r2c1;
|
||||
column->z = matrix->r3c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2)
|
||||
{
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
column->x3 = matrix->r3c2;
|
||||
column->x = matrix->r1c2;
|
||||
column->y = matrix->r2c2;
|
||||
column->z = matrix->r3c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 3)
|
||||
{
|
||||
column->x1 = matrix->r1c3;
|
||||
column->x2 = matrix->r2c3;
|
||||
column->x3 = matrix->r3c3;
|
||||
column->x = matrix->r1c3;
|
||||
column->y = matrix->r2c3;
|
||||
column->z = matrix->r3c3;
|
||||
return;
|
||||
}
|
||||
|
||||
column->x1 = 0.0f;
|
||||
column->x2 = 0.0f;
|
||||
column->x3 = 0.0f;
|
||||
column->x = 0.0f;
|
||||
column->y = 0.0f;
|
||||
column->z = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_get_column(BGC_FP64_Vector3* const column, const BGC_FP64_Matrix3x3* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
column->x3 = matrix->r3c1;
|
||||
column->x = matrix->r1c1;
|
||||
column->y = matrix->r2c1;
|
||||
column->z = matrix->r3c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2)
|
||||
{
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
column->x3 = matrix->r3c2;
|
||||
column->x = matrix->r1c2;
|
||||
column->y = matrix->r2c2;
|
||||
column->z = matrix->r3c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 3)
|
||||
{
|
||||
column->x1 = matrix->r1c3;
|
||||
column->x2 = matrix->r2c3;
|
||||
column->x3 = matrix->r3c3;
|
||||
column->x = matrix->r1c3;
|
||||
column->y = matrix->r2c3;
|
||||
column->z = matrix->r3c3;
|
||||
return;
|
||||
}
|
||||
|
||||
column->x1 = 0.0;
|
||||
column->x2 = 0.0;
|
||||
column->x3 = 0.0;
|
||||
column->x = 0.0;
|
||||
column->y = 0.0;
|
||||
column->z = 0.0;
|
||||
}
|
||||
|
||||
// ================= Set Column ================= //
|
||||
|
|
@ -608,25 +608,25 @@ inline void bgc_fp32_matrix3x3_set_column(BGC_FP32_Matrix3x3* const matrix, cons
|
|||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
matrix->r3c1 = column->x3;
|
||||
matrix->r1c1 = column->x;
|
||||
matrix->r2c1 = column->y;
|
||||
matrix->r3c1 = column->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2)
|
||||
{
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
matrix->r3c2 = column->x3;
|
||||
matrix->r1c2 = column->x;
|
||||
matrix->r2c2 = column->y;
|
||||
matrix->r3c2 = column->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 3)
|
||||
{
|
||||
matrix->r1c3 = column->x1;
|
||||
matrix->r2c3 = column->x2;
|
||||
matrix->r3c3 = column->x3;
|
||||
matrix->r1c3 = column->x;
|
||||
matrix->r2c3 = column->y;
|
||||
matrix->r3c3 = column->z;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -634,58 +634,58 @@ inline void bgc_fp64_matrix3x3_set_column(BGC_FP64_Matrix3x3* const matrix, cons
|
|||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
matrix->r3c1 = column->x3;
|
||||
matrix->r1c1 = column->x;
|
||||
matrix->r2c1 = column->y;
|
||||
matrix->r3c1 = column->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 2)
|
||||
{
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
matrix->r3c2 = column->x3;
|
||||
matrix->r1c2 = column->x;
|
||||
matrix->r2c2 = column->y;
|
||||
matrix->r3c2 = column->z;
|
||||
return;
|
||||
}
|
||||
|
||||
if (column_number == 3)
|
||||
{
|
||||
matrix->r1c3 = column->x1;
|
||||
matrix->r2c3 = column->x2;
|
||||
matrix->r3c3 = column->x3;
|
||||
matrix->r1c3 = column->x;
|
||||
matrix->r2c3 = column->y;
|
||||
matrix->r3c3 = column->z;
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix3x3* const matrix2)
|
||||
inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Matrix3x3* const matriy)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
sum->r1c3 = matrix1->r1c3 + matrix2->r1c3;
|
||||
sum->r1c1 = matrix->r1c1 + matriy->r1c1;
|
||||
sum->r1c2 = matrix->r1c2 + matriy->r1c2;
|
||||
sum->r1c3 = matrix->r1c3 + matriy->r1c3;
|
||||
|
||||
sum->r2c1 = matrix1->r2c1 + matrix2->r2c1;
|
||||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
sum->r2c3 = matrix1->r2c3 + matrix2->r2c3;
|
||||
sum->r2c1 = matrix->r2c1 + matriy->r2c1;
|
||||
sum->r2c2 = matrix->r2c2 + matriy->r2c2;
|
||||
sum->r2c3 = matrix->r2c3 + matriy->r2c3;
|
||||
|
||||
sum->r3c1 = matrix1->r3c1 + matrix2->r3c1;
|
||||
sum->r3c2 = matrix1->r3c2 + matrix2->r3c2;
|
||||
sum->r3c3 = matrix1->r3c3 + matrix2->r3c3;
|
||||
sum->r3c1 = matrix->r3c1 + matriy->r3c1;
|
||||
sum->r3c2 = matrix->r3c2 + matriy->r3c2;
|
||||
sum->r3c3 = matrix->r3c3 + matriy->r3c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const matrix1, const BGC_FP64_Matrix3x3* const matrix2)
|
||||
inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Matrix3x3* const matriy)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
sum->r1c3 = matrix1->r1c3 + matrix2->r1c3;
|
||||
sum->r1c1 = matrix->r1c1 + matriy->r1c1;
|
||||
sum->r1c2 = matrix->r1c2 + matriy->r1c2;
|
||||
sum->r1c3 = matrix->r1c3 + matriy->r1c3;
|
||||
|
||||
sum->r2c1 = matrix1->r2c1 + matrix2->r2c1;
|
||||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
sum->r2c3 = matrix1->r2c3 + matrix2->r2c3;
|
||||
sum->r2c1 = matrix->r2c1 + matriy->r2c1;
|
||||
sum->r2c2 = matrix->r2c2 + matriy->r2c2;
|
||||
sum->r2c3 = matrix->r2c3 + matriy->r2c3;
|
||||
|
||||
sum->r3c1 = matrix1->r3c1 + matrix2->r3c1;
|
||||
sum->r3c2 = matrix1->r3c2 + matrix2->r3c2;
|
||||
sum->r3c3 = matrix1->r3c3 + matrix2->r3c3;
|
||||
sum->r3c1 = matrix->r3c1 + matriy->r3c1;
|
||||
sum->r3c2 = matrix->r3c2 + matriy->r3c2;
|
||||
sum->r3c3 = matrix->r3c3 + matriy->r3c3;
|
||||
}
|
||||
|
||||
// ================= Add Scaled ================= //
|
||||
|
|
@ -820,118 +820,118 @@ inline void bgc_fp64_matrix3x3_multiply_by_real_number(BGC_FP64_Matrix3x3* const
|
|||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_vector3(BGC_FP32_Vector3* const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Vector3* const vector)
|
||||
{
|
||||
const float x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||
const float x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||
const float x3 = matrix->r3c1 * vector->x1 + matrix->r3c2 * vector->x2 + matrix->r3c3 * vector->x3;
|
||||
const float x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y + matrix->r1c3 * vector->z;
|
||||
const float y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y + matrix->r2c3 * vector->z;
|
||||
const float z = matrix->r3c1 * vector->x + matrix->r3c2 * vector->y + matrix->r3c3 * vector->z;
|
||||
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
product->x = x;
|
||||
product->y = y;
|
||||
product->z = z;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_vector3(BGC_FP64_Vector3* const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Vector3* const vector)
|
||||
{
|
||||
const double x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||
const double x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||
const double x3 = matrix->r3c1 * vector->x1 + matrix->r3c2 * vector->x2 + matrix->r3c3 * vector->x3;
|
||||
const double x = matrix->r1c1 * vector->x + matrix->r1c2 * vector->y + matrix->r1c3 * vector->z;
|
||||
const double y = matrix->r2c1 * vector->x + matrix->r2c2 * vector->y + matrix->r2c3 * vector->z;
|
||||
const double z = matrix->r3c1 * vector->x + matrix->r3c2 * vector->y + matrix->r3c3 * vector->z;
|
||||
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
product->x = x;
|
||||
product->y = y;
|
||||
product->z = z;
|
||||
}
|
||||
|
||||
// ========= Right Dual Vector Product ========== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_dual_vector3(BGC_FP32_DualVector3* const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_DualVector3* const vector)
|
||||
{
|
||||
const float real_x1 = matrix->r1c1 * vector->real_part.x1 + matrix->r1c2 * vector->real_part.x2 + matrix->r1c3 * vector->real_part.x3;
|
||||
const float real_x2 = matrix->r2c1 * vector->real_part.x1 + matrix->r2c2 * vector->real_part.x2 + matrix->r2c3 * vector->real_part.x3;
|
||||
const float real_x3 = matrix->r3c1 * vector->real_part.x1 + matrix->r3c2 * vector->real_part.x2 + matrix->r3c3 * vector->real_part.x3;
|
||||
const float real_x = matrix->r1c1 * vector->real_part.x + matrix->r1c2 * vector->real_part.y + matrix->r1c3 * vector->real_part.z;
|
||||
const float real_y = matrix->r2c1 * vector->real_part.x + matrix->r2c2 * vector->real_part.y + matrix->r2c3 * vector->real_part.z;
|
||||
const float real_z = matrix->r3c1 * vector->real_part.x + matrix->r3c2 * vector->real_part.y + matrix->r3c3 * vector->real_part.z;
|
||||
|
||||
const float dual_x1 = matrix->r1c1 * vector->dual_part.x1 + matrix->r1c2 * vector->dual_part.x2 + matrix->r1c3 * vector->dual_part.x3;
|
||||
const float dual_x2 = matrix->r2c1 * vector->dual_part.x1 + matrix->r2c2 * vector->dual_part.x2 + matrix->r2c3 * vector->dual_part.x3;
|
||||
const float dual_x3 = matrix->r3c1 * vector->dual_part.x1 + matrix->r3c2 * vector->dual_part.x2 + matrix->r3c3 * vector->dual_part.x3;
|
||||
const float dual_x = matrix->r1c1 * vector->dual_part.x + matrix->r1c2 * vector->dual_part.y + matrix->r1c3 * vector->dual_part.z;
|
||||
const float dual_y = matrix->r2c1 * vector->dual_part.x + matrix->r2c2 * vector->dual_part.y + matrix->r2c3 * vector->dual_part.z;
|
||||
const float dual_z = matrix->r3c1 * vector->dual_part.x + matrix->r3c2 * vector->dual_part.y + matrix->r3c3 * vector->dual_part.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;
|
||||
|
||||
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_matrix3x3_multiply_by_dual_vector3(BGC_FP64_DualVector3* const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_DualVector3* const vector)
|
||||
{
|
||||
const double real_x1 = matrix->r1c1 * vector->real_part.x1 + matrix->r1c2 * vector->real_part.x2 + matrix->r1c3 * vector->real_part.x3;
|
||||
const double real_x2 = matrix->r2c1 * vector->real_part.x1 + matrix->r2c2 * vector->real_part.x2 + matrix->r2c3 * vector->real_part.x3;
|
||||