~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/geomstat/state/state_crct.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 #include <tina/sys.h>
  4 #include <tina/math.h>
  5 #include <tina/mathfuncs.h>
  6 #include <tina/vision.h>
  7 #include <tina/visionfuncs.h>
  8 
  9 Vector *vector_diff();
 10 
 11 void    state_correct(State * state)
 12 {
 13     int     i;
 14     int     maxindex = state->maxindex;
 15     int    *type = state->type->data;
 16     void  **geom = state->geom->data;
 17     void  **basis = state->basis->data;
 18     Vector **x = (Vector **) state->x->data;
 19     Vector **m = (Vector **) state->m->data;
 20 
 21 
 22     for (i = 0; i < maxindex; i++)
 23     {
 24         Vector *mi;
 25 
 26         geom_correct(geom[i], type[i], basis[i], x[i]);
 27         mi = vector_diff(m[i], x[i]);
 28         vector_free(m[i]);
 29         m[i] = mi;              /** need an inplace diff **/
 30         vector_free(x[i]);
 31         x[i] = NULL;
 32     }
 33 }
 34 
 35 void    state_correct_one(State * state, int i)
 36 {
 37     int     type = vector_get(state->type, i);
 38     void   *geom = vector_getp(state->geom, i);
 39     void   *basis = vector_getp(state->basis, i);
 40     Vector *x = (Vector *) vector_getp(state->x, i);
 41     Vector *m = (Vector *) vector_getp(state->m, i);
 42 
 43     geom_correct(geom, type, basis, x);
 44     vector_putp((void *) vector_diff(m, x), state->m, i);
 45     vector_free(m);             /** need an inplace diff **/
 46     vector_putp(NULL, state->x, i);
 47     vector_free(x);
 48 }
 49 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.