9 int inverse (
double *a,
int nsize);
10 int isymp(
int row,
int col);
15 inline int isymp(
int row,
int col)
24 if(row < col) k= row + col *(col -1)/2;
25 else k= col + row * (row - 1)/2;
99 for( i =0,j=0;i<set_size-1;i++,j=indeces[i-1]+1)
111 indeces[i] = j+
set-1;
118 int foresub (
double *,
double *,
int);
119 int backsub (
double *,
double *,
int);
122 #define NOT_SOLVABLE 0 135 if (flag < 1 && flag > 3)
141 if (flag == 1)
return SOLVED;
150 if (flag == 2)
return SOLVED;
174 int i, j, k, m, n = 2;
177 for (k = 0; k < nsize; k++)
183 for (i = 0; i < k; i++)
188 for (j = 0; j < i; j++)
190 sum += *ap4++ * *ap5++;
194 *ap3 = (*ap3 - sum) / *ap2;ap3++;
199 for (j = 0; j < k; j++)
201 sum += *ap1 * *ap1;ap1++;
209 if ((*ap6 - sum) <= 0)
210 *ap6 = sqrt(-(*ap6 - sum));
212 *ap6 = sqrt(*ap6 - sum);
224 inline int foresub (
double *a,
double *b,
int nsize)
235 for (i = 1; i < nsize; i++)
238 for (j = 0, bp2 = b; j < i; j++)
240 sum += *ap1++ * *bp2++;
244 *bp1 = (*bp1 - sum) / *ap1;bp1++;ap1++;
252 inline int backsub (
double *a,
double *b,
int nsize)
261 double *ap1 = a + (k + k * (k + 1) / 2);
262 double *ap2 = ap1 - 1;
270 *bp1 = *bp1 / *ap1;bp1--;
271 for (i = k - 1; i >= 0; i--)
275 for (j = nsize - 1, ap3 = ap2--, bp3 = bp2; j >= i + 1; j--)
277 sum += *ap3 * *bp3--;
283 *bp1 = (*bp1 - sum) / *ap1;bp1--;
305 while (ap1 < (a + (nsize * (nsize + 1)/2)))
313 for (i = 1; i < nsize; i++)
318 for (j = m; j <= nsize; j++)
325 sum += *ap1 * *ap2++;
329 *ap3 = -(*ap4) * sum;
337 ap1 = ap2 = ap3 = ap4 = a;
338 for (i = 0; i < nsize;)
342 for (j = i; j < nsize;)
345 ap1 = ap3 = ap5 + i + n;
348 for (k = j; k < nsize;)
int backsub(double *, double *, int)
Definition: Ransac.h:252
int choleski_solve(double *a, double *b, int nsize, int flag)
Definition: Ransac.h:126
int binomial_coeficient(int n, int k)
Definition: Ransac.h:31
#define NOT_SOLVABLE
Definition: Ransac.h:122
int decompose(double *, int)
Definition: Ransac.h:160
int inverse(double *a, int nsize)
Definition: Ransac.h:291
int isymp(int row, int col)
Definition: Ransac.h:15
int foresub(double *, double *, int)
Definition: Ransac.h:224
int indeces_from_set(int *indeces, int set, int set_size, int n)
Definition: Ransac.h:83
#define SOLVED
Definition: Ransac.h:121
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31