We define routines to handle 3-dimensional vectors.
More...
Go to the source code of this file.
|
| double | t8_vec_norm (const double vec[3]) |
| | Vector norm. More...
|
| |
| double | t8_vec_dist (const double vec_x[3], const double vec_y[3]) |
| | Euclidean distance of X and Y. More...
|
| |
| void | t8_vec_ax (double vec_x[3], const double alpha) |
| | Compute X = alpha * X. More...
|
| |
| void | t8_vec_axy (const double vec_x[3], double vec_y[3], const double alpha) |
| | Compute Y = alpha * X. More...
|
| |
| void | t8_vec_axb (const double vec_x[3], double vec_y[3], const double alpha, const double b) |
| | Y = alpha * X + b. More...
|
| |
| void | t8_vec_axpy (const double vec_x[3], double vec_y[3], const double alpha) |
| | Y = Y + alpha * X. More...
|
| |
| void | t8_vec_axpyz (const double vec_x[3], const double vec_y[3], double vec_z[3], const double alpha) |
| | Z = Y + alpha * X. More...
|
| |
| double | t8_vec_dot (const double vec_x[3], const double vec_y[3]) |
| | Dot product of X and Y. More...
|
| |
| void | t8_vec_cross (const double vec_x[3], const double vec_y[3], double cross[3]) |
| | Cross product of X and Y. More...
|
| |
We define routines to handle 3-dimensional vectors.
◆ t8_vec_ax()
| void t8_vec_ax |
( |
double |
vec_x[3], |
|
|
const double |
alpha |
|
) |
| |
Compute X = alpha * X.
- Parameters
-
| [in,out] | vec_x | A 3D vector. On output set to alpha * vec_x. |
| [in] | alpha | A factor. |
◆ t8_vec_axb()
| void t8_vec_axb |
( |
const double |
vec_x[3], |
|
|
double |
vec_y[3], |
|
|
const double |
alpha, |
|
|
const double |
b |
|
) |
| |
Y = alpha * X + b.
- Parameters
-
| [in] | vec_x | A 3D vector. |
| [out] | vec_y | On input, a 3D vector. On output set to alpha * vec_x + b. |
| [in] | alpha | A factor. |
| [in] | b | An offset. |
- Note
- It is possible that vec_x = vec_y on input to overwrite x
◆ t8_vec_axpy()
| void t8_vec_axpy |
( |
const double |
vec_x[3], |
|
|
double |
vec_y[3], |
|
|
const double |
alpha |
|
) |
| |
Y = Y + alpha * X.
- Parameters
-
| [in] | vec_x | A 3D vector. |
| [in,out] | vec_y | On input, a 3D vector. On output set to vec_y + alpha * vec_x |
| [in] | alpha | A factor. |
◆ t8_vec_axpyz()
| void t8_vec_axpyz |
( |
const double |
vec_x[3], |
|
|
const double |
vec_y[3], |
|
|
double |
vec_z[3], |
|
|
const double |
alpha |
|
) |
| |
Z = Y + alpha * X.
- Parameters
-
| [in] | vec_x | A 3D vector. |
| [in] | vec_y | A 3D vector. |
| [out] | vec_z | On output set to vec_y + alpha * vec_x |
◆ t8_vec_axy()
| void t8_vec_axy |
( |
const double |
vec_x[3], |
|
|
double |
vec_y[3], |
|
|
const double |
alpha |
|
) |
| |
Compute Y = alpha * X.
- Parameters
-
| [in] | vec_x | A 3D vector. |
| [out] | vec_z | On output set to alpha * vec_x. |
| [in] | alpha | A factor. |
◆ t8_vec_cross()
| void t8_vec_cross |
( |
const double |
vec_x[3], |
|
|
const double |
vec_y[3], |
|
|
double |
cross[3] |
|
) |
| |
Cross product of X and Y.
- Parameters
-
| [in] | vec_x | A 3D vector. |
| [in] | vec_y | A 3D vector. |
| [out] | cross | On output, the cross product of vec_x and vec_y. |
◆ t8_vec_dist()
| double t8_vec_dist |
( |
const double |
vec_x[3], |
|
|
const double |
vec_y[3] |
|
) |
| |
Euclidean distance of X and Y.
- Parameters
-
| [in] | vec_x | A 3D vector. |
| [in] | vec_y | A 3D vector. |
- Returns
- The euclidean distance. Equivalent to norm (X-Y).
◆ t8_vec_dot()
| double t8_vec_dot |
( |
const double |
vec_x[3], |
|
|
const double |
vec_y[3] |
|
) |
| |
Dot product of X and Y.
- Parameters
-
| [in] | vec_x | A 3D vector. |
| [in] | vec_y | A 3D vector. |
- Returns
- The dot product vec_x * vec_y
◆ t8_vec_norm()
| double t8_vec_norm |
( |
const double |
vec[3] | ) |
|
Vector norm.
- Parameters
-
- Returns
- The norm of vec.