amino
Lightweight Robot Utility Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
/home/ntd/git/amino/la_doc.c File Reference

Go to the source code of this file.

Functions

AA_API void aa_la_d_transpose (size_t m, size_t n, const double *A, size_t lda, double *B, size_t ldb)
 type for operations More...
 
AA_API double aa_la_d_ssd (size_t n, const double *x, size_t incx, const double *y, size_t incy)
 Sum-square differences of x and y. More...
 
AA_API void aa_la_d_lerp (size_t n, double u, const double *v1, size_t inc1, const double *v2, size_t inc2, double *vu, size_t incu)
 Linear interpolation of vectors. More...
 
AA_API void aa_la_d_3spline_param (size_t n, double tf, const double *x1, size_t incx1, const double *dx1, size_t incdx1, const double *x2, size_t inc2, const double *dx2, size_t incdx2, double *a2, double *a3)
 Compute cubic spline parameters.
 
AA_API void aa_la_d_3spline (size_t n, double tf, const double *x1, size_t incx1, const double *dx1, size_t incdx1, const double *a2, const double *a3, double *x, size_t incx, double *dx, size_t incdx, double *ddx, size_t incddx)
 Compute cubic spline value.
 
AA_API void aa_la_d_5spline_param (size_t n, double tf, const double *x1, size_t incx1, const double *dx1, size_t incdx1, const double *ddx1, size_t incddx1, const double *x2, size_t inc2, const double *dx2, size_t incdx2, const double *ddx2, size_t incddx2, double *a3, double *a4, double *a5)
 Compute quintic spline parameters.
 
AA_API void aa_la_d_5spline (size_t n, double tf, const double *x1, size_t incx1, const double *dx1, size_t incdx1, const double *ddx1, size_t incddx1, const double *a3, const double *a4, const double *a5, double *x, size_t incx, double *dx, size_t incdx, double *ddx, size_t incddx)
 Compute quintic spline value.
 
AA_API double aa_la_d_vecstd (size_t n, const double *x, size_t incx, double mu)
 Standard deviation of vector. More...
 
AA_API void aa_la_d_colmean (size_t m, size_t n, const double *A, size_t lda, double *x)
 Mean of columns of A. More...
 
AA_API void aa_la_d_rowmean (size_t m, size_t n, const double *A, size_t lda, double *x)
 Mean of rows of A. More...
 
AA_API void aa_la_d_colcov (size_t m, size_t n, const double *A, size_t lda, const double *x, double *E, size_t lde)
 Covariance of columns of A. More...
 
AA_API void aa_la_d_assign_hungarian (size_t m, size_t n, const double *A, size_t lda, ssize_t *row_assign, ssize_t *col_assign)
 Hungarian algorithm to solve min assignment problem. More...
 
AA_API void aa_la_d_assign_hungarian_max2min (size_t m, size_t n, double *A, size_t lda)
 Converts max assignment to min assignment for Hungarian algorithm. More...
 
static size_t aa_la_d_minloc (size_t n, double *x, size_t incx)
 Minimum location of vector x.
 
static double aa_la_d_mat_max (size_t m, size_t n, double *A, size_t lda, size_t *pi, size_t *pj)
 Minimum location of vector x.
 
static size_t aa_la_d_maxloc (size_t n, double *x, size_t incx)
 Maximum location of vector x.
 
AA_API double aa_la_d_angle (size_t n, const double *x, size_t incx, const double *y, size_t incy)
 Angle between vectors. More...
 
AA_API int aa_la_d_lls (size_t m, size_t n, size_t p, const double *A, size_t lda, const double *b, size_t ldb, double *x, size_t ldx)
 Linear Least Squares. More...
 
AA_API int aa_la_d_svd (size_t m, size_t n, const double *A, size_t lda, double *U, size_t ldu, double *S, double *Vt, size_t ldvt)
 Singular Value Decomposition of A. More...
 
AA_API double aa_la_d_median (size_t n, const double *x, size_t incx)
 Cmpute median. More...
 
AA_API double aa_la_d_nmedian (size_t n, double *x)
 Destructive median computation. More...
 
static double aa_la_d_nmedian_pop (size_t n, double *x)
 Compute median and pop array from local memory region.
 
double aa_la_d_mad (size_t n, const double u, const double *x, size_t incx)
 Median Absolute Deviation. More...
 
double aa_la_d_mad2 (size_t m, size_t n, const double *u, const double *A, size_t lda)
 Median Absolute Deviation with Euclidean distance. More...
 
AA_API int aa_la_d_eev (size_t n, const double *A, size_t lda, double *wr, double *wi, double *Vl, size_t ldvl, double *Vr, size_t ldvr)
 Compute eigen values and vectors.
 
AA_API void aa_la_d_colfit (size_t m, size_t n, const double *A, size_t lda, double *x)
 Fit a least-squares hyperplane to columns of A. More...
 
int aa_la_d_compar (const void *a, const void *b)
 
int aa_la_d_ls_duqu_cmat (const double *sigma, const double *theta, double *cm)
 Create a companion matrix for the lambda polynomial in se3 least-squares. More...
 
AA_API void aa_la_s_transpose (size_t m, size_t n, const float *A, size_t lda, float *B, size_t ldb)
 type for operations More...
 
AA_API float aa_la_s_ssd (size_t n, const float *x, size_t incx, const float *y, size_t incy)
 Sum-square differences of x and y. More...
 
AA_API void aa_la_s_lerp (size_t n, float u, const float *v1, size_t inc1, const float *v2, size_t inc2, float *vu, size_t incu)
 Linear interpolation of vectors. More...
 
AA_API void aa_la_s_3spline_param (size_t n, float tf, const float *x1, size_t incx1, const float *dx1, size_t incdx1, const float *x2, size_t inc2, const float *dx2, size_t incdx2, float *a2, float *a3)
 Compute cubic spline parameters.
 
AA_API void aa_la_s_3spline (size_t n, float tf, const float *x1, size_t incx1, const float *dx1, size_t incdx1, const float *a2, const float *a3, float *x, size_t incx, float *dx, size_t incdx, float *ddx, size_t incddx)
 Compute cubic spline value.
 
AA_API void aa_la_s_5spline_param (size_t n, float tf, const float *x1, size_t incx1, const float *dx1, size_t incdx1, const float *ddx1, size_t incddx1, const float *x2, size_t inc2, const float *dx2, size_t incdx2, const float *ddx2, size_t incddx2, float *a3, float *a4, float *a5)
 Compute quintic spline parameters.
 
AA_API void aa_la_s_5spline (size_t n, float tf, const float *x1, size_t incx1, const float *dx1, size_t incdx1, const float *ddx1, size_t incddx1, const float *a3, const float *a4, const float *a5, float *x, size_t incx, float *dx, size_t incdx, float *ddx, size_t incddx)
 Compute quintic spline value.
 
AA_API float aa_la_s_vecstd (size_t n, const float *x, size_t incx, float mu)
 Standard deviation of vector. More...
 
AA_API void aa_la_s_colmean (size_t m, size_t n, const float *A, size_t lda, float *x)
 Mean of columns of A. More...
 
AA_API void aa_la_s_rowmean (size_t m, size_t n, const float *A, size_t lda, float *x)
 Mean of rows of A. More...
 
AA_API void aa_la_s_colcov (size_t m, size_t n, const float *A, size_t lda, const float *x, float *E, size_t lde)
 Covariance of columns of A. More...
 
AA_API void aa_la_s_assign_hungarian (size_t m, size_t n, const float *A, size_t lda, ssize_t *row_assign, ssize_t *col_assign)
 Hungarian algorithm to solve min assignment problem. More...
 
AA_API void aa_la_s_assign_hungarian_max2min (size_t m, size_t n, float *A, size_t lda)
 Converts max assignment to min assignment for Hungarian algorithm. More...
 
static size_t aa_la_s_minloc (size_t n, float *x, size_t incx)
 Minimum location of vector x.
 
static float aa_la_s_mat_max (size_t m, size_t n, float *A, size_t lda, size_t *pi, size_t *pj)
 Minimum location of vector x.
 
static size_t aa_la_s_maxloc (size_t n, float *x, size_t incx)
 Maximum location of vector x.
 
AA_API float aa_la_s_angle (size_t n, const float *x, size_t incx, const float *y, size_t incy)
 Angle between vectors. More...
 
AA_API int aa_la_s_lls (size_t m, size_t n, size_t p, const float *A, size_t lda, const float *b, size_t ldb, float *x, size_t ldx)
 Linear Least Squares. More...
 
AA_API int aa_la_s_svd (size_t m, size_t n, const float *A, size_t lda, float *U, size_t ldu, float *S, float *Vt, size_t ldvt)
 Singular Value Decomposition of A. More...
 
AA_API float aa_la_s_median (size_t n, const float *x, size_t incx)
 Cmpute median. More...
 
AA_API float aa_la_s_nmedian (size_t n, float *x)
 Destructive median computation. More...
 
static float aa_la_s_nmedian_pop (size_t n, float *x)
 Compute median and pop array from local memory region.
 
float aa_la_s_mad (size_t n, const float u, const float *x, size_t incx)
 Median Absolute Deviation. More...
 
float aa_la_s_mad2 (size_t m, size_t n, const float *u, const float *A, size_t lda)
 Median Absolute Deviation with Euclidean distance. More...
 
AA_API int aa_la_s_eev (size_t n, const float *A, size_t lda, float *wr, float *wi, float *Vl, size_t ldvl, float *Vr, size_t ldvr)
 Compute eigen values and vectors.
 
AA_API void aa_la_s_colfit (size_t m, size_t n, const float *A, size_t lda, float *x)
 Fit a least-squares hyperplane to columns of A. More...
 
int aa_la_s_compar (const void *a, const void *b)
 
int aa_la_s_ls_duqu_cmat (const double *sigma, const double *theta, double *cm)
 Create a companion matrix for the lambda polynomial in se3 least-squares. More...
 

Function Documentation

AA_API double aa_la_d_angle ( size_t  n,
const double *  x,
size_t  incx,
const double *  y,
size_t  incy 
)

Angle between vectors.

Parameters
nlength of vectors
xfirst vector
incxstepsize of x
ysecond vector
incystepsize of y
See also
aa_la_d_angle
AA_API void aa_la_d_assign_hungarian ( size_t  m,
size_t  n,
const double *  A,
size_t  lda,
ssize_t *  row_assign,
ssize_t *  col_assign 
)

Hungarian algorithm to solve min assignment problem.

Parameters
mrows of A
ncols of A
[in]Acost matrix, column major, destroyed on exit
ldaleading dimension of A
[out]row_assignarray of column assigned to row at index i, length m. Unmatched elements have the value of -1.
[out]col_assignmapping from col to matched row
AA_API void aa_la_d_assign_hungarian_max2min ( size_t  m,
size_t  n,
double *  A,
size_t  lda 
)

Converts max assignment to min assignment for Hungarian algorithm.

Parameters
mrows of A
ncols of A
Acost matrix for max problem, converted to matrix for min proble on exit
ldaleading dimension of A
AA_API void aa_la_d_colcov ( size_t  m,
size_t  n,
const double *  A,
size_t  lda,
const double *  x,
double *  E,
size_t  lde 
)

Covariance of columns of A.

Parameters
mrows of A
ncols of A
ldaleading dimension of A
[in]Asource matrix, m*n
[in]xmean of columns of A, length m
[out]Ecovariance of columns of A, m*m
ldeleading dimension of E
See also
aa_la_d_colcov
AA_API void aa_la_d_colfit ( size_t  m,
size_t  n,
const double *  A,
size_t  lda,
double *  x 
)

Fit a least-squares hyperplane to columns of A.

Normalizes data first.

Parameters
mrows of A, size of space
ncols of A, number of points
Adata points
ldaleading dimension of A
xoutput hyperplance in hessian normal form
See also
aa_la_d_colfit
AA_API void aa_la_d_colmean ( size_t  m,
size_t  n,
const double *  A,
size_t  lda,
double *  x 
)

Mean of columns of A.

Parameters
mrows of A
ncols of A
ldaleading dimension of A
[in]Asource matrix, m*n
[out]xdestination vector for mean, length m
See also
aa_la_d_colmean
AA_API void aa_la_d_lerp ( size_t  n,
double  u,
const double *  v1,
size_t  inc1,
const double *  v2,
size_t  inc2,
double *  vu,
size_t  incu 
)

Linear interpolation of vectors.

Parameters
nlength of vectors
uinterpolation parameter, at 0, vu=v1, and at 1, vu=v2
v1initial vector
v2final vector
inc1stepsize of v1
inc2stepsize of v2
incustepsize of vu
AA_API int aa_la_d_lls ( size_t  m,
size_t  n,
size_t  p,
const double *  A,
size_t  lda,
const double *  b,
size_t  ldb,
double *  x,
size_t  ldx 
)

Linear Least Squares.

\[ b = Ax \]

Solves for x.

Parameters
mrows in A
ncols in A
pcols in b and x
Amatrix
ldaleading dimension of A
boffset matrix
ldbleading dimension of b
xsolution matrix
ldxleading dimension of x
int aa_la_d_ls_duqu_cmat ( const double *  sigma,
const double *  theta,
double *  cm 
)

Create a companion matrix for the lambda polynomial in se3 least-squares.

Parameters
sigmaSingular values of A, in vector form.
thetaValues of U^T b.
cmThe output companion matrix.
double aa_la_d_mad ( size_t  n,
const double  u,
const double *  x,
size_t  incx 
)

Median Absolute Deviation.

Parameters
nnumber of elements
umedian
xdata array
incxincrement of x
double aa_la_d_mad2 ( size_t  m,
size_t  n,
const double *  u,
const double *  A,
size_t  lda 
)

Median Absolute Deviation with Euclidean distance.

Parameters
mrows of A, length of u
ncols of A
umedian (increment of 1)
Adata matrix
ldaleading dimension of A
AA_API double aa_la_d_median ( size_t  n,
const double *  x,
size_t  incx 
)

Cmpute median.

Parameters
nnumber of elements in x
xdata array
incxincrement amount for x
AA_API double aa_la_d_nmedian ( size_t  n,
double *  x 
)

Destructive median computation.

Parameters
nnumber of elements in x
xdata array
incxincrement amount for x
Postcondition
entries of x are undefined
AA_API void aa_la_d_rowmean ( size_t  m,
size_t  n,
const double *  A,
size_t  lda,
double *  x 
)

Mean of rows of A.

Parameters
mrows of A
ncols of A
ldaleading dimension of A
[in]Asource matrix, m*n
[out]xdestination vector for mean, length n
See also
aa_la_d_rowmean
AA_API double aa_la_d_ssd ( size_t  n,
const double *  x,
size_t  incx,
const double *  y,
size_t  incy 
)

Sum-square differences of x and y.

Parameters
nlength of vectors
xfirst vector
ysecond vector
incxstepsize of x
incystepsize of y
See also
aa_la_d_ssd
AA_API int aa_la_d_svd ( size_t  m,
size_t  n,
const double *  A,
size_t  lda,
double *  U,
size_t  ldu,
double *  S,
double *  Vt,
size_t  ldvt 
)

Singular Value Decomposition of A.

\[ A = U \Sigma V^T \]

Parameters
mrows
ncolumns
A\(A \in \Re^m \times \Re^n\), column major
ldaleading dimension of A
U\(U \in \Re^m \times \Re^m\), column major. If null or ldu==0, U is returned in A. U and Vt cannot both be null.
lduleading dimension of U
S\(S \in \Re^m min(m,n)\), singular values
Vt\(V^T \in \Re^n \times \Re^n\), singular vectors. If null or ldvt==0, Vt is returned in A. Vt and U cannot both be null.
ldvtleading dimension of Vt
AA_API void aa_la_d_transpose ( size_t  m,
size_t  n,
const double *  A,
size_t  lda,
double *  B,
size_t  ldb 
)

type for operations

name mangling Transpose A into B.

Parameters
mrows of A, cols of B
ncols of A, rows of B
[in]Asource matrix, m*n
[in]Bdestination matrix, n*m
ldaleading dimension of A
ldbleading dimension of B
AA_API double aa_la_d_vecstd ( size_t  n,
const double *  x,
size_t  incx,
double  mu 
)

Standard deviation of vector.

Parameters
nlength of d
xvector
incxincrement of x
mumean
AA_API float aa_la_s_angle ( size_t  n,
const float *  x,
size_t  incx,
const float *  y,
size_t  incy 
)

Angle between vectors.

Parameters
nlength of vectors
xfirst vector
incxstepsize of x
ysecond vector
incystepsize of y
See also
aa_la_d_angle
AA_API void aa_la_s_assign_hungarian ( size_t  m,
size_t  n,
const float *  A,
size_t  lda,
ssize_t *  row_assign,
ssize_t *  col_assign 
)

Hungarian algorithm to solve min assignment problem.

Parameters
mrows of A
ncols of A
[in]Acost matrix, column major, destroyed on exit
ldaleading dimension of A
[out]row_assignarray of column assigned to row at index i, length m. Unmatched elements have the value of -1.
[out]col_assignmapping from col to matched row
AA_API void aa_la_s_assign_hungarian_max2min ( size_t  m,
size_t  n,
float *  A,
size_t  lda 
)

Converts max assignment to min assignment for Hungarian algorithm.

Parameters
mrows of A
ncols of A
Acost matrix for max problem, converted to matrix for min proble on exit
ldaleading dimension of A
AA_API void aa_la_s_colcov ( size_t  m,
size_t  n,
const float *  A,
size_t  lda,
const float *  x,
float *  E,
size_t  lde 
)

Covariance of columns of A.

Parameters
mrows of A
ncols of A
ldaleading dimension of A
[in]Asource matrix, m*n
[in]xmean of columns of A, length m
[out]Ecovariance of columns of A, m*m
ldeleading dimension of E
See also
aa_la_d_colcov
AA_API void aa_la_s_colfit ( size_t  m,
size_t  n,
const float *  A,
size_t  lda,
float *  x 
)

Fit a least-squares hyperplane to columns of A.

Normalizes data first.

Parameters
mrows of A, size of space
ncols of A, number of points
Adata points
ldaleading dimension of A
xoutput hyperplance in hessian normal form
See also
aa_la_d_colfit
AA_API void aa_la_s_colmean ( size_t  m,
size_t  n,
const float *  A,
size_t  lda,
float *  x 
)

Mean of columns of A.

Parameters
mrows of A
ncols of A
ldaleading dimension of A
[in]Asource matrix, m*n
[out]xdestination vector for mean, length m
See also
aa_la_d_colmean
AA_API void aa_la_s_lerp ( size_t  n,
float  u,
const float *  v1,
size_t  inc1,
const float *  v2,
size_t  inc2,
float *  vu,
size_t  incu 
)

Linear interpolation of vectors.

Parameters
nlength of vectors
uinterpolation parameter, at 0, vu=v1, and at 1, vu=v2
v1initial vector
v2final vector
inc1stepsize of v1
inc2stepsize of v2
incustepsize of vu
AA_API int aa_la_s_lls ( size_t  m,
size_t  n,
size_t  p,
const float *  A,
size_t  lda,
const float *  b,
size_t  ldb,
float *  x,
size_t  ldx 
)

Linear Least Squares.

\[ b = Ax \]

Solves for x.

Parameters
mrows in A
ncols in A
pcols in b and x
Amatrix
ldaleading dimension of A
boffset matrix
ldbleading dimension of b
xsolution matrix
ldxleading dimension of x
int aa_la_s_ls_duqu_cmat ( const double *  sigma,
const double *  theta,
double *  cm 
)

Create a companion matrix for the lambda polynomial in se3 least-squares.

Parameters
sigmaSingular values of A, in vector form.
thetaValues of U^T b.
cmThe output companion matrix.
float aa_la_s_mad ( size_t  n,
const float  u,
const float *  x,
size_t  incx 
)

Median Absolute Deviation.

Parameters
nnumber of elements
umedian
xdata array
incxincrement of x
float aa_la_s_mad2 ( size_t  m,
size_t  n,
const float *  u,
const float *  A,
size_t  lda 
)

Median Absolute Deviation with Euclidean distance.

Parameters
mrows of A, length of u
ncols of A
umedian (increment of 1)
Adata matrix
ldaleading dimension of A
AA_API float aa_la_s_median ( size_t  n,
const float *  x,
size_t  incx 
)

Cmpute median.

Parameters
nnumber of elements in x
xdata array
incxincrement amount for x
AA_API float aa_la_s_nmedian ( size_t  n,
float *  x 
)

Destructive median computation.

Parameters
nnumber of elements in x
xdata array
incxincrement amount for x
Postcondition
entries of x are undefined
AA_API void aa_la_s_rowmean ( size_t  m,
size_t  n,
const float *  A,
size_t  lda,
float *  x 
)

Mean of rows of A.

Parameters
mrows of A
ncols of A
ldaleading dimension of A
[in]Asource matrix, m*n
[out]xdestination vector for mean, length n
See also
aa_la_d_rowmean
AA_API float aa_la_s_ssd ( size_t  n,
const float *  x,
size_t  incx,
const float *  y,
size_t  incy 
)

Sum-square differences of x and y.

Parameters
nlength of vectors
xfirst vector
ysecond vector
incxstepsize of x
incystepsize of y
See also
aa_la_d_ssd
AA_API int aa_la_s_svd ( size_t  m,
size_t  n,
const float *  A,
size_t  lda,
float *  U,
size_t  ldu,
float *  S,
float *  Vt,
size_t  ldvt 
)

Singular Value Decomposition of A.

\[ A = U \Sigma V^T \]

Parameters
mrows
ncolumns
A\(A \in \Re^m \times \Re^n\), column major
ldaleading dimension of A
U\(U \in \Re^m \times \Re^m\), column major. If null or ldu==0, U is returned in A. U and Vt cannot both be null.
lduleading dimension of U
S\(S \in \Re^m min(m,n)\), singular values
Vt\(V^T \in \Re^n \times \Re^n\), singular vectors. If null or ldvt==0, Vt is returned in A. Vt and U cannot both be null.
ldvtleading dimension of Vt
AA_API void aa_la_s_transpose ( size_t  m,
size_t  n,
const float *  A,
size_t  lda,
float *  B,
size_t  ldb 
)

type for operations

name mangling Transpose A into B.

Parameters
mrows of A, cols of B
ncols of A, rows of B
[in]Asource matrix, m*n
[in]Bdestination matrix, n*m
ldaleading dimension of A
ldbleading dimension of B
AA_API float aa_la_s_vecstd ( size_t  n,
const float *  x,
size_t  incx,
float  mu 
)

Standard deviation of vector.

Parameters
nlength of d
xvector
incxincrement of x
mumean