Robotran C Documentation
Functions
norm.c File Reference
#include <math.h>
#include "mbs_1D_array.h"

Functions

double norm_vector (double *v, int n)
 
double norminf_vector (double *v, int n)
 
double norm (double v[4])
 DEPRECATED: See norm_dvec_1(). More...
 
void normalize (double v[4], double vn[4])
 DEPRECATED: See normalize_dvec_1() More...
 
double norminf_vector_1 (double *v, int n)
 Compute the maximum of a vector. More...
 
double norm_dvec_0 (double *vec, int l_v)
 compute the norm of a [l_v sized] vector of doubles, starting with index 0 More...
 
double norm_dvec_1 (double *vec, int l_v)
 compute the norm of a [l_v sized] vector of doubles, starting with index 1 More...
 
void normalize_dvec_0 (double *vec, double *vn, int l_v)
 Compute the normalize vector with starting with index 0. More...
 
void normalize_dvec_1 (double *vec, double *vn, int l_v)
 Compute the normalize vector with first index is 1. More...
 

Function Documentation

◆ norm()

double norm ( double  v[4])

DEPRECATED: See norm_dvec_1().

Compute the Euclidean norm of a double vector with first index is 1. The vector has unused index 0. See get_dvec_1() to such vector creation.

Parameters
[in]vvector of size 4 with first element unused.
Returns
The norm of the vector v.

◆ norm_dvec_0()

double norm_dvec_0 ( double *  vec,
int  l_v 
)

compute the norm of a [l_v sized] vector of doubles, starting with index 0

Parameters
[in]vecthe vector of doubles
[in]l_vthe size of the vector
Returns
the norm of the vector: $ \sqrt { \sum {(vec_{i}^{2})}} $

◆ norm_dvec_1()

double norm_dvec_1 ( double *  vec,
int  l_v 
)

compute the norm of a [l_v sized] vector of doubles, starting with index 1

Parameters
[in]vecthe vector of doubles
[in]l_vthe size of the vector (0 element not taken into account)
Returns
the norm of the vector: $ \sqrt { \sum_{i=1}^{i=x} {(vec_{i}^{2})}} $

◆ norm_vector()

double norm_vector ( double *  v,
int  n 
)

◆ normalize()

void normalize ( double  v[4],
double  vn[4] 
)

DEPRECATED: See normalize_dvec_1()

Compute the normalize vector with first index is 1. The vector has unused index 0. See get_dvec_1() to such vector creation.
WARNING: if norm(v) is 0, a division by 0 will occurs.

Parameters
[in]vvector of size 4 with first element unused.
[in,out]vnthe normalized vector v, index starting at 1.

◆ normalize_dvec_0()

void normalize_dvec_0 ( double *  vec,
double *  vn,
int  l_v 
)

Compute the normalize vector with starting with index 0.

WARNING: if the norm of vec is 0, a division by 0 will occurs.

Parameters
[in]vecvector of double to be normalized.
[in,out]vnthe normalized vector vec.
[in]l_vthe size of the vector.

◆ normalize_dvec_1()

void normalize_dvec_1 ( double *  vec,
double *  vn,
int  l_v 
)

Compute the normalize vector with first index is 1.

The vector has unused index 0. See get_dvec_1() to such vector creation.
WARNING: if norm(v) is 0, a division by 0 will occurs.

Parameters
[in]vecvector of double to be normalized with first element unused.
[in,out]vnthe normalized vector vec, with first element unused.
[in]l_vthe size of the vector (0 element not taken into account)

◆ norminf_vector()

double norminf_vector ( double *  v,
int  n 
)

◆ norminf_vector_1()

double norminf_vector_1 ( double *  v,
int  n 
)

Compute the maximum of a vector.

Parameters
[in]vA vector of floats, starting with index 1.
[in]sizeThe number of elements in the array.
Returns
The norm of the array.