00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef LIBSWIFTNAV_LINEAR_ALGEBRA_H
00014 #define LIBSWIFTNAV_LINEAR_ALGEBRA_H
00015
00016 #include "common.h"
00017
00018 s32 qrdecomp_square(const double *a, u32 rows, double *qt, double *r);
00019 s32 qrdecomp(const double *a, u32 rows, u32 cols, double *qt, double *r);
00020 void qtmult(const double *qt, u32 n, const double *b, double *x);
00021 void rsolve(const double *r, u32 rows, u32 cols, const double *b, double *x);
00022 s32 qrsolve(const double *a, u32 rows, u32 cols, const double *b, double *x);
00023
00024 int matrix_inverse(u32 n, const double const *a, double *b);
00025 void matrix_multiply(u32 n, u32 m, u32 p, const double *a,
00026 const double *b, double *c);
00027 void matrix_add_sc(u32 n, u32 m, const double *a,
00028 const double *b, double gamma, double *c);
00029 void matrix_transpose(u32 n, u32 m, const double *a, double *b);
00030 void matrix_copy(u32 n, u32 m, const double *a, double *b);
00031
00032 int matrix_pseudoinverse(u32 n, u32 m, const double *a, double *b);
00033 int matrix_atwaiat(u32 n, u32 m, const double *a, const double *w, double *b);
00034 int matrix_ataiat(u32 n, u32 m, const double *a, double *b);
00035 int matrix_atawati(u32 n, u32 m, const double *a, const double *w, double *b);
00036 int matrix_ataati(u32 n, u32 m, const double *a, double *b);
00037
00038 double vector_dot(u32 n, const double *a, const double *b);
00039 double vector_norm(u32 n, const double *a);
00040 double vector_mean(u32 n, const double *a);
00041 void vector_normalize(u32 n, double *a);
00042 void vector_add_sc(u32 n, const double *a, const double *b,
00043 double gamma, double *c);
00044 void vector_add(u32 n, const double *a, const double *b, double *c);
00045 void vector_subtract(u32 n, const double *a,
00046 const double *b, double *c);
00047 void vector_cross(const double a[3], const double b[3], double c[3]);
00048
00049 #endif
00050