Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qvfloat.h
1
9#ifndef QVFLOAT_H
10#define QVFLOAT_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16 #include <stdlib.h>
17 #include <stdbool.h>
18
19
33
37 typedef struct {
38 float mean;
39 float avgDev;
40 float stdDev;
41 float var;
42 float skew;
43 float curt;
45
49 typedef struct {
50 float min;
51 float max;
52 size_t index_min;
53 size_t index_max;
55
77 float qVFloat_Operate( float * const dst,
79 const float a,
80 const float * const x,
81 const float b,
82 const float * const y,
83 const size_t n );
84
116 float qVFloat_ApplyFx( float *dst,
117 float (*fx1)(float),
118 float (*fx2)(float, float),
119 float * const x,
120 float * const y,
121 const float a,
122 const float b,
123 const size_t n );
124
135 int qVFloat_Moment( qVFloat_Moment_t * const m,
136 const float * const x,
137 const size_t n );
138
147 float* qVFloat_Set( float * const x,
148 const float c,
149 const size_t n );
150
159 float* qVFloat_Copy( float * const dst,
160 const float * const src,
161 const size_t n );
162
173 float qVFloat_PolyVal( const float * const p,
174 const float x,
175 size_t n );
176
187 float* qVFloat_LinSpace( float * const dst,
188 const float x1,
189 const float x2,
190 const size_t n );
191
199 float qVFloat_Distance( const float * const x,
200 const float * const y,
201 const size_t n );
215 float* qVFloat_Reverse( float * const dst,
216 float * const src,
217 const size_t init,
218 const size_t end );
219
232 float* qVFloat_Rotate( float * const dst,
233 float * const src,
234 const int k,
235 const size_t n );
236
244 int qVFloat_MinMax( qVFloat_MinMax_t * const o,
245 const float * const x,
246 const size_t n );
247
262 float* qVFloat_Sort( float * const dst,
263 float * const src,
264 const bool dir,
265 size_t n );
266
269#ifdef __cplusplus
270}
271#endif
272
273#endif
float * qVFloat_Set(float *const x, const float c, const size_t n)
Set the value given on c to all the elements of the vector pointed by x.
Definition qvfloat.c:319
float * qVFloat_Rotate(float *const dst, float *const src, const int k, const size_t n)
Rotates the elements of vector pointed by src the number of places and in the direction indicated by ...
Definition qvfloat.c:412
float qVFloat_Operate(float *const dst, qVFloat_Operation_t o, const float a, const float *const x, const float b, const float *const y, const size_t n)
Computes one of the following 1D-vector operation :
Definition qvfloat.c:194
float * qVFloat_LinSpace(float *const dst, const float x1, const float x2, const size_t n)
Generate linearly spaced vector of points. The spacing between the points is (x2-x1)/(n-1)
Definition qvfloat.c:358
int qVFloat_Moment(qVFloat_Moment_t *const m, const float *const x, const size_t n)
Computes the moment of a distribution for a given set of data including : Mean, Variance,...
Definition qvfloat.c:270
float qVFloat_PolyVal(const float *const p, const float x, size_t n)
Takes the input vector p as a polynomial p and evaluates it for x. The argument p is a vector of leng...
Definition qvfloat.c:342
float qVFloat_Distance(const float *const x, const float *const y, const size_t n)
Returns the Euclidean distance between vectors x and y.
Definition qvfloat.c:375
float * qVFloat_Reverse(float *const dst, float *const src, const size_t init, const size_t end)
Reverse the given vector pointed by src. Operation takes place on the portion of the vector that star...
Definition qvfloat.c:397
float * qVFloat_Sort(float *const dst, float *const src, const bool dir, size_t n)
Returns a sorted version of unsorted vector pointed by src with the elements arranged in ascending or...
Definition qvfloat.c:504
qVFloat_Operation_t
Supported operators on vectors.
Definition qvfloat.h:28
float * qVFloat_Copy(float *const dst, const float *const src, const size_t n)
Copies all the values on vector pointed by src to the vector pointed by dst.
Definition qvfloat.c:332
int qVFloat_MinMax(qVFloat_MinMax_t *const o, const float *const x, const size_t n)
Find the smallest and largest elements of vector pointed by x.
Definition qvfloat.c:427
float qVFloat_ApplyFx(float *dst, float(*fx1)(float), float(*fx2)(float, float), float *const x, float *const y, const float a, const float b, const size_t n)
Apply one the supplied function ( fx1 or fx2 ) to the input vector(s).
Definition qvfloat.c:225
@ VFLOAT_DIV
Definition qvfloat.h:31
@ VFLOAT_MUL
Definition qvfloat.h:30
@ VFLOAT_ADD
Definition qvfloat.h:29
Metrics returned by qVFloat_MinMax()
Definition qvfloat.h:49
float max
Definition qvfloat.h:51
size_t index_max
Definition qvfloat.h:53
float min
Definition qvfloat.h:50
size_t index_min
Definition qvfloat.h:52
Metrics returned by qVFloat_Moment()
Definition qvfloat.h:37
float skew
Definition qvfloat.h:42
float stdDev
Definition qvfloat.h:40
float var
Definition qvfloat.h:41
float curt
Definition qvfloat.h:43
float mean
Definition qvfloat.h:38
float avgDev
Definition qvfloat.h:39