Functions
Vector Mathematics
Linear Algebra
Collaboration diagram for Vector Mathematics:

Functions

void vector_add (u32 n, const double *a, const double *b, double *c)
void vector_add_sc (u32 n, const double *a, const double *b, double gamma, double *c)
void vector_cross (const double a[3], const double b[3], double c[3])
double vector_dot (u32 n, const double *a, const double *b)
double vector_mean (u32 n, const double *a)
double vector_norm (u32 n, const double *a)
void vector_normalize (u32 n, double *a)
void vector_subtract (u32 n, const double *a, const double *b, double *c)

Detailed Description

Vector math routines.


Function Documentation

void vector_add ( u32  n,
const double *  a,
const double *  b,
double *  c 
)

Add two vectors. Compute $ \vec{c} := \vec{a} + \vec{b} $, where $\vec{a}$, $\vec{b}$ and $\vec{c}$ are vectors of length $n$.

Parameters:
nLength of a, b and c
aFirst input vector
bSecond input vector
cOutput vector

Definition at line 1064 of file linear_algebra.c.

void vector_add_sc ( u32  n,
const double *  a,
const double *  b,
double  gamma,
double *  c 
)

Add a vector with a scaled vector. Compute $ \vec{c} := \vec{a} + \gamma\vec{b} $, where $\vec{a}$, $\vec{b}$ and $\vec{c}$ are vectors of length $n$ and $\gamma$ is a scalar.

Parameters:
nLength of a, b and c
aFirst input vector (unscaled)
bSecond input vector (will be scaled)
gammaCoefficient for b
cOutput vector

Definition at line 1047 of file linear_algebra.c.

void vector_cross ( const double  a[3],
const double  b[3],
double  c[3] 
)

Cross product of two vectors. Compute $ \vec{c} := \vec{a} * \times \vec{b} $, where $\vec{a}$, $\vec{b}$ and * $\vec{c}$ are 3-vectors.

Parameters:
nLength of a, b and c
aFirst input vector
bSecond input vector
cOutput vector

Definition at line 1092 of file linear_algebra.c.

double vector_dot ( u32  n,
const double *  a,
const double *  b 
)

Dot product between two vectors. Compute the inner (scalar) (dot) product $ \vec{a} \cdot \vec{b} $, where $\vec{a}$ and $\vec{b}$ are vectors of length $n$.

Parameters:
nLength of a and b
aFirst vector
bSecond vector
Returns:
The dot product.

Definition at line 980 of file linear_algebra.c.

double vector_mean ( u32  n,
const double *  a 
)

Find the mean of a vector. Compute the mean of a vector $\vec{a}$ of length $n$.

Parameters:
nLength of a
aInput vector
Returns:
The mean of $\vec{a}$

Definition at line 1014 of file linear_algebra.c.

double vector_norm ( u32  n,
const double *  a 
)

Find the 2-norm of a vector. Compute the $l_{2}$ norm of a vector $\vec{a}$ of length $n$.

Parameters:
nLength of a
aInput vector
Returns:
The 2-norm of a

Definition at line 998 of file linear_algebra.c.

void vector_normalize ( u32  n,
double *  a 
)

Normalize a vector in place. Rescale $\vec{a}$ of length $n$ so that its $ l_{2} $ norm is equal to 1.

Parameters:
nLength of a
aVector to normalize

Definition at line 1029 of file linear_algebra.c.

void vector_subtract ( u32  n,
const double *  a,
const double *  b,
double *  c 
)

Subtract one vector from another. Compute $ \vec{c} := \vec{a} - \vec{b} $, where $\vec{a}$, $\vec{b}$ and $\vec{c}$ are vectors of length $n$.

Parameters:
nLength of a, b and c
aFirst input vector
bSecond input vector
cOutput vector

Definition at line 1078 of file linear_algebra.c.



swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:57:01