![]() |
programmer's documentation
|
Go to the source code of this file.
Functions | |
static cs_real_t | cs_math_sq (cs_real_t x) |
Compute the square of a real value. More... | |
static cs_real_t | cs_math_3_length (const cs_real_t xa[3], const cs_real_t xb[3]) |
Compute the (euclidean) length between two points xa and xb in a cartesian coordinate system of dimension 3. More... | |
static cs_real_t | cs_math_3_distance_squared (const cs_real_t xa[3], const cs_real_t xb[3]) |
Compute the squared distance between two points xa and xb in a cartesian coordinate system of dimension 3. More... | |
static cs_real_t | cs_math_3_dot_product (const cs_real_t u[3], const cs_real_t v[3]) |
Compute the dot product of two vectors of 3 real values. More... | |
static cs_real_t | cs_math_3_norm (const cs_real_t v[3]) |
Compute the euclidean norm of a vector of dimension 3. More... | |
static cs_real_t | cs_math_3_square_norm (const cs_real_t v[3]) |
Compute the square norm of a vector of 3 real values. More... | |
static void | cs_math_33_3_product (const cs_real_t m[3][3], const cs_real_t v[3], cs_real_3_t mv) |
Compute the product of a matrix of 3x3 real values by a vector of 3 real values. More... | |
static void | cs_math_33t_3_product (const cs_real_t m[3][3], const cs_real_t v[3], cs_real_3_t mv) |
Compute the product of the transpose of a matrix of 3x3 real values by a vector of 3 real values. More... | |
static void | cs_math_sym_33_3_product (const cs_real_t m[6], const cs_real_t v[3], cs_real_t mv[restrict 3]) |
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values. NB: Symmetric matrix are stored as follows (s11, s22, s33, s12, s23, s13) More... | |
static void | cs_math_sym_33_3_product_add (const cs_real_t m[6], const cs_real_t v[3], cs_real_t mv[restrict 3]) |
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values and add it to the vector. NB: Symmetric matrix are stored as follows (s11, s22, s33, s12, s23, s13) More... | |
static void | cs_math_66_6_product (const cs_real_t m[6][6], const cs_real_t v[6], cs_real_t mv[restrict 6]) |
Compute the product of a matrix of 6x6 real values by a vector of 6 real values. More... | |
static void | cs_math_66_6_product_add (const cs_real_t m[6][6], const cs_real_t v[6], cs_real_t mv[restrict 6]) |
Compute the product of a matrix of 6x6 real values by a vector of 6 real values and add it to the vector. More... | |
static cs_real_t | cs_math_33_determinant (const cs_real_t m[3][3]) |
Compute the determinant of a 3x3 matrix. More... | |
static cs_real_t | cs_math_sym_33_determinant (const cs_real_6_t m) |
Compute the determinant of a 3x3 symmetric matrix. More... | |
static void | cs_math_3_cross_product (const cs_real_t u[3], const cs_real_t v[3], cs_real_t uv[restrict 3]) |
Compute the cross product of two vectors of 3 real values. More... | |
static void | cs_math_33_inv (const cs_real_t in[3][3], cs_real_t out[3][3]) |
Inverse a 3x3 matrix. More... | |
static void | cs_math_sym_33_inv_cramer (const cs_real_t s[6], cs_real_t sout[restrict 6]) |
Compute the inverse of a symmetric matrix using Cramer's rule. More... | |
static void | cs_math_sym_33_product (const cs_real_t s1[6], const cs_real_t s2[6], cs_real_t sout[restrict 6]) |
Compute the product of two symmetric matrices. Warning: this is valid if and only if s1 and s2 commute (otherwise sout is not symmetric). More... | |
static void | cs_math_reduce_sym_prod_33_to_66 (const cs_real_t s[3][3], cs_real_t sout[restrict 6][6]) |
Compute a 6x6 matrix A, equivalent to a 3x3 matrix s, such as: A*R_6 = R*s^t + s*R. More... | |
static void | cs_math_sym_33_double_product (const cs_real_t s1[6], const cs_real_t s2[6], const cs_real_t s3[6], cs_real_t sout[restrict 3][3]) |
Compute the product of three symmetric matrices. More... | |
void | cs_math_set_machine_epsilon (void) |
Compute the value related to the machine precision. More... | |
double | cs_math_get_machine_epsilon (void) |
Get the value related to the machine precision. More... | |
void | cs_math_3_length_unitv (const cs_real_t xa[3], const cs_real_t xb[3], cs_real_t *len, cs_real_3_t unitv) |
Compute the length (euclidien norm) between two points xa and xb in a cartesian coordinate system of dimension 3. More... | |
void | cs_math_33_eigen_vals (const cs_real_t m[3][3], cs_real_t eig_vals[3]) |
Compute all eigenvalues of a 3x3 symmetric matrix. More... | |
void | cs_math_33_eigen (const cs_real_t m[3][3], cs_real_t *eig_ratio, cs_real_t *eig_max) |
Compute max/min eigenvalues ratio and max. eigenvalue of a 3x3 symmetric matrix. More... | |
double | cs_math_surftri (const cs_real_t xv[3], const cs_real_t xe[3], const cs_real_t xf[3]) |
Compute the area of the convex_hull generated by 3 points. This corresponds to the computation of the surface of a triangle. More... | |
double | cs_math_voltet (const cs_real_t xv[3], const cs_real_t xe[3], const cs_real_t xf[3], const cs_real_t xc[3]) |
Compute the volume of the convex_hull generated by 4 points. This is equivalent to the computation of the volume of a tetrahedron. More... | |
void | cs_math_fact_lu (cs_lnum_t n_blocks, const int db_size, const cs_real_t *ad, cs_real_t *ad_inv) |
Compute inverses of dense matrices. More... | |
void | cs_math_fw_and_bw_lu (const cs_real_t mat[], const int db_size, cs_real_t x[], const cs_real_t b[], const cs_real_t c[]) |
Block Jacobi utilities. Compute forward and backward to solve an LU P*P system. More... | |
Variables | |
const cs_real_t | cs_math_zero_threshold |
const cs_real_t | cs_math_onethird |
const cs_real_t | cs_math_onesix |
const cs_real_t | cs_math_onetwelve |
const cs_real_t | cs_math_epzero |
const cs_real_t | cs_math_infinite_r |
const cs_real_t | cs_math_big_r |
const cs_real_t | cs_math_pi |
|
inlinestatic |
Compute the product of a matrix of 3x3 real values by a vector of 3 real values.
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[out] | mv | vector of 3 real values |
Compute the determinant of a 3x3 matrix.
[in] | m | 3x3 matrix |
Compute max/min eigenvalues ratio and max. eigenvalue of a 3x3 symmetric matrix.
Based on: Oliver K. Smith "eigenvalues of a symmetric 3x3 matrix", Communication of the ACM (April 1961) (Wikipedia article entitled "Eigenvalue algorithm")
[in] | m | 3x3 matrix |
[out] | eig_ratio | max/min |
[out] | eig_max | max. eigenvalue |
Compute all eigenvalues of a 3x3 symmetric matrix.
Based on: Oliver K. Smith "eigenvalues of a symmetric 3x3 matrix", Communication of the ACM (April 1961) (Wikipedia article entitled "Eigenvalue algorithm")
[in] | m | 3x3 matrix |
[out] | eig_vals | size 3 vector |
Inverse a 3x3 matrix.
[in] | in | matrix to inverse |
[out] | out | inversed matrix |
|
inlinestatic |
Compute the product of the transpose of a matrix of 3x3 real values by a vector of 3 real values.
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[out] | mv | vector of 3 real values |
|
inlinestatic |
Compute the cross product of two vectors of 3 real values.
[in] | u | vector of 3 real values |
[in] | v | vector of 3 real values |
[out] | uv | vector of 3 real values |
|
inlinestatic |
Compute the squared distance between two points xa and xb in a cartesian coordinate system of dimension 3.
[in] | xa | first coordinate |
[in] | xb | second coordinate |
Compute the dot product of two vectors of 3 real values.
[in] | u | vector of 3 real values |
[in] | v | vector of 3 real values |
Compute the (euclidean) length between two points xa and xb in a cartesian coordinate system of dimension 3.
[in] | xa | first coordinate |
[in] | xb | second coordinate |
|
inline |
Compute the length (euclidien norm) between two points xa and xb in a cartesian coordinate system of dimension 3.
[in] | xa | coordinate of the first extremity |
[in] | xb | coordinate of the second extremity |
[out] | len | pointer to the length of the vector va -> vb |
[out] | unitv | unitary vector along xa -> xb |
[in] | xa | coordinate of the first extremity |
[in] | xb | coordinate of the second extremity |
[out] | len | pointer to the length of the vector va -> vb |
[out] | unitv | unitary vector anlong va -> vb |
Compute the euclidean norm of a vector of dimension 3.
[in] | v |
Compute the square norm of a vector of 3 real values.
[in] | v | vector of 3 real values |
|
inlinestatic |
Compute the product of a matrix of 6x6 real values by a vector of 6 real values.
[in] | m | matrix of 6x6 real values |
[in] | v | vector of 6 real values |
[out] | mv | vector of 6 real values |
|
inlinestatic |
Compute the product of a matrix of 6x6 real values by a vector of 6 real values and add it to the vector.
[in] | m | matrix of 6x6 real values |
[in] | v | vector of 6 real values |
[out] | mv | vector of 6 real values |
Compute inverses of dense matrices.
[in] | n_blocks | number of blocks |
[in] | db_size | matrix size |
[in] | ad | diagonal part of linear equation matrix |
[out] | ad_inv | inverse of the diagonal part of linear equation matrix |
void cs_math_fw_and_bw_lu | ( | const cs_real_t | mat[], |
int | db_size, | ||
cs_real_t | x[], | ||
const cs_real_t | b[], | ||
const cs_real_t | c[] | ||
) |
Block Jacobi utilities. Compute forward and backward to solve an LU P*P system.
[in] | mat | P*P*dim matrix |
[in] | db_size | matrix size |
[out] | x | solution |
[out] | b | 1st part of RHS (c - b) |
[out] | c | 2nd part of RHS (c - b) |
double cs_math_get_machine_epsilon | ( | void | ) |
Get the value related to the machine precision.
|
inlinestatic |
Compute a 6x6 matrix A, equivalent to a 3x3 matrix s, such as: A*R_6 = R*s^t + s*R.
[in] | s | 3x3 matrix |
[out] | sout | 6x6 matrix |
void cs_math_set_machine_epsilon | ( | void | ) |
Compute the value related to the machine precision.
Compute the square of a real value.
[in] | x | value |
|
inline |
Compute the area of the convex_hull generated by 3 points. This corresponds to the computation of the surface of a triangle.
[in] | xv | coordinates of the first vertex |
[in] | xe | coordinates of the second vertex |
[in] | xf | coordinates of the third vertex |
|
inlinestatic |
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values. NB: Symmetric matrix are stored as follows (s11, s22, s33, s12, s23, s13)
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[out] | mv | vector of 3 real values |
|
inlinestatic |
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values and add it to the vector. NB: Symmetric matrix are stored as follows (s11, s22, s33, s12, s23, s13)
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[out] | mv | vector of 3 real values |
|
inlinestatic |
Compute the determinant of a 3x3 symmetric matrix.
[in] | m | 3x3 symmetric matrix |
|
inlinestatic |
Compute the product of three symmetric matrices.
[in] | s1 | symmetric matrix |
[in] | s2 | symmetric matrix |
[in] | s3 | symmetric matrix |
[out] | sout | sout = s1 * s2 * s3 |
|
inlinestatic |
Compute the inverse of a symmetric matrix using Cramer's rule.
[in] | s | symmetric matrix |
[out] | sout | sout = 1/s1 |
|
inlinestatic |
Compute the product of two symmetric matrices. Warning: this is valid if and only if s1 and s2 commute (otherwise sout is not symmetric).
[in] | s1 | symmetric matrix |
[in] | s2 | symmetric matrix |
[out] | sout | sout = s1 * s2 |
double cs_math_voltet | ( | const cs_real_t | xv[3], |
const cs_real_t | xe[3], | ||
const cs_real_t | xf[3], | ||
const cs_real_t | xc[3] | ||
) |
Compute the volume of the convex_hull generated by 4 points. This is equivalent to the computation of the volume of a tetrahedron.
[in] | xv | coordinates of the first vertex |
[in] | xe | coordinates of the second vertex |
[in] | xf | coordinates of the third vertex |
[in] | xc | coordinates of the fourth vertex |
const cs_real_t cs_math_big_r |
const cs_real_t cs_math_epzero |
const cs_real_t cs_math_infinite_r |
const cs_real_t cs_math_onesix |
const cs_real_t cs_math_onethird |
const cs_real_t cs_math_onetwelve |
const cs_real_t cs_math_pi |
const cs_real_t cs_math_zero_threshold |