Добавление квалификатора const для запрета изменения указаелей внутри функций
This commit is contained in:
parent
610756ffed
commit
e6ac9023ec
24 changed files with 951 additions and 951 deletions
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_reset(BGC_FP32_Matrix3x2* matrix)
|
||||
inline void bgc_fp32_matrix3x2_reset(BGC_FP32_Matrix3x2* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -19,7 +19,7 @@ inline void bgc_fp32_matrix3x2_reset(BGC_FP32_Matrix3x2* matrix)
|
|||
matrix->r2c3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* matrix)
|
||||
inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -32,7 +32,7 @@ inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* matrix)
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* destination, const BGC_FP32_Matrix3x2* source)
|
||||
inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* const destination, const BGC_FP32_Matrix3x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -43,7 +43,7 @@ inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* destination, const BGC_F
|
|||
destination->r2c3 = source->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* destination, const BGC_FP64_Matrix3x2* source)
|
||||
inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* const destination, const BGC_FP64_Matrix3x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -56,7 +56,7 @@ inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* destination, const BGC_F
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* matrix1, BGC_FP32_Matrix3x2* matrix2)
|
||||
inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* const matrix1, BGC_FP32_Matrix3x2* const matrix2)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
|
|
@ -83,7 +83,7 @@ inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* matrix1, BGC_FP32_Matrix
|
|||
matrix1->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* matrix1, BGC_FP64_Matrix3x2* matrix2)
|
||||
inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* const matrix1, BGC_FP64_Matrix3x2* const matrix2)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
|
|
@ -112,7 +112,7 @@ inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* matrix1, BGC_FP64_Matrix
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* destination, const BGC_FP64_Matrix3x2* source)
|
||||
inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* const destination, const BGC_FP64_Matrix3x2* const source)
|
||||
{
|
||||
destination->r1c1 = (float)source->r1c1;
|
||||
destination->r1c2 = (float)source->r1c2;
|
||||
|
|
@ -123,7 +123,7 @@ inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* destination,
|
|||
destination->r2c3 = (float)source->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* destination, const BGC_FP32_Matrix3x2* source)
|
||||
inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* const destination, const BGC_FP32_Matrix3x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -136,7 +136,7 @@ inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* destination,
|
|||
|
||||
// ================= Transpose ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* transposed, const BGC_FP32_Matrix2x3* matrix)
|
||||
inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* const transposed, const BGC_FP32_Matrix2x3* const matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r1c2 = matrix->r2c1;
|
||||
|
|
@ -147,7 +147,7 @@ inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* transposed, co
|
|||
transposed->r2c3 = matrix->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* transposed, const BGC_FP64_Matrix2x3* matrix)
|
||||
inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* const transposed, const BGC_FP64_Matrix2x3* const matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r1c2 = matrix->r2c1;
|
||||
|
|
@ -160,7 +160,7 @@ inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* transposed, co
|
|||
|
||||
// ================== Get Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Matrix3x2* matrix, const int row_number)
|
||||
inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* const row, const BGC_FP32_Matrix3x2* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -183,7 +183,7 @@ inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Mat
|
|||
row->x3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Matrix3x2* matrix, const int row_number)
|
||||
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)
|
||||
{
|
||||
|
|
@ -208,7 +208,7 @@ inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Mat
|
|||
|
||||
// ================== Set Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* matrix, const int row_number, const BGC_FP32_Vector3* row)
|
||||
inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* const matrix, const int row_number, const BGC_FP32_Vector3* const row)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -226,7 +226,7 @@ inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* matrix, const int row
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* matrix, const int row_number, const BGC_FP64_Vector3* row)
|
||||
inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* const matrix, const int row_number, const BGC_FP64_Vector3* const row)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -246,7 +246,7 @@ inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* matrix, const int row
|
|||
|
||||
// ================= Get Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* column, const BGC_FP32_Matrix3x2* matrix, const int column_number)
|
||||
inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* const column, const BGC_FP32_Matrix3x2* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -273,7 +273,7 @@ inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* column, const BGC_FP
|
|||
column->x2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* column, const BGC_FP64_Matrix3x2* matrix, const int column_number)
|
||||
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)
|
||||
{
|
||||
|
|
@ -302,7 +302,7 @@ inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* column, const BGC_FP
|
|||
|
||||
// ================= Set Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* matrix, const int column_number, const BGC_FP32_Vector2* column)
|
||||
inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* const matrix, const int column_number, const BGC_FP32_Vector2* const column)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -325,7 +325,7 @@ inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* matrix, const int
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* matrix, const int column_number, const BGC_FP64_Vector2* column)
|
||||
inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* const matrix, const int column_number, const BGC_FP64_Vector2* const column)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -350,7 +350,7 @@ inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* matrix, const int
|
|||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix3x2* matrix2)
|
||||
inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix3x2* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -361,7 +361,7 @@ inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matri
|
|||
sum->r2c3 = matrix1->r2c3 + matrix2->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix3x2* matrix2)
|
||||
inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix3x2* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -374,7 +374,7 @@ inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matri
|
|||
|
||||
// ================= Add Scaled ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_add_scaled(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matrix3x2* basic_matrix, const BGC_FP32_Matrix3x2* scalable_matrix, const float scale)
|
||||
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)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -385,7 +385,7 @@ inline void bgc_fp32_matrix3x2_add_scaled(BGC_FP32_Matrix3x2* sum, const BGC_FP3
|
|||
sum->r2c3 = basic_matrix->r2c3 + scalable_matrix->r2c3 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_add_scaled(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matrix3x2* basic_matrix, const BGC_FP64_Matrix3x2* scalable_matrix, const double scale)
|
||||
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)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -398,7 +398,7 @@ inline void bgc_fp64_matrix3x2_add_scaled(BGC_FP64_Matrix3x2* sum, const BGC_FP6
|
|||
|
||||
// ================== Subtract ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* difference, const BGC_FP32_Matrix3x2* minuend, const BGC_FP32_Matrix3x2* subtrahend)
|
||||
inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* const difference, const BGC_FP32_Matrix3x2* const minuend, const BGC_FP32_Matrix3x2* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -409,7 +409,7 @@ inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* difference, const BG
|
|||
difference->r2c3 = minuend->r2c3 - subtrahend->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* difference, const BGC_FP64_Matrix3x2* minuend, const BGC_FP64_Matrix3x2* subtrahend)
|
||||
inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* const difference, const BGC_FP64_Matrix3x2* const minuend, const BGC_FP64_Matrix3x2* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -422,7 +422,7 @@ inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* difference, const BG
|
|||
|
||||
// ============== Subtract Scaled =============== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_subtract_scaled(BGC_FP32_Matrix3x2* difference, const BGC_FP32_Matrix3x2* basic_matrix, const BGC_FP32_Matrix3x2* scalable_matrix, const float scale)
|
||||
inline void bgc_fp32_matrix3x2_subtract_scaled(BGC_FP32_Matrix3x2* const difference, const BGC_FP32_Matrix3x2* const basic_matrix, const BGC_FP32_Matrix3x2* const scalable_matrix, const float scale)
|
||||
{
|
||||
difference->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
difference->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -433,7 +433,7 @@ inline void bgc_fp32_matrix3x2_subtract_scaled(BGC_FP32_Matrix3x2* difference, c
|
|||
difference->r2c3 = basic_matrix->r2c3 - scalable_matrix->r2c3 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_subtract_scaled(BGC_FP64_Matrix3x2* difference, const BGC_FP64_Matrix3x2* basic_matrix, const BGC_FP64_Matrix3x2* scalable_matrix, const double scale)
|
||||
inline void bgc_fp64_matrix3x2_subtract_scaled(BGC_FP64_Matrix3x2* const difference, const BGC_FP64_Matrix3x2* const basic_matrix, const BGC_FP64_Matrix3x2* const scalable_matrix, const double scale)
|
||||
{
|
||||
difference->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
difference->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -446,7 +446,7 @@ inline void bgc_fp64_matrix3x2_subtract_scaled(BGC_FP64_Matrix3x2* difference, c
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_real(BGC_FP32_Matrix3x2* product, const BGC_FP32_Matrix3x2* multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_real(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const multiplicand, const float multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -457,7 +457,7 @@ inline void bgc_fp32_matrix3x2_multiply_by_real(BGC_FP32_Matrix3x2* product, con
|
|||
product->r2c3 = multiplicand->r2c3 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix3x2* multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -470,13 +470,13 @@ inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* product, con
|
|||
|
||||
// ============ Right Vector Product ============ //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_vector3(BGC_FP32_Vector2* product, const BGC_FP32_Matrix3x2* matrix, const BGC_FP32_Vector3* vector)
|
||||
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;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_vector3(BGC_FP64_Vector2* product, const BGC_FP64_Matrix3x2* matrix, const BGC_FP64_Vector3* vector)
|
||||
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;
|
||||
|
|
@ -484,7 +484,7 @@ inline void bgc_fp64_matrix3x2_multiply_by_vector3(BGC_FP64_Vector2* product, co
|
|||
|
||||
// ========== Matrix Product 3x2 at 2x3 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* product, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix2x3* matrix2)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
|
@ -493,7 +493,7 @@ inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* product
|
|||
product->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* product, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix2x3* matrix2)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
|
@ -504,7 +504,7 @@ inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* product
|
|||
|
||||
// ========== Matrix Product 3x2 at 3x2 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* product, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix3x3* matrix2)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
|
@ -523,7 +523,7 @@ inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* product
|
|||
product->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix3x3* matrix2)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
|
@ -544,7 +544,7 @@ inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* product
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix3x2_divide_by_real(BGC_FP32_Matrix3x2* quotient, const BGC_FP32_Matrix3x2* dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix3x2_divide_by_real(BGC_FP32_Matrix3x2* const quotient, const BGC_FP32_Matrix3x2* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -554,7 +554,7 @@ inline int bgc_fp32_matrix3x2_divide_by_real(BGC_FP32_Matrix3x2* quotient, const
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* quotient, const BGC_FP64_Matrix3x2* dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* const quotient, const BGC_FP64_Matrix3x2* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -566,7 +566,7 @@ inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* quotient, const
|
|||
|
||||
// ================== Average2 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_mean2(BGC_FP32_Matrix3x2* mean, const BGC_FP32_Matrix3x2* term1, const BGC_FP32_Matrix3x2* term2)
|
||||
inline void bgc_fp32_matrix3x2_get_mean2(BGC_FP32_Matrix3x2* const mean, const BGC_FP32_Matrix3x2* const term1, const BGC_FP32_Matrix3x2* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5f;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5f;
|
||||
|
|
@ -577,7 +577,7 @@ inline void bgc_fp32_matrix3x2_get_mean2(BGC_FP32_Matrix3x2* mean, const BGC_FP3
|
|||
mean->r2c3 = (term1->r2c3 + term2->r2c3) * 0.5f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_mean2(BGC_FP64_Matrix3x2* mean, const BGC_FP64_Matrix3x2* term1, const BGC_FP64_Matrix3x2* term2)
|
||||
inline void bgc_fp64_matrix3x2_get_mean2(BGC_FP64_Matrix3x2* const mean, const BGC_FP64_Matrix3x2* const term1, const BGC_FP64_Matrix3x2* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5;
|
||||
|
|
@ -590,7 +590,7 @@ inline void bgc_fp64_matrix3x2_get_mean2(BGC_FP64_Matrix3x2* mean, const BGC_FP6
|
|||
|
||||
// ================== Average3 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_mean3(BGC_FP32_Matrix3x2* mean, const BGC_FP32_Matrix3x2* term1, const BGC_FP32_Matrix3x2* term2, const BGC_FP32_Matrix3x2* term3)
|
||||
inline void bgc_fp32_matrix3x2_get_mean3(BGC_FP32_Matrix3x2* const mean, const BGC_FP32_Matrix3x2* const term1, const BGC_FP32_Matrix3x2* const term2, const BGC_FP32_Matrix3x2* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP32_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP32_ONE_THIRD;
|
||||
|
|
@ -601,7 +601,7 @@ inline void bgc_fp32_matrix3x2_get_mean3(BGC_FP32_Matrix3x2* mean, const BGC_FP3
|
|||
mean->r2c3 = (term1->r2c3 + term2->r2c3 + term3->r2c3) * BGC_FP32_ONE_THIRD;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_mean3(BGC_FP64_Matrix3x2* mean, const BGC_FP64_Matrix3x2* term1, const BGC_FP64_Matrix3x2* term2, const BGC_FP64_Matrix3x2* term3)
|
||||
inline void bgc_fp64_matrix3x2_get_mean3(BGC_FP64_Matrix3x2* const mean, const BGC_FP64_Matrix3x2* const term1, const BGC_FP64_Matrix3x2* const term2, const BGC_FP64_Matrix3x2* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP64_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP64_ONE_THIRD;
|
||||
|
|
@ -614,7 +614,7 @@ inline void bgc_fp64_matrix3x2_get_mean3(BGC_FP64_Matrix3x2* mean, const BGC_FP6
|
|||
|
||||
// ================ Interpolate ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* interpolation, const BGC_FP32_Matrix3x2* first, const BGC_FP32_Matrix3x2* second, const float phase)
|
||||
inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* const interpolation, const BGC_FP32_Matrix3x2* const first, const BGC_FP32_Matrix3x2* const second, const float phase)
|
||||
{
|
||||
const float couter_phase = 1.0f - phase;
|
||||
|
||||
|
|
@ -627,7 +627,7 @@ inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* interpolation, co
|
|||
interpolation->r2c3 = first->r2c3 * couter_phase + second->r2c3 * phase;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_interpolate(BGC_FP64_Matrix3x2* interpolation, const BGC_FP64_Matrix3x2* first, const BGC_FP64_Matrix3x2* second, const double phase)
|
||||
inline void bgc_fp64_matrix3x2_interpolate(BGC_FP64_Matrix3x2* const interpolation, const BGC_FP64_Matrix3x2* const first, const BGC_FP64_Matrix3x2* const second, const double phase)
|
||||
{
|
||||
const double couter_phase = 1.0 - phase;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue