t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Functions
t8_vec.h File Reference

We define routines to handle 3-dimensional vectors. More...

#include <t8.h>

Go to the source code of this file.

Functions

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...
 

Detailed Description

We define routines to handle 3-dimensional vectors.

Function Documentation

◆ t8_vec_ax()

void t8_vec_ax ( double  vec_x[3],
const double  alpha 
)

Compute X = alpha * X.

Parameters
[in,out]vec_xA 3D vector. On output set to alpha * vec_x.
[in]alphaA 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_xA 3D vector.
[out]vec_yOn input, a 3D vector. On output set to alpha * vec_x + b.
[in]alphaA factor.
[in]bAn 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_xA 3D vector.
[in,out]vec_yOn input, a 3D vector. On output set to vec_y + alpha * vec_x
[in]alphaA 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_xA 3D vector.
[in]vec_yA 3D vector.
[out]vec_zOn 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_xA 3D vector.
[out]vec_zOn output set to alpha * vec_x.
[in]alphaA 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_xA 3D vector.
[in]vec_yA 3D vector.
[out]crossOn 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_xA 3D vector.
[in]vec_yA 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_xA 3D vector.
[in]vec_yA 3D vector.
Returns
The dot product vec_x * vec_y

◆ t8_vec_norm()

double t8_vec_norm ( const double  vec[3])

Vector norm.

Parameters
[in]vecA 3D vector.
Returns
The norm of vec.