/* Last edited on 2005-06-05 12:40:28 by stolfi */ /* INDEX ROLL OPERATION - CORRECT BUT TOO CONFUSING TO BE USEFUL */ void ppv_roll ( ppv_array_t *A, ppv_axis_t i, ppv_axis_t j, int n ); /* Modifies the descriptor {A} so that it describes the same samples as before, with indices {i..j} cyclically shifted by {n} places forward. Thus, element {A[c,h,v,d,t,u]} before the call {ppv_roll(A, 2,4, 1)} is equivalent to element {A[c,h,t,v,d,u]} after the call. If the shift {n} is negative, or greater than {M=j-i+1}, it is reduced modulo {M} to the range {0..j-i}. */ void ppv_roll ( ppv_array_t *A, ppv_axis_t i, ppv_axis_t j, int n ) { ix_roll(N, A->size, &(A->base), A->step, i, j, n); } /* ERROR MESSAGES */ void ppv_progerror ( const char *msg, const char *file, const unsigned int line, const char* proc ); /* Prints {file ":" line ": (" *proc ")" *msg} to {stderr} and stops. */ #define ppv_error(msg) \ ppv_progerror((msg), __FILE__, __LINE__, __FUNCTION__) /* Prints {*msg} and the source location. */ void ppv_progerror ( const char *msg, const char *file, const unsigned int line, const char* proc ) { fprintf (stderr, "%s:%u: *** (%s) %s\n", file, line, proc, msg); exit(1); }