ISMatrix.c
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2021 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #include <string.h>
14 #include <stdlib.h>
15 #include "ISMatrix.h"
16 #include "data_sets.h"
17 
18 void LU( const f_t *M, i_t n, f_t *L, f_t *U );
19 char solve_upper( f_t *result, i_t n, f_t *A, f_t *b );
20 char solve_lower( f_t *result, i_t n, f_t *A, f_t *b );
21 
22 void mul_MatMxN( void * result, const void * A_ptr, const void * B_ptr, i_t m, i_t n, i_t p, char transpose_B, char add )
23 {
24  i_t i;
25  i_t j;
26  i_t k;
27 
28  f_t * matOut = (f_t*)result;
29  const f_t * A = (const f_t*)A_ptr;
30  const f_t * B = (const f_t*)B_ptr;
31 
32  for (i = 0; i < m; i++)
33  {
34  const f_t * A_i = A + i * n;
35  f_t * O_i = matOut + i * p;
36 
37  for (j = 0; j < p; j++)
38  {
39  f_t s = 0;
40  f_t * O_i_j = O_i + j;
41 
42  for (k = 0; k < n; k++)
43  {
44  const f_t * a = A_i + k;
45  const f_t * b;
46 
47  if (is_zero(a))
48  continue;
49 
50  if (transpose_B)
51  b = B + j * n + k;
52  else
53  b = B + k * p + j;
54 
55  if (is_zero(b))
56  continue;
57 
58  s += *a * *b;
59  }
60 
61  if (add == 0)
62  *O_i_j = s;
63  else if (add > 0)
64  *O_i_j += s;
65  else
66  *O_i_j -= s;
67  }
68  }
69 }
70 
71 #if 0
72 void addNxM(void * result, const void * A_ptr, const void * B_ptr, i_t m, i_t n, char transpose_B)
73 {
74  i_t i;
75  i_t j;
76  i_t k;
77 
78  f_t * OUT = result;
79  const f_t * A = A_ptr;
80  const f_t * B = B_ptr;
81 
82  for (i = 0; i < m; i++)
83  {
84  const f_t * A_i = A + i * n;
85  f_t * O_i = OUT + i * p;
86 
87  for (j = 0; j < p; j++)
88  {
89 // f_t s = 0;
90  f_t * O_i_j = O_i + j;
91 
92 
93  for (k = 0; k < n; k++)
94  {
95  const f_t * a = A_i + k;
96  const f_t * b;
97 
98 // if (is_zero(a))
99 // continue;
100 
101  if (transpose_B)
102  b = B + j * n + k;
103  else
104  b = B + k * p + j;
105 
106  if (is_zero(b))
107  continue;
108 
109  s += *a * *b;
110  }
111 
112  *O_i_j = s;
113  }
114  }
115 }
116 #endif
117 
118 
119 void eye_MatN( f_t *A, i_t n )
120 {
121  zero_MatMxN( A, n, n );
122 
123  // Set diagonals to 1
124  for( int i=0; i < n; i++ )
125  A[i*n + i] = 1;
126 }
127 
128 
129 // Compute the LU factorization of the square matrix A
130 void LU( const f_t *M, i_t n, f_t *L, f_t *U )
131 {
132  int in, kn;
133 
134  f_t *A = (f_t*)MALLOC( sizeof( f_t )*n*n );
135  if (A == 0) { return; }
136 
137  cpy_MatMxN( A, M, n, n );
138 
139  for( int k=0; k < n - 1; k++ )
140  {
141  for( int i=k + 1; i < n; i++ )
142  {
143  in = i*n;
144  kn = k*n;
145 // f_t * Ai = A + i*n;
146 
147  A[in + k] = A[in + k] / A[kn + k];
148 
149  for( int j=k + 1; j < n; j++ )
150  {
151 #ifdef NO_FPU
152  T & A_i_j( A[in + j] );
153  const T & A_i_k( A[in + k] );
154  const T & A_k_j( A[kn + j] );
155 
156  if( is_zero( A_i_k )
157  || is_zero( A_k_j )
158  )
159  continue;
160 
161  A_i_j -= A_i_k * A_k_j;
162 #else
163  A[in + j] -= A[in + k] * A[kn + j];
164 #endif
165  }
166  }
167  }
168 
169  eye_MatN( L, n );
170 
171  /* Separate the L matrix */
172  for( int j=0; j < n - 1; j++ )
173  for( int i=j + 1; i < n; i++ )
174  L[i*n + j] = A[i*n + j];
175 
176  /* Separate the M matrix */
177  zero_MatMxN( U, n, n );
178 
179  for( int i=0; i < n; i++ )
180  for( int j=i; j < n; j++ )
181  U[i*n + j] = A[i*n + j];
182 
183  FREE( A );
184 }
185 
186 // Return 0 on success, -1 on numerical error
187 char solve_upper( f_t *result, i_t n, f_t *A, f_t *b )
188 {
189  for( int i=n - 1; i >= 0; i-- )
190  {
191  f_t s = b[i];
192 
193  // Reference a row
194  f_t *A_i = &A[i*n];
195 
196  for( int j=i + 1; j < n; ++j )
197  {
198 #ifdef NO_FPU
199  const T & A_i_j( A_i[j] );
200  const T & x_j( x[j] );
201 
202  if( is_zero( A_i_j ) || is_zero( x_j ) )
203  continue;
204 
205  s -= A_i_j * x_j;
206 #else
207  s -= A_i[j] * result[j*n];
208 #endif
209  }
210 
211  // Prevent divide by zero
212  if( A_i[i]==0.0f )
213  return -1;
214 
215  result[i*n] = s / A_i[i];
216  }
217 
218  return 0;
219 }
220 
221 // Return 0 on success, -1 on numerical error
222 char solve_lower( f_t *result, i_t n, f_t *A, f_t *b )
223 {
224  for( int i=0; i < n; ++i )
225  {
226  f_t s = b[i];
227 
228  // Reference a row
229  f_t *A_i = &A[i*n];
230 
231  for( int j=0; j < i; ++j )
232  {
233 #ifdef NO_FPU
234  const T & A_i_j( A_i[j] );
235  const T & x_j( x[j] );
236 
237  if( is_zero( A_i_j )|| is_zero( x_j ) )
238  continue;
239 
240  s -= A_i_j * x_j;
241 #else
242  s -= A_i[j] * result[j*n];
243 #endif
244  }
245 
246  // Prevent divide by zero
247  if( A_i[i]==0.0f )
248  return -1;
249 
250  result[i*n] = s / A_i[i];
251  }
252 
253  return 0;
254 }
255 
256 
257 // Return 0 on success, -1 on numerical error
258 char inv_MatN( f_t *result, const f_t *M, i_t n )
259 {
260  char error = 0;
261 
262  f_t *L = (f_t*)MALLOC( sizeof( f_t )*n*n );
263  f_t *U = (f_t*)MALLOC( sizeof( f_t )*n*n );
264  f_t *invL = (f_t*)MALLOC( sizeof( f_t )*n*n );
265  f_t *invU = (f_t*)MALLOC( sizeof( f_t )*n*n );
266  f_t *identCol = (f_t*)MALLOC( sizeof( f_t )*n );
267  while( L==NULL || U==NULL || invL==NULL || invU==NULL || identCol==NULL ) { /* Error check malloc */ }
268  memset( identCol, 0, sizeof( f_t )*n );
269 
270  LU( M, n, L, U );
271 
272  for( int i=0; i < n; i++ )
273  {
274  identCol[i] = 1;
275  if( solve_upper( &invU[i], n, U, identCol ) || // Fill a column
276  solve_lower( &invL[i], n, L, identCol ) )
277  {
278  error = -1;
279  break;
280  }
281  identCol[i] = 0;
282  }
283 
284  // result = invU * invL
285  if( !error )
286  mul_MatMxN( result, invU, invL, n, n, n, 0, 0 );
287 
288  FREE( L );
289  FREE( U );
290  FREE( invL );
291  FREE( invU );
292  FREE( identCol );
293 
294  return error;
295 }
296 
297 
298 void trans_MatMxN( f_t *result, const f_t *M, int m, int n )
299 {
300  i_t i;
301  i_t j;
302 
303  const f_t * A = (const f_t*)M;
304 
305  for( i = 0; i < m; i++ )
306  {
307  f_t * O_i = result + i;
308 
309  for( j = 0; j < n; j++ )
310  {
311  // Copy value
312  *O_i = *A;
313 
314  // Increment pointers
315  A++;
316  O_i += m;
317  }
318  }
319 }
320 
321 
322 void mul_Mat3x3_Mat3x3( ixMatrix3 result, const ixMatrix3 m1, const ixMatrix3 m2 )
323 {
324  // Row 1
325  result[0] = m1[0]*m2[0] + m1[1]*m2[3] + m1[2]*m2[6];
326  result[1] = m1[0]*m2[1] + m1[1]*m2[4] + m1[2]*m2[7];
327  result[2] = m1[0]*m2[2] + m1[1]*m2[5] + m1[2]*m2[8];
328  // Row 2
329  result[3] = m1[3]*m2[0] + m1[4]*m2[3] + m1[5]*m2[6];
330  result[4] = m1[3]*m2[1] + m1[4]*m2[4] + m1[5]*m2[7];
331  result[5] = m1[3]*m2[2] + m1[4]*m2[5] + m1[5]*m2[8];
332  // Row 3
333  result[6] = m1[6]*m2[0] + m1[7]*m2[3] + m1[8]*m2[6];
334  result[7] = m1[6]*m2[1] + m1[7]*m2[4] + m1[8]*m2[7];
335  result[8] = m1[6]*m2[2] + m1[7]*m2[5] + m1[8]*m2[8];
336 }
337 
338 void mul_Mat3x3_Mat3x3_d(ixMatrix3d result, const ixMatrix3d m1, const ixMatrix3d m2)
339 {
340  // Row 1
341  result[0] = m1[0] * m2[0] + m1[1] * m2[3] + m1[2] * m2[6];
342  result[1] = m1[0] * m2[1] + m1[1] * m2[4] + m1[2] * m2[7];
343  result[2] = m1[0] * m2[2] + m1[1] * m2[5] + m1[2] * m2[8];
344  // Row 2
345  result[3] = m1[3] * m2[0] + m1[4] * m2[3] + m1[5] * m2[6];
346  result[4] = m1[3] * m2[1] + m1[4] * m2[4] + m1[5] * m2[7];
347  result[5] = m1[3] * m2[2] + m1[4] * m2[5] + m1[5] * m2[8];
348  // Row 3
349  result[6] = m1[6] * m2[0] + m1[7] * m2[3] + m1[8] * m2[6];
350  result[7] = m1[6] * m2[1] + m1[7] * m2[4] + m1[8] * m2[7];
351  result[8] = m1[6] * m2[2] + m1[7] * m2[5] + m1[8] * m2[8];
352 }
353 
354 void mul_Mat3x3_Trans_Mat3x3( ixMatrix3 result, const ixMatrix3 m1, const ixMatrix3 m2 )
355 {
356  // Row 1
357  result[0] = m1[0]*m2[0] + m1[3]*m2[3] + m1[6]*m2[6];
358  result[1] = m1[0]*m2[1] + m1[3]*m2[4] + m1[6]*m2[7];
359  result[2] = m1[0]*m2[2] + m1[3]*m2[5] + m1[6]*m2[8];
360  // Row 2
361  result[3] = m1[1]*m2[0] + m1[4]*m2[3] + m1[7]*m2[6];
362  result[4] = m1[1]*m2[1] + m1[4]*m2[4] + m1[7]*m2[7];
363  result[5] = m1[1]*m2[2] + m1[4]*m2[5] + m1[7]*m2[8];
364  // Row 3
365  result[6] = m1[2]*m2[0] + m1[5]*m2[3] + m1[8]*m2[6];
366  result[7] = m1[2]*m2[1] + m1[5]*m2[4] + m1[8]*m2[7];
367  result[8] = m1[2]*m2[2] + m1[5]*m2[5] + m1[8]*m2[8];
368 }
369 
371 {
372  // Row 1
373  result[0] = m1[0] * m2[0] + m1[3] * m2[3] + m1[6] * m2[6];
374  result[1] = m1[0] * m2[1] + m1[3] * m2[4] + m1[6] * m2[7];
375  result[2] = m1[0] * m2[2] + m1[3] * m2[5] + m1[6] * m2[8];
376  // Row 2
377  result[3] = m1[1] * m2[0] + m1[4] * m2[3] + m1[7] * m2[6];
378  result[4] = m1[1] * m2[1] + m1[4] * m2[4] + m1[7] * m2[7];
379  result[5] = m1[1] * m2[2] + m1[4] * m2[5] + m1[7] * m2[8];
380  // Row 3
381  result[6] = m1[2] * m2[0] + m1[5] * m2[3] + m1[8] * m2[6];
382  result[7] = m1[2] * m2[1] + m1[5] * m2[4] + m1[8] * m2[7];
383  result[8] = m1[2] * m2[2] + m1[5] * m2[5] + m1[8] * m2[8];
384 }
385 
386 void mul_Mat3x3_Mat3x3_Trans( ixMatrix3 result, const ixMatrix3 m1, const ixMatrix3 m2 )
387 {
388  // Row 1
389  result[0] = m1[0]*m2[0] + m1[1]*m2[1] + m1[2]*m2[2];
390  result[1] = m1[0]*m2[3] + m1[1]*m2[4] + m1[2]*m2[5];
391  result[2] = m1[0]*m2[6] + m1[1]*m2[7] + m1[2]*m2[8];
392  // Row 2
393  result[3] = m1[3]*m2[0] + m1[4]*m2[1] + m1[5]*m2[2];
394  result[4] = m1[3]*m2[3] + m1[4]*m2[4] + m1[5]*m2[5];
395  result[5] = m1[3]*m2[6] + m1[4]*m2[7] + m1[5]*m2[8];
396  // Row 3
397  result[6] = m1[6]*m2[0] + m1[7]*m2[1] + m1[8]*m2[2];
398  result[7] = m1[6]*m2[3] + m1[7]*m2[4] + m1[8]*m2[5];
399  result[8] = m1[6]*m2[6] + m1[7]*m2[7] + m1[8]*m2[8];
400 }
401 
403 {
404  // Row 1
405  result[0] = m1[0] * m2[0] + m1[1] * m2[1] + m1[2] * m2[2];
406  result[1] = m1[0] * m2[3] + m1[1] * m2[4] + m1[2] * m2[5];
407  result[2] = m1[0] * m2[6] + m1[1] * m2[7] + m1[2] * m2[8];
408  // Row 2
409  result[3] = m1[3] * m2[0] + m1[4] * m2[1] + m1[5] * m2[2];
410  result[4] = m1[3] * m2[3] + m1[4] * m2[4] + m1[5] * m2[5];
411  result[5] = m1[3] * m2[6] + m1[4] * m2[7] + m1[5] * m2[8];
412  // Row 3
413  result[6] = m1[6] * m2[0] + m1[7] * m2[1] + m1[8] * m2[2];
414  result[7] = m1[6] * m2[3] + m1[7] * m2[4] + m1[8] * m2[5];
415  result[8] = m1[6] * m2[6] + m1[7] * m2[7] + m1[8] * m2[8];
416 }
417 
418 void mul_Mat2x2_Vec2x1( ixVector2 result, const ixMatrix2 m, const ixVector2 v )
419 {
420  result[0] = m[0]*v[0] + m[1]*v[1];
421  result[1] = m[2]*v[0] + m[3]*v[1];
422 }
423 
424 void mul_Mat2x2_Trans_Vec2x1( ixVector2 result, const ixMatrix2 m, const ixVector2 v )
425 {
426  result[0] = m[0]*v[0] + m[2]*v[1];
427  result[1] = m[1]*v[0] + m[3]*v[1];
428 }
429 
430 void mul_Mat3x3_Vec3x1( ixVector3 result, const ixMatrix3 m, const ixVector3 v )
431 {
432  result[0] = m[0]*v[0] + m[1]*v[1] + m[2]*v[2];
433  result[1] = m[3]*v[0] + m[4]*v[1] + m[5]*v[2];
434  result[2] = m[6]*v[0] + m[7]*v[1] + m[8]*v[2];
435 }
436 
437 void mul_Mat3x3_Trans_Vec3x1( ixVector3 result, const ixMatrix3 m, const ixVector3 v )
438 {
439  result[0] = m[0]*v[0] + m[3]*v[1] + m[6]*v[2];
440  result[1] = m[1]*v[0] + m[4]*v[1] + m[7]*v[2];
441  result[2] = m[2]*v[0] + m[5]*v[1] + m[8]*v[2];
442 }
443 
444 void mul_Mat4x4_Vec4x1( ixVector4 result, const ixMatrix4 m, const ixVector4 v )
445 {
446  result[0] = m[0]*v[0] + m[1]*v[1] + m[2]*v[2] + m[3]*v[3];
447  result[1] = m[4]*v[0] + m[5]*v[1] + m[6]*v[2] + m[7]*v[3];
448  result[2] = m[8]*v[0] + m[9]*v[1] + m[10]*v[2] + m[11]*v[3];
449  result[3] = m[12]*v[0] + m[13]*v[1] + m[14]*v[2] + m[15]*v[3];
450 }
451 
452 void mul_Mat4x4_Trans_Vec4x1( ixVector4 result, const ixMatrix4 m, const ixVector4 v )
453 {
454  result[0] = m[0]*v[0] + m[4]*v[1] + m[8]*v[2] + m[12]*v[3];
455  result[1] = m[1]*v[0] + m[5]*v[1] + m[9]*v[2] + m[13]*v[3];
456  result[2] = m[2]*v[0] + m[6]*v[1] + m[10]*v[2] + m[14]*v[3];
457  result[3] = m[3]*v[0] + m[7]*v[1] + m[11]*v[2] + m[15]*v[3];
458 }
459 
460 void neg_Mat3x3(ixMatrix3 result, const ixMatrix3 m)
461 {
462  // Row 1
463  result[0] = -m[0];
464  result[1] = -m[1];
465  result[2] = -m[2];
466  // Row 2
467  result[3] = -m[3];
468  result[4] = -m[4];
469  result[5] = -m[5];
470  // Row 3
471  result[6] = -m[6];
472  result[7] = -m[7];
473  result[8] = -m[8];
474 }
475 
476 void mul_Vec3x1_Vec1x3( ixMatrix3 result, const ixVector3 v1, const ixVector3 v2 )
477 {
478  // Row 1
479  result[0] = v1[0]*v2[0];
480  result[1] = v1[0]*v2[1];
481  result[2] = v1[0]*v2[2];
482  // Row 2
483  result[3] = v1[1]*v2[0];
484  result[4] = v1[1]*v2[1];
485  result[5] = v1[1]*v2[2];
486  // Row 3
487  result[6] = v1[2]*v2[0];
488  result[7] = v1[2]*v2[1];
489  result[8] = v1[2]*v2[2];
490 }
491 
492 void mul_Vec3_Vec3( ixVector3 result, const ixVector3 v1, const ixVector3 v2 )
493 {
494  result[0] = v1[0] * v2[0];
495  result[1] = v1[1] * v2[1];
496  result[2] = v1[2] * v2[2];
497 }
498 
499 void mul_Vec4_Vec4( ixVector4 result, const ixVector4 v1, const ixVector4 v2 )
500 {
501  result[0] = v1[0] * v2[0];
502  result[1] = v1[1] * v2[1];
503  result[2] = v1[2] * v2[2];
504  result[3] = v1[3] * v2[3];
505 }
506 
507 void sqrt_Vec3( ixVector3 result, const ixVector3 v )
508 {
509  result[0] = _SQRT( v[0] );
510  result[1] = _SQRT( v[1] );
511  result[2] = _SQRT( v[2] );
512 }
513 
514 void sqrt_Vec4( ixVector4 result, const ixVector4 v )
515 {
516  result[0] = _SQRT( v[0] );
517  result[1] = _SQRT( v[1] );
518  result[2] = _SQRT( v[2] );
519  result[3] = _SQRT( v[3] );
520 }
521 
522 void abs_Vec2( ixVector2 result, const ixVector2 v )
523 {
524  result[0] = _FABS( v[0] );
525  result[1] = _FABS( v[1] );
526 }
527 
528 void abs_Vec2d(ixVector2d result, const ixVector2d v)
529 {
530  result[0] = fabs(v[0]);
531  result[1] = fabs(v[1]);
532 }
533 
534 void abs_Vec3( ixVector3 result, const ixVector3 v )
535 {
536  result[0] = _FABS( v[0] );
537  result[1] = _FABS( v[1] );
538  result[2] = _FABS( v[2] );
539 }
540 
541 void abs_Vec3d(ixVector3d result, const ixVector3d v)
542 {
543  result[0] = fabs(v[0]);
544  result[1] = fabs(v[1]);
545  result[2] = fabs(v[2]);
546 }
547 
548 void abs_Vec4( ixVector4 result, const ixVector4 v )
549 {
550  result[0] = _FABS( v[0] );
551  result[1] = _FABS( v[1] );
552  result[2] = _FABS( v[2] );
553  result[3] = _FABS( v[3] );
554 }
555 
556 void abs_Vec4d(ixVector4d result, const ixVector4d v)
557 {
558  result[0] = fabs(v[0]);
559  result[1] = fabs(v[1]);
560  result[2] = fabs(v[2]);
561  result[3] = fabs(v[3]);
562 }
563 
564 f_t dot_Vec2_Vec2(const ixVector2 v1, const ixVector2 v2 )
565 {
566  return v1[0] * v2[0] +
567  v1[1] * v2[1];
568 }
569 
570 f_t dot_Vec3_Vec3(const ixVector3 v1, const ixVector3 v2 )
571 {
572  return v1[0] * v2[0] +
573  v1[1] * v2[1] +
574  v1[2] * v2[2];
575 }
576 
577 double dot_Vec3d_Vec3d(const ixVector3d v1, const ixVector3d v2)
578 {
579  return v1[0] * v2[0] +
580  v1[1] * v2[1] +
581  v1[2] * v2[2];
582 }
583 
584 f_t dot_Vec4_Vec4(const ixVector4 v1, const ixVector4 v2 )
585 {
586  return v1[0] * v2[0] +
587  v1[1] * v2[1] +
588  v1[2] * v2[2] +
589  v1[3] * v2[3];
590 }
591 
592 //_______________________________________________________________________________________________
593 //observe that cross product output cannot overwrite cross product input without destroying logic
594 void cross_Vec3( ixVector3 result, const ixVector3 v1, const ixVector3 v2 )
595 {
596  result[0] = v1[1]*v2[2] - v1[2]*v2[1];
597  result[1] = v1[2]*v2[0] - v1[0]*v2[2];
598  result[2] = v1[0]*v2[1] - v1[1]*v2[0];
599 }
600 
601 void crossd_Vec3( ixVector3d result, const ixVector3 v1, const ixVector3 v2 )
602 {
603  result[0] = (double)(v1[1] * v2[2] - v1[2] * v2[1]);
604  result[1] = (double)(v1[2] * v2[0] - v1[0] * v2[2]);
605  result[2] = (double)(v1[0] * v2[1] - v1[1] * v2[0]);
606 }
607 
608 void mul_Vec2_X( ixVector2 result, const ixVector2 v, const f_t x )
609 {
610  result[0] = v[0]*x;
611  result[1] = v[1]*x;
612 }
613 
614 void mul_Vec2d_X( ixVector2d result, const ixVector2d v, const double x )
615 {
616  result[0] = v[0]*x;
617  result[1] = v[1]*x;
618 }
619 
620 void mul_Vec3_X( ixVector3 result, const ixVector3 v, const f_t x )
621 {
622  result[0] = v[0]*x;
623  result[1] = v[1]*x;
624  result[2] = v[2]*x;
625 }
626 
627 void mul_Vec3d_X( ixVector3d result, const ixVector3d v, const double x )
628 {
629  result[0] = v[0]*x;
630  result[1] = v[1]*x;
631  result[2] = v[2]*x;
632 }
633 
634 void mul_Vec4_X( ixVector4 result, const ixVector4 v, const f_t x )
635 {
636  result[0] = v[0]*x;
637  result[1] = v[1]*x;
638  result[2] = v[2]*x;
639  result[3] = v[3]*x;
640 }
641 
642 void mul_Vec4d_X( ixVector4d result, const ixVector4d v, const double x )
643 {
644  result[0] = v[0] * x;
645  result[1] = v[1] * x;
646  result[2] = v[2] * x;
647  result[3] = v[3] * x;
648 }
649 
650 void div_Vec3_X( ixVector3 result, const ixVector3 v, const f_t x )
651 {
652  f_t d = (f_t)1.0/x;
653  result[0] = v[0]*d;
654  result[1] = v[1]*d;
655  result[2] = v[2]*d;
656 }
657 
658 void div_Vec4_X( ixVector4 result, const ixVector4 v, const f_t x )
659 {
660  f_t d = (f_t)1.0/x;
661  result[0] = v[0]*d;
662  result[1] = v[1]*d;
663  result[2] = v[2]*d;
664  result[3] = v[3]*d;
665 }
666 void div_Vec4d_X( ixVector4d result, const ixVector4d v, const double x )
667 {
668  double d = 1.0 / x;
669  result[0] = v[0] * d;
670  result[1] = v[1] * d;
671  result[2] = v[2] * d;
672  result[3] = v[3] * d;
673 }
674 
675 void add_Vec3_Vec3( ixVector3 result, const ixVector3 v1, const ixVector3 v2 )
676 {
677  result[0] = v1[0] + v2[0];
678  result[1] = v1[1] + v2[1];
679  result[2] = v1[2] + v2[2];
680 }
681 
682 void add_Vec3d_Vec3d( ixVector3d result, const ixVector3d v1, const ixVector3d v2 )
683 {
684  result[0] = v1[0] + v2[0];
685  result[1] = v1[1] + v2[1];
686  result[2] = v1[2] + v2[2];
687 }
688 
689 void add_K1Vec3_K2Vec3(ixVector3 result, const ixVector3 v1, const ixVector3 v2, float k1, float k2)
690 {
691  result[0] = k1 * v1[0] + k2 * v2[0];
692  result[1] = k1 * v1[1] + k2 * v2[1];
693  result[2] = k1 * v1[2] + k2 * v2[2];
694 }
695 
696 void add_Vec4_Vec4( ixVector4 result, const ixVector4 v1, const ixVector4 v2 )
697 {
698  result[0] = v1[0] + v2[0];
699  result[1] = v1[1] + v2[1];
700  result[2] = v1[2] + v2[2];
701  result[3] = v1[3] + v2[3];
702 }
703 
704 void add_Vec4d_Vec4d( ixVector4d result, const ixVector4d v1, const ixVector4d v2 )
705 {
706  result[0] = v1[0] + v2[0];
707  result[1] = v1[1] + v2[1];
708  result[2] = v1[2] + v2[2];
709  result[3] = v1[3] + v2[3];
710 }
711 
712 void sub_Vec3_Vec3( ixVector3 result, const ixVector3 v1, const ixVector3 v2 )
713 {
714  result[0] = v1[0] - v2[0];
715  result[1] = v1[1] - v2[1];
716  result[2] = v1[2] - v2[2];
717 }
718 
719 void sub_Vec3d_Vec3d( ixVector3d result, const ixVector3d v1, const ixVector3d v2 )
720 {
721  result[0] = v1[0] - v2[0];
722  result[1] = v1[1] - v2[1];
723  result[2] = v1[2] - v2[2];
724 }
725 
726 void sub_Vec4_Vec4( ixVector4 result, const ixVector4 v1, const ixVector4 v2 )
727 {
728  result[0] = v1[0] - v2[0];
729  result[1] = v1[1] - v2[1];
730  result[2] = v1[2] - v2[2];
731  result[3] = v1[3] - v2[3];
732 }
733 
734 void div_Vec3_Vec3( ixVector3 result, const ixVector3 v1, const ixVector3 v2 )
735 {
736  result[0] = v1[0] / v2[0];
737  result[1] = v1[1] / v2[1];
738  result[2] = v1[2] / v2[2];
739 }
740 
741 void div_Vec4_Vec4( ixVector4 result, const ixVector4 v1, const ixVector4 v2 )
742 {
743  result[0] = v1[0] / v2[0];
744  result[1] = v1[1] / v2[1];
745  result[2] = v1[2] / v2[2];
746  result[3] = v1[3] / v2[3];
747 }
748 
749 void neg_Vec3(ixVector3 result, const ixVector3 v)
750 {
751  result[0] = -v[0];
752  result[1] = -v[1];
753  result[2] = -v[2];
754 }
755 
756 void cpy_MatRxC_MatMxN( f_t *result, i_t r, i_t c, i_t r_offset, i_t c_offset, f_t *A, i_t m, i_t n )
757 {
758  // Ensure source matrix A fits within result matrix
759  if( (m + r_offset) > r || (n + c_offset) > c )
760  return;
761 
762  // Set result pointer to first location
763  result += c*r_offset + c_offset;
764 
765  int rowSize = sizeof( f_t )*n;
766  for( int mi=0; mi<m; mi++ )
767  {
768  // Copy row
769  memcpy( result, A, rowSize );
770 
771  // Update to next row
772  A += n;
773  result += c;
774  }
775 }
776 
777 
778 void transpose_Mat2( ixMatrix2 result, const ixMatrix2 m )
779 {
780  // Row 1
781  result[0] = m[0];
782  result[1] = m[2];
783  // Row 2
784  result[2] = m[1];
785  result[3] = m[3];
786 }
787 
788 void transpose_Mat3( ixMatrix3 result, const ixMatrix3 m )
789 {
790  // Row 1
791  result[0] = m[0];
792  result[1] = m[3];
793  result[2] = m[6];
794  // Row 2
795  result[3] = m[1];
796  result[4] = m[4];
797  result[5] = m[7];
798  // Row 3
799  result[6] = m[2];
800  result[7] = m[5];
801  result[8] = m[8];
802 }
803 
804 void transpose_Mat4( ixMatrix4 result, const ixMatrix4 m )
805 {
806  // Row 1
807  result[ 0] = m[ 0];
808  result[ 1] = m[ 4];
809  result[ 2] = m[ 8];
810  result[ 3] = m[12];
811  // Row 2
812  result[ 4] = m[ 1];
813  result[ 5] = m[ 5];
814  result[ 6] = m[ 9];
815  result[ 7] = m[13];
816  // Row 3
817  result[ 8] = m[ 2];
818  result[ 9] = m[ 6];
819  result[10] = m[10];
820  result[11] = m[14];
821  // Row 4
822  result[12] = m[ 3];
823  result[13] = m[ 7];
824  result[14] = m[11];
825  result[15] = m[15];
826 }
827 
828 char inv_Mat2(ixMatrix2 result, ixMatrix2 m)
829 {
830  f_t invDet, det = m[0] * m[3] - m[1] * m[2];
831 
832  if( det!=0.0f )
833  invDet = 1.0f/det;
834  else
835  return -1;
836 
837  // Row 1
838  result[0] = m[3] * ( invDet);
839  result[1] = m[1] * (-invDet);
840  // Row 2
841  result[2] = m[2] * (-invDet);
842  result[3] = m[0] * ( invDet);
843 
844  return 1;
845 }
846 
847 char inv_Mat3( ixMatrix3 result, const ixMatrix3 m )
848 {
849  // | m[0] m[1] m[2] |-1 | m[8]m[4]-m[7]m[5] -(m[8]m[1]-m[7]m[2]) m[5]m[1]-m[4]m[2] |
850  // | m[3] m[4] m[5] | = 1/det * | -(m[8]m[3]-m[6]m[5]) m[8]m[0]-m[6]m[2] -(m[5]m[0]-m[3]m[2]) |
851  // | m[6] m[7] m[8] | | m[7]m[3]-m[6]m[4] -(m[7]m[0]-m[6]m[1]) m[4]m[0]-m[3]m[1] |
852 
853  f_t invDet, det = m[0]*(m[8]*m[4]-m[7]*m[5]) - m[3]*(m[8]*m[1]-m[7]*m[2]) + m[6]*(m[5]*m[1]-m[4]*m[2]);
854 
855  if( det!=0 )
856  invDet = 1/det;
857  else
858  return -1;
859 
860  // Row 1
861  result[0] = invDet * (m[8]*m[4]-m[7]*m[5]);
862  result[1] = invDet * (m[7]*m[2]-m[8]*m[1]);
863  result[2] = invDet * (m[5]*m[1]-m[4]*m[2]);
864  // Row 2
865  result[3] = invDet * (m[6]*m[5]-m[8]*m[3]);
866  result[4] = invDet * (m[8]*m[0]-m[6]*m[2]);
867  result[5] = invDet * (m[3]*m[2]-m[5]*m[0]);
868  // Row 3
869  result[6] = invDet * (m[7]*m[3]-m[6]*m[4]);
870  result[7] = invDet * (m[6]*m[1]-m[7]*m[0]);
871  result[8] = invDet * (m[4]*m[0]-m[3]*m[1]);
872 
873  return 0;
874 }
875 
876 char inv_Mat4( ixMatrix4 result, const ixMatrix4 m )
877 {
878  f_t inv[16], det;
879  int i;
880 
881  inv[0] =
882  m[5] * m[10] * m[15] -
883  m[5] * m[11] * m[14] -
884  m[9] * m[6] * m[15] +
885  m[9] * m[7] * m[14] +
886  m[13] * m[6] * m[11] -
887  m[13] * m[7] * m[10];
888 
889  inv[4] =
890  -m[4] * m[10] * m[15] +
891  m[4] * m[11] * m[14] +
892  m[8] * m[6] * m[15] -
893  m[8] * m[7] * m[14] -
894  m[12] * m[6] * m[11] +
895  m[12] * m[7] * m[10];
896 
897  inv[8] =
898  m[4] * m[9] * m[15] -
899  m[4] * m[11] * m[13] -
900  m[8] * m[5] * m[15] +
901  m[8] * m[7] * m[13] +
902  m[12] * m[5] * m[11] -
903  m[12] * m[7] * m[9];
904 
905  inv[12] =
906  -m[4] * m[9] * m[14] +
907  m[4] * m[10] * m[13] +
908  m[8] * m[5] * m[14] -
909  m[8] * m[6] * m[13] -
910  m[12] * m[5] * m[10] +
911  m[12] * m[6] * m[9];
912 
913  inv[1] =
914  -m[1] * m[10] * m[15] +
915  m[1] * m[11] * m[14] +
916  m[9] * m[2] * m[15] -
917  m[9] * m[3] * m[14] -
918  m[13] * m[2] * m[11] +
919  m[13] * m[3] * m[10];
920 
921  inv[5] =
922  m[0] * m[10] * m[15] -
923  m[0] * m[11] * m[14] -
924  m[8] * m[2] * m[15] +
925  m[8] * m[3] * m[14] +
926  m[12] * m[2] * m[11] -
927  m[12] * m[3] * m[10];
928 
929  inv[9] =
930  -m[0] * m[9] * m[15] +
931  m[0] * m[11] * m[13] +
932  m[8] * m[1] * m[15] -
933  m[8] * m[3] * m[13] -
934  m[12] * m[1] * m[11] +
935  m[12] * m[3] * m[9];
936 
937  inv[13] =
938  m[0] * m[9] * m[14] -
939  m[0] * m[10] * m[13] -
940  m[8] * m[1] * m[14] +
941  m[8] * m[2] * m[13] +
942  m[12] * m[1] * m[10] -
943  m[12] * m[2] * m[9];
944 
945  inv[2] =
946  m[1] * m[6] * m[15] -
947  m[1] * m[7] * m[14] -
948  m[5] * m[2] * m[15] +
949  m[5] * m[3] * m[14] +
950  m[13] * m[2] * m[7] -
951  m[13] * m[3] * m[6];
952 
953  inv[6] =
954  -m[0] * m[6] * m[15] +
955  m[0] * m[7] * m[14] +
956  m[4] * m[2] * m[15] -
957  m[4] * m[3] * m[14] -
958  m[12] * m[2] * m[7] +
959  m[12] * m[3] * m[6];
960 
961  inv[10] =
962  m[0] * m[5] * m[15] -
963  m[0] * m[7] * m[13] -
964  m[4] * m[1] * m[15] +
965  m[4] * m[3] * m[13] +
966  m[12] * m[1] * m[7] -
967  m[12] * m[3] * m[5];
968 
969  inv[14] =
970  -m[0] * m[5] * m[14] +
971  m[0] * m[6] * m[13] +
972  m[4] * m[1] * m[14] -
973  m[4] * m[2] * m[13] -
974  m[12] * m[1] * m[6] +
975  m[12] * m[2] * m[5];
976 
977  inv[3] =
978  -m[1] * m[6] * m[11] +
979  m[1] * m[7] * m[10] +
980  m[5] * m[2] * m[11] -
981  m[5] * m[3] * m[10] -
982  m[9] * m[2] * m[7] +
983  m[9] * m[3] * m[6];
984 
985  inv[7] =
986  m[0] * m[6] * m[11] -
987  m[0] * m[7] * m[10] -
988  m[4] * m[2] * m[11] +
989  m[4] * m[3] * m[10] +
990  m[8] * m[2] * m[7] -
991  m[8] * m[3] * m[6];
992 
993  inv[11] =
994  -m[0] * m[5] * m[11] +
995  m[0] * m[7] * m[9] +
996  m[4] * m[1] * m[11] -
997  m[4] * m[3] * m[9] -
998  m[8] * m[1] * m[7] +
999  m[8] * m[3] * m[5];
1000 
1001  inv[15] =
1002  m[0] * m[5] * m[10] -
1003  m[0] * m[6] * m[9] -
1004  m[4] * m[1] * m[10] +
1005  m[4] * m[2] * m[9] +
1006  m[8] * m[1] * m[6] -
1007  m[8] * m[2] * m[5];
1008 
1009  det = m[0] * inv[0] + m[1] * inv[4] + m[2] * inv[8] + m[3] * inv[12];
1010 
1011  if (det == 0)
1012  return -1;
1013 
1014  det = (f_t)1.0 / det;
1015 
1016  for (i = 0; i < 16; i++)
1017  result[i] = inv[i] * det;
1018 
1019  return 0;
1020 }
1021 
1022 // Initialize Alpha Filter alpha and beta values
1023 void LPFO0_init_Vec3( sLpfO0 *lpf, f_t dt, f_t cornerFreqHz, const ixVector3 initVal )
1024 {
1025  f_t dc;
1026 
1027  memset( lpf, 0, sizeof(sLpfO0) );
1028  cpy_Vec3_Vec3( lpf->v, initVal );
1029 
1030  dc = dt * cornerFreqHz;
1031  lpf->alpha = dc / (1.0f + dc);
1032  lpf->beta = 1.0f - lpf->alpha;
1033 }
1034 
1035 // Low-Pass Alpha Filter
1036 void LPFO0_Vec3( sLpfO0 *lpf, const ixVector3 input )
1037 {
1038  // v[n+1] = beta*v[n] + alpha*input
1039  O0_LPF_Vec3( lpf->v, input, lpf->alpha, lpf->beta );
1040 }
1041 
1042 
1043 
void transpose_Mat2(ixMatrix2 result, const ixMatrix2 m)
Definition: ISMatrix.c:778
d
double ixVector2d[2]
Definition: ISConstants.h:788
void add_Vec4d_Vec4d(ixVector4d result, const ixVector4d v1, const ixVector4d v2)
Definition: ISMatrix.c:704
char solve_lower(f_t *result, i_t n, f_t *A, f_t *b)
Definition: ISMatrix.c:222
void div_Vec4d_X(ixVector4d result, const ixVector4d v, const double x)
Definition: ISMatrix.c:666
void mul_Vec4d_X(ixVector4d result, const ixVector4d v, const double x)
Definition: ISMatrix.c:642
def lpf(data, cornerFreqHz, dt=None, time=None, initVal=None)
Definition: filterTools.py:89
void abs_Vec4d(ixVector4d result, const ixVector4d v)
Definition: ISMatrix.c:556
f_t ixVector3[3]
Definition: ISConstants.h:791
void mul_Mat4x4_Vec4x1(ixVector4 result, const ixMatrix4 m, const ixVector4 v)
Definition: ISMatrix.c:444
void mul_Mat3x3_Trans_Mat3x3_d(ixMatrix3d result, const ixMatrix3d m1, const ixMatrix3d m2)
Definition: ISMatrix.c:370
float f_t
Definition: ISConstants.h:786
void mul_Vec3_Vec3(ixVector3 result, const ixVector3 v1, const ixVector3 v2)
Definition: ISMatrix.c:492
void LPFO0_init_Vec3(sLpfO0 *lpf, f_t dt, f_t cornerFreqHz, const ixVector3 initVal)
Definition: ISMatrix.c:1023
void cross_Vec3(ixVector3 result, const ixVector3 v1, const ixVector3 v2)
Definition: ISMatrix.c:594
ixVector3 v
Definition: ISMatrix.h:68
static __inline void zero_MatMxN(f_t *M, i_t m, i_t n)
Definition: ISMatrix.h:417
f_t dot_Vec4_Vec4(const ixVector4 v1, const ixVector4 v2)
Definition: ISMatrix.c:584
f_t dot_Vec3_Vec3(const ixVector3 v1, const ixVector3 v2)
Definition: ISMatrix.c:570
void div_Vec3_Vec3(ixVector3 result, const ixVector3 v1, const ixVector3 v2)
Definition: ISMatrix.c:734
XmlRpcServer s
void div_Vec4_Vec4(ixVector4 result, const ixVector4 v1, const ixVector4 v2)
Definition: ISMatrix.c:741
void neg_Vec3(ixVector3 result, const ixVector3 v)
Definition: ISMatrix.c:749
void mul_Mat4x4_Trans_Vec4x1(ixVector4 result, const ixMatrix4 m, const ixVector4 v)
Definition: ISMatrix.c:452
#define NULL
Definition: nm_bsp.h:52
void abs_Vec2(ixVector2 result, const ixVector2 v)
Definition: ISMatrix.c:522
f_t ixMatrix4[16]
Definition: ISConstants.h:800
int i_t
Definition: ISConstants.h:787
void abs_Vec2d(ixVector2d result, const ixVector2d v)
Definition: ISMatrix.c:528
void transpose_Mat4(ixMatrix4 result, const ixMatrix4 m)
Definition: ISMatrix.c:804
void mul_Mat3x3_Vec3x1(ixVector3 result, const ixMatrix3 m, const ixVector3 v)
Definition: ISMatrix.c:430
void transpose_Mat3(ixMatrix3 result, const ixMatrix3 m)
Definition: ISMatrix.c:788
void mul_Mat3x3_Mat3x3_Trans(ixMatrix3 result, const ixMatrix3 m1, const ixMatrix3 m2)
Definition: ISMatrix.c:386
void cpy_MatRxC_MatMxN(f_t *result, i_t r, i_t c, i_t r_offset, i_t c_offset, f_t *A, i_t m, i_t n)
Definition: ISMatrix.c:756
f_t ixVector2[2]
Definition: ISConstants.h:789
void sqrt_Vec4(ixVector4 result, const ixVector4 v)
Definition: ISMatrix.c:514
void sqrt_Vec3(ixVector3 result, const ixVector3 v)
Definition: ISMatrix.c:507
double ixVector3d[3]
Definition: ISConstants.h:790
void abs_Vec4(ixVector4 result, const ixVector4 v)
Definition: ISMatrix.c:548
void sub_Vec3d_Vec3d(ixVector3d result, const ixVector3d v1, const ixVector3d v2)
Definition: ISMatrix.c:719
static __inline char is_zero(const f_t *f)
Definition: ISMatrix.h:92
f_t ixMatrix2[4]
Definition: ISConstants.h:798
void sub_Vec3_Vec3(ixVector3 result, const ixVector3 v1, const ixVector3 v2)
Definition: ISMatrix.c:712
double ixVector4d[4]
Definition: ISConstants.h:792
void mul_Vec4_Vec4(ixVector4 result, const ixVector4 v1, const ixVector4 v2)
Definition: ISMatrix.c:499
#define FREE(m)
Definition: ISConstants.h:138
#define _SQRT
Definition: ISConstants.h:776
static __inline void cpy_MatMxN(f_t *result, const f_t *M, i_t m, i_t n)
Definition: ISMatrix.h:484
void div_Vec3_X(ixVector3 result, const ixVector3 v, const f_t x)
Definition: ISMatrix.c:650
void abs_Vec3d(ixVector3d result, const ixVector3d v)
Definition: ISMatrix.c:541
char inv_Mat2(ixMatrix2 result, ixMatrix2 m)
Definition: ISMatrix.c:828
void abs_Vec3(ixVector3 result, const ixVector3 v)
Definition: ISMatrix.c:534
void mul_Mat3x3_Trans_Vec3x1(ixVector3 result, const ixMatrix3 m, const ixVector3 v)
Definition: ISMatrix.c:437
void add_K1Vec3_K2Vec3(ixVector3 result, const ixVector3 v1, const ixVector3 v2, float k1, float k2)
Definition: ISMatrix.c:689
void add_Vec3d_Vec3d(ixVector3d result, const ixVector3d v1, const ixVector3d v2)
Definition: ISMatrix.c:682
double ixMatrix3d[9]
Definition: ISConstants.h:802
void mul_Mat3x3_Mat3x3(ixMatrix3 result, const ixMatrix3 m1, const ixMatrix3 m2)
Definition: ISMatrix.c:322
f_t beta
Definition: ISMatrix.h:70
void mul_MatMxN(void *result, const void *A_ptr, const void *B_ptr, i_t m, i_t n, i_t p, char transpose_B, char add)
Definition: ISMatrix.c:22
void mul_Vec3_X(ixVector3 result, const ixVector3 v, const f_t x)
Definition: ISMatrix.c:620
void LPFO0_Vec3(sLpfO0 *lpf, const ixVector3 input)
Definition: ISMatrix.c:1036
void mul_Vec3d_X(ixVector3d result, const ixVector3d v, const double x)
Definition: ISMatrix.c:627
#define MALLOC(m)
Definition: ISConstants.h:136
char inv_Mat4(ixMatrix4 result, const ixMatrix4 m)
Definition: ISMatrix.c:876
f_t ixMatrix3[9]
Definition: ISConstants.h:799
void add_Vec4_Vec4(ixVector4 result, const ixVector4 v1, const ixVector4 v2)
Definition: ISMatrix.c:696
char inv_MatN(f_t *result, const f_t *M, i_t n)
Definition: ISMatrix.c:258
void mul_Mat3x3_Trans_Mat3x3(ixMatrix3 result, const ixMatrix3 m1, const ixMatrix3 m2)
Definition: ISMatrix.c:354
static __inline void O0_LPF_Vec3(ixVector3 result, const ixVector3 input, f_t alph, f_t beta)
Definition: ISMatrix.h:730
void mul_Mat2x2_Vec2x1(ixVector2 result, const ixMatrix2 m, const ixVector2 v)
Definition: ISMatrix.c:418
void mul_Mat3x3_Mat3x3_d(ixMatrix3d result, const ixMatrix3d m1, const ixMatrix3d m2)
Definition: ISMatrix.c:338
void neg_Mat3x3(ixMatrix3 result, const ixMatrix3 m)
Definition: ISMatrix.c:460
void mul_Mat3x3_Mat3x3_Trans_d(ixMatrix3d result, const ixMatrix3d m1, const ixMatrix3d m2)
Definition: ISMatrix.c:402
void mul_Vec3x1_Vec1x3(ixMatrix3 result, const ixVector3 v1, const ixVector3 v2)
Definition: ISMatrix.c:476
f_t dot_Vec2_Vec2(const ixVector2 v1, const ixVector2 v2)
Definition: ISMatrix.c:564
void mul_Vec4_X(ixVector4 result, const ixVector4 v, const f_t x)
Definition: ISMatrix.c:634
double dot_Vec3d_Vec3d(const ixVector3d v1, const ixVector3d v2)
Definition: ISMatrix.c:577
void LU(const f_t *M, i_t n, f_t *L, f_t *U)
Definition: ISMatrix.c:130
void mul_Vec2d_X(ixVector2d result, const ixVector2d v, const double x)
Definition: ISMatrix.c:614
f_t alpha
Definition: ISMatrix.h:69
char solve_upper(f_t *result, i_t n, f_t *A, f_t *b)
Definition: ISMatrix.c:187
void add_Vec3_Vec3(ixVector3 result, const ixVector3 v1, const ixVector3 v2)
Definition: ISMatrix.c:675
f_t ixVector4[4]
Definition: ISConstants.h:793
char inv_Mat3(ixMatrix3 result, const ixMatrix3 m)
Definition: ISMatrix.c:847
void sub_Vec4_Vec4(ixVector4 result, const ixVector4 v1, const ixVector4 v2)
Definition: ISMatrix.c:726
void div_Vec4_X(ixVector4 result, const ixVector4 v, const f_t x)
Definition: ISMatrix.c:658
#define _FABS
Definition: ISConstants.h:777
void eye_MatN(f_t *A, i_t n)
Definition: ISMatrix.c:119
void mul_Vec2_X(ixVector2 result, const ixVector2 v, const f_t x)
Definition: ISMatrix.c:608
static __inline void cpy_Vec3_Vec3(ixVector3 result, const ixVector3 v)
Definition: ISMatrix.h:426
void mul_Mat2x2_Trans_Vec2x1(ixVector2 result, const ixMatrix2 m, const ixVector2 v)
Definition: ISMatrix.c:424
void trans_MatMxN(f_t *result, const f_t *M, int m, int n)
Definition: ISMatrix.c:298
void crossd_Vec3(ixVector3d result, const ixVector3 v1, const ixVector3 v2)
Definition: ISMatrix.c:601


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57