WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
doubles_floats_impl.h File Reference
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <float.h>
#include "matd.h"
#include "math_util.h"

Go to the source code of this file.

Macros

#define TRRFN(root, suffix)
 
#define TRFN(root, suffix)
 
#define TFN(suffix)
 

Functions

static TNAME *TFN s_dup (const TNAME *v, int len)
 
static void TFN s_print (const TNAME *a, int len, const char *fmt)
 
static void TFN s_print_mat (const TNAME *a, int nrows, int ncols, const char *fmt)
 
static void TFN s_print_mat44 (const TNAME *a, const char *fmt)
 
static void TFN s_add (const TNAME *a, const TNAME *b, int len, TNAME *r)
 
static void TFN s_subtract (const TNAME *a, const TNAME *b, int len, TNAME *r)
 
static void TFN s_scale (TNAME s, const TNAME *v, int len, TNAME *r)
 
static TNAME TFN s_dot (const TNAME *a, const TNAME *b, int len)
 
static TNAME TFN s_distance (const TNAME *a, const TNAME *b, int len)
 
static TNAME TFN s_squared_distance (const TNAME *a, const TNAME *b, int len)
 
static TNAME TFN s_squared_magnitude (const TNAME *v, int len)
 
static TNAME TFN s_magnitude (const TNAME *v, int len)
 
static void TFN s_normalize (const TNAME *v, int len, TNAME *r)
 
static void TFN s_normalize_self (TNAME *v, int len)
 
static void TFN s_scale_self (TNAME *v, int len, double scale)
 
static void TFN s_quat_rotate (const TNAME q[4], const TNAME v[3], TNAME r[3])
 
static void TFN s_quat_multiply (const TNAME a[4], const TNAME b[4], TNAME r[4])
 
static void TFN s_quat_inverse (const TNAME q[4], TNAME r[4])
 
static void TFN s_copy (const TNAME *src, TNAME *dst, int n)
 
static void TFN s_xyt_copy (const TNAME xyt[3], TNAME r[3])
 
static void TFN s_xyt_to_mat44 (const TNAME xyt[3], TNAME r[16])
 
static void TFN s_xyt_transform_xy (const TNAME xyt[3], const TNAME xy[2], TNAME r[2])
 
static void TFN s_mat_transform_xyz (const TNAME M[16], const TNAME xyz[3], TNAME r[3])
 
static void TFN s_quat_to_angleaxis (const TNAME _q[4], TNAME r[4])
 
static void TFN s_angleaxis_to_quat (const TNAME aa[4], TNAME q[4])
 
static void TFN s_quat_to_mat44 (const TNAME q[4], TNAME r[16])
 
static void TFN s_cross_matrix (const TNAME v[3], TNAME V[9])
 
static void TFN s_angleaxis_to_mat44 (const TNAME aa[4], TNAME r[16])
 
static void TFN s_quat_xyz_to_mat44 (const TNAME q[4], const TNAME xyz[3], TNAME r[16])
 
static void TFN s_rpy_to_quat (const TNAME rpy[3], TNAME quat[4])
 
static void TFN s_quat_to_rpy (const TNAME q[4], TNAME rpy[3])
 
static void TFN s_rpy_to_mat44 (const TNAME rpy[3], TNAME M[16])
 
static void TFN s_xyzrpy_to_mat44 (const TNAME xyzrpy[6], TNAME M[16])
 
static void TFN s_mat44_transform_xyz (const TNAME M[16], const TNAME in[3], TNAME out[3])
 
static void TFN s_mat44_rotate_vector (const TNAME M[16], const TNAME in[3], TNAME out[3])
 
static void TFN s_mat44_to_xyt (const TNAME M[16], TNAME xyt[3])
 
static void TFN s_mat_to_xyz (const TNAME M[16], TNAME xyz[3])
 
static void TFN s_mat_to_quat (const TNAME M[16], TNAME q[4])
 
static void TFN s_quat_xyz_to_xyt (const TNAME q[4], const TNAME xyz[3], TNAME xyt[3])
 
static void TFN s_xyt_mul (const TNAME xyta[3], const TNAME xytb[3], TNAME xytr[3])
 
static void TFN s_xytcov_copy (const TNAME xyta[3], const TNAME Ca[9], TNAME xytr[3], TNAME Cr[9])
 
static void TFN s_xytcov_mul (const TNAME xyta[3], const TNAME Ca[9], const TNAME xytb[3], const TNAME Cb[9], TNAME xytr[3], TNAME Cr[9])
 
static void TFN s_xyt_inv (const TNAME xyta[3], TNAME xytr[3])
 
static void TFN s_xytcov_inv (const TNAME xyta[3], const TNAME Ca[9], TNAME xytr[3], TNAME Cr[9])
 
static void TFN s_xyt_inv_mul (const TNAME xyta[3], const TNAME xytb[3], TNAME xytr[3])
 
static void TFN s_mat_add (const TNAME *A, int Arows, int Acols, const TNAME *B, int Brows, int Bcols, TNAME *R, int Rrows, int Rcols)
 
static void TFN s_mat_AB (const TNAME *A, int Arows, int Acols, const TNAME *B, int Brows, int Bcols, TNAME *R, int Rrows, int Rcols)
 
static void TFN s_mat_ABt (const TNAME *A, int Arows, int Acols, const TNAME *B, int Brows, int Bcols, TNAME *R, int Rrows, int Rcols)
 
static void TFN s_mat_ABC (const TNAME *A, int Arows, int Acols, const TNAME *B, int Brows, int Bcols, const TNAME *C, int Crows, int Ccols, TNAME *R, int Rrows, int Rcols)
 
static void TFN s_mat_Ab (const TNAME *A, int Arows, int Acols, const TNAME *B, int Blength, TNAME *R, int Rlength)
 
static void TFN s_mat_AtB (const TNAME *A, int Arows, int Acols, const TNAME *B, int Brows, int Bcols, TNAME *R, int Rrows, int Rcols)
 
static void TFN s_quat_slerp (const TNAME q0[4], const TNAME _q1[4], TNAME r[4], TNAME w)
 
static void TFN s_cross_product (const TNAME v1[3], const TNAME v2[3], TNAME r[3])
 
static void TFN s_mat44_identity (TNAME out[16])
 
static void TFN s_mat44_translate (const TNAME txyz[3], TNAME out[16])
 
static void TFN s_mat44_scale (const TNAME sxyz[3], TNAME out[16])
 
static void TFN s_mat44_rotate_z (TNAME rad, TNAME out[16])
 
static void TFN s_mat44_rotate_y (TNAME rad, TNAME out[16])
 
static void TFN s_mat44_rotate_x (TNAME rad, TNAME out[16])
 
static void TFN s_mat44_translate_self (const TNAME txyz[3], TNAME out[16])
 
static void TFN s_mat44_scale_self (const TNAME sxyz[3], TNAME out[16])
 
static void TFN s_mat44_rotate_z_self (TNAME rad, TNAME out[16])
 
static void TFN s_mat44_inv (const TNAME M[16], TNAME out[16])
 
static void TFN s_mat44_inv_transform_xyz (const TNAME M[16], const TNAME in[3], TNAME out[3])
 
static void TFN s_mat44_inv_rotate_vector (const TNAME M[16], const TNAME in[3], TNAME out[3])
 
static void TFN s_elu_to_mat44 (const TNAME eye[3], const TNAME lookat[3], const TNAME _up[3], TNAME M[16])
 
static void TFN s_mat33_chol (const TNAME *A, int Arows, int Acols, TNAME *R, int Brows, int Bcols)
 
static void TFN s_mat33_lower_tri_inv (const TNAME *A, int Arows, int Acols, TNAME *R, int Rrows, int Rcols)
 
static void TFN s_mat33_sym_solve (const TNAME *A, int Arows, int Acols, const TNAME *B, int Brows, int Bcols, TNAME *R, int Rrows, int Rcols)
 

Macro Definition Documentation

◆ TFN

#define TFN ( suffix)
Value:
TRFN(TNAME, suffix)
#define TNAME
Definition doubles.h:30
#define TRFN(root, suffix)
Definition doubles_floats_impl.h:64

◆ TRFN

#define TRFN ( root,
suffix )
Value:
TRRFN(root, suffix)
#define TRRFN(root, suffix)
Definition doubles_floats_impl.h:63

◆ TRRFN

#define TRRFN ( root,
suffix )
Value:
root ## suffix

Function Documentation

◆ s_add()

static void TFN s_add ( const TNAME * a,
const TNAME * b,
int len,
TNAME * r )
inlinestatic

◆ s_angleaxis_to_mat44()

static void TFN s_angleaxis_to_mat44 ( const TNAME aa[4],
TNAME r[16] )
inlinestatic

◆ s_angleaxis_to_quat()

static void TFN s_angleaxis_to_quat ( const TNAME aa[4],
TNAME q[4] )
inlinestatic

◆ s_copy()

static void TFN s_copy ( const TNAME * src,
TNAME * dst,
int n )
inlinestatic

◆ s_cross_matrix()

static void TFN s_cross_matrix ( const TNAME v[3],
TNAME V[9] )
inlinestatic

◆ s_cross_product()

static void TFN s_cross_product ( const TNAME v1[3],
const TNAME v2[3],
TNAME r[3] )
inlinestatic

◆ s_distance()

static TNAME TFN s_distance ( const TNAME * a,
const TNAME * b,
int len )
inlinestatic

◆ s_dot()

static TNAME TFN s_dot ( const TNAME * a,
const TNAME * b,
int len )
inlinestatic

◆ s_dup()

static TNAME *TFN s_dup ( const TNAME * v,
int len )
inlinestatic

◆ s_elu_to_mat44()

static void TFN s_elu_to_mat44 ( const TNAME eye[3],
const TNAME lookat[3],
const TNAME _up[3],
TNAME M[16] )
inlinestatic

◆ s_magnitude()

static TNAME TFN s_magnitude ( const TNAME * v,
int len )
inlinestatic

◆ s_mat33_chol()

static void TFN s_mat33_chol ( const TNAME * A,
int Arows,
int Acols,
TNAME * R,
int Brows,
int Bcols )
inlinestatic

◆ s_mat33_lower_tri_inv()

static void TFN s_mat33_lower_tri_inv ( const TNAME * A,
int Arows,
int Acols,
TNAME * R,
int Rrows,
int Rcols )
inlinestatic

◆ s_mat33_sym_solve()

static void TFN s_mat33_sym_solve ( const TNAME * A,
int Arows,
int Acols,
const TNAME * B,
int Brows,
int Bcols,
TNAME * R,
int Rrows,
int Rcols )
inlinestatic

◆ s_mat44_identity()

static void TFN s_mat44_identity ( TNAME out[16])
inlinestatic

◆ s_mat44_inv()

static void TFN s_mat44_inv ( const TNAME M[16],
TNAME out[16] )
inlinestatic

◆ s_mat44_inv_rotate_vector()

static void TFN s_mat44_inv_rotate_vector ( const TNAME M[16],
const TNAME in[3],
TNAME out[3] )
inlinestatic

◆ s_mat44_inv_transform_xyz()

static void TFN s_mat44_inv_transform_xyz ( const TNAME M[16],
const TNAME in[3],
TNAME out[3] )
inlinestatic

◆ s_mat44_rotate_vector()

static void TFN s_mat44_rotate_vector ( const TNAME M[16],
const TNAME in[3],
TNAME out[3] )
inlinestatic

◆ s_mat44_rotate_x()

static void TFN s_mat44_rotate_x ( TNAME rad,
TNAME out[16] )
inlinestatic

◆ s_mat44_rotate_y()

static void TFN s_mat44_rotate_y ( TNAME rad,
TNAME out[16] )
inlinestatic

◆ s_mat44_rotate_z()

static void TFN s_mat44_rotate_z ( TNAME rad,
TNAME out[16] )
inlinestatic

◆ s_mat44_rotate_z_self()

static void TFN s_mat44_rotate_z_self ( TNAME rad,
TNAME out[16] )
inlinestatic

◆ s_mat44_scale()

static void TFN s_mat44_scale ( const TNAME sxyz[3],
TNAME out[16] )
inlinestatic

◆ s_mat44_scale_self()

static void TFN s_mat44_scale_self ( const TNAME sxyz[3],
TNAME out[16] )
inlinestatic

◆ s_mat44_to_xyt()

static void TFN s_mat44_to_xyt ( const TNAME M[16],
TNAME xyt[3] )
inlinestatic

◆ s_mat44_transform_xyz()

static void TFN s_mat44_transform_xyz ( const TNAME M[16],
const TNAME in[3],
TNAME out[3] )
inlinestatic

◆ s_mat44_translate()

static void TFN s_mat44_translate ( const TNAME txyz[3],
TNAME out[16] )
inlinestatic

◆ s_mat44_translate_self()

static void TFN s_mat44_translate_self ( const TNAME txyz[3],
TNAME out[16] )
inlinestatic

◆ s_mat_AB()

static void TFN s_mat_AB ( const TNAME * A,
int Arows,
int Acols,
const TNAME * B,
int Brows,
int Bcols,
TNAME * R,
int Rrows,
int Rcols )
inlinestatic

◆ s_mat_Ab()

static void TFN s_mat_Ab ( const TNAME * A,
int Arows,
int Acols,
const TNAME * B,
int Blength,
TNAME * R,
int Rlength )
inlinestatic

◆ s_mat_ABC()

static void TFN s_mat_ABC ( const TNAME * A,
int Arows,
int Acols,
const TNAME * B,
int Brows,
int Bcols,
const TNAME * C,
int Crows,
int Ccols,
TNAME * R,
int Rrows,
int Rcols )
inlinestatic

◆ s_mat_ABt()

static void TFN s_mat_ABt ( const TNAME * A,
int Arows,
int Acols,
const TNAME * B,
int Brows,
int Bcols,
TNAME * R,
int Rrows,
int Rcols )
inlinestatic

◆ s_mat_add()

static void TFN s_mat_add ( const TNAME * A,
int Arows,
int Acols,
const TNAME * B,
int Brows,
int Bcols,
TNAME * R,
int Rrows,
int Rcols )
inlinestatic

◆ s_mat_AtB()

static void TFN s_mat_AtB ( const TNAME * A,
int Arows,
int Acols,
const TNAME * B,
int Brows,
int Bcols,
TNAME * R,
int Rrows,
int Rcols )
inlinestatic

◆ s_mat_to_quat()

static void TFN s_mat_to_quat ( const TNAME M[16],
TNAME q[4] )
inlinestatic

◆ s_mat_to_xyz()

static void TFN s_mat_to_xyz ( const TNAME M[16],
TNAME xyz[3] )
inlinestatic

◆ s_mat_transform_xyz()

static void TFN s_mat_transform_xyz ( const TNAME M[16],
const TNAME xyz[3],
TNAME r[3] )
inlinestatic

◆ s_normalize()

static void TFN s_normalize ( const TNAME * v,
int len,
TNAME * r )
inlinestatic

◆ s_normalize_self()

static void TFN s_normalize_self ( TNAME * v,
int len )
inlinestatic

◆ s_print()

static void TFN s_print ( const TNAME * a,
int len,
const char * fmt )
inlinestatic

◆ s_print_mat()

static void TFN s_print_mat ( const TNAME * a,
int nrows,
int ncols,
const char * fmt )
inlinestatic

◆ s_print_mat44()

static void TFN s_print_mat44 ( const TNAME * a,
const char * fmt )
inlinestatic

◆ s_quat_inverse()

static void TFN s_quat_inverse ( const TNAME q[4],
TNAME r[4] )
inlinestatic

◆ s_quat_multiply()

static void TFN s_quat_multiply ( const TNAME a[4],
const TNAME b[4],
TNAME r[4] )
inlinestatic

◆ s_quat_rotate()

static void TFN s_quat_rotate ( const TNAME q[4],
const TNAME v[3],
TNAME r[3] )
inlinestatic

◆ s_quat_slerp()

static void TFN s_quat_slerp ( const TNAME q0[4],
const TNAME _q1[4],
TNAME r[4],
TNAME w )
inlinestatic

◆ s_quat_to_angleaxis()

static void TFN s_quat_to_angleaxis ( const TNAME _q[4],
TNAME r[4] )
inlinestatic

◆ s_quat_to_mat44()

static void TFN s_quat_to_mat44 ( const TNAME q[4],
TNAME r[16] )
inlinestatic

◆ s_quat_to_rpy()

static void TFN s_quat_to_rpy ( const TNAME q[4],
TNAME rpy[3] )
inlinestatic

◆ s_quat_xyz_to_mat44()

static void TFN s_quat_xyz_to_mat44 ( const TNAME q[4],
const TNAME xyz[3],
TNAME r[16] )
inlinestatic

◆ s_quat_xyz_to_xyt()

static void TFN s_quat_xyz_to_xyt ( const TNAME q[4],
const TNAME xyz[3],
TNAME xyt[3] )
inlinestatic

◆ s_rpy_to_mat44()

static void TFN s_rpy_to_mat44 ( const TNAME rpy[3],
TNAME M[16] )
inlinestatic

◆ s_rpy_to_quat()

static void TFN s_rpy_to_quat ( const TNAME rpy[3],
TNAME quat[4] )
inlinestatic

◆ s_scale()

static void TFN s_scale ( TNAME s,
const TNAME * v,
int len,
TNAME * r )
inlinestatic

◆ s_scale_self()

static void TFN s_scale_self ( TNAME * v,
int len,
double scale )
inlinestatic

◆ s_squared_distance()

static TNAME TFN s_squared_distance ( const TNAME * a,
const TNAME * b,
int len )
inlinestatic

◆ s_squared_magnitude()

static TNAME TFN s_squared_magnitude ( const TNAME * v,
int len )
inlinestatic

◆ s_subtract()

static void TFN s_subtract ( const TNAME * a,
const TNAME * b,
int len,
TNAME * r )
inlinestatic

◆ s_xyt_copy()

static void TFN s_xyt_copy ( const TNAME xyt[3],
TNAME r[3] )
inlinestatic

◆ s_xyt_inv()

static void TFN s_xyt_inv ( const TNAME xyta[3],
TNAME xytr[3] )
inlinestatic

◆ s_xyt_inv_mul()

static void TFN s_xyt_inv_mul ( const TNAME xyta[3],
const TNAME xytb[3],
TNAME xytr[3] )
inlinestatic

◆ s_xyt_mul()

static void TFN s_xyt_mul ( const TNAME xyta[3],
const TNAME xytb[3],
TNAME xytr[3] )
inlinestatic

◆ s_xyt_to_mat44()

static void TFN s_xyt_to_mat44 ( const TNAME xyt[3],
TNAME r[16] )
inlinestatic

◆ s_xyt_transform_xy()

static void TFN s_xyt_transform_xy ( const TNAME xyt[3],
const TNAME xy[2],
TNAME r[2] )
inlinestatic

◆ s_xytcov_copy()

static void TFN s_xytcov_copy ( const TNAME xyta[3],
const TNAME Ca[9],
TNAME xytr[3],
TNAME Cr[9] )
inlinestatic

◆ s_xytcov_inv()

static void TFN s_xytcov_inv ( const TNAME xyta[3],
const TNAME Ca[9],
TNAME xytr[3],
TNAME Cr[9] )
inlinestatic

◆ s_xytcov_mul()

static void TFN s_xytcov_mul ( const TNAME xyta[3],
const TNAME Ca[9],
const TNAME xytb[3],
const TNAME Cb[9],
TNAME xytr[3],
TNAME Cr[9] )
inlinestatic

◆ s_xyzrpy_to_mat44()

static void TFN s_xyzrpy_to_mat44 ( const TNAME xyzrpy[6],
TNAME M[16] )
inlinestatic