amino  1.0-beta2
Lightweight Robot Utility Library
validate.h File Reference

Validation of data. More...

Go to the source code of this file.

Functions

AA_API int aa_valid_f (double value, double min, double max)
 returns 0 if value >= min and value <= max, else nonzero
 
AA_API int aa_valid_v (double *values, size_t n, double *min, double *max, size_t n_desired)
 Validate a vector. More...
 
AA_API int aa_valid_vunit (double *values, size_t n, double tol)
 returns 0 if norm(v) == 1
 
AA_API int aa_valid_timespec (struct timespec tm, struct timespec before, struct timespec after)
 returns 0 if time is within [before,after]
 

Detailed Description

Validation of data.

All functions here return 0 if the data is valid and nonzero otherwise.

Author
Neil T. Dantam

Definition in file validate.h.

Function Documentation

◆ aa_valid_v()

AA_API int aa_valid_v ( double *  values,
size_t  n,
double *  min,
double *  max,
size_t  n_desired 
)

Validate a vector.

Returns
0 if values is within [min,max], less than zero if n!=n_desired, 1+i if value[i] is outside of [min,max]