11 int all_is(
int *a,
int n,
int v);
20 for(i=0;i<m->size1;i++) {
22 for(j=0;j<m->size2;j++) {
23 double v = gsl_matrix_get(m,i,j);
31 for(j=0;j<m->size2;j++) {
32 double v = gsl_matrix_get(m,i,j);
81 for(j=0;j<vec->size;j++) {
82 double v = gsl_vector_get(vec,j);
90 int array[2] = {tv->tv_sec, tv->tv_usec};
118 int i;
for(i=0;i<n;i++)
if(v[i]==v[i])
return 0;
130 int i;
for(i=0;i<n;i++)
if(a[i]!=v)
return 0;
163 int timeval[2] = {ld->
tv.tv_sec, ld->
tv.tv_usec};
173 sm_error(
"Could not read nrays.\n");
186 {
sm_error(
"Error while reading field 'readings_sigma'.\n");
return 0; }
192 {
sm_error(
"Error while reading field alpha.\n");
return 0; }
195 {
sm_error(
"Error while reading field cov_alpha.\n");
return 0; }
198 {
sm_error(
"Error while reading field alpha_valid.\n");
return 0; }
201 {
sm_error(
"Error while reading field true_alpha.\n");
return 0; }
208 int array[2] = {-1,-1};
210 ld->
tv.tv_sec = array[0];
211 ld->
tv.tv_usec = array[1];
238 fprintf(stderr,
" (!)\n");
241 fprintf(stderr,
" EOF\n");
253 fprintf(stderr,
"l");
260 sm_error(
"Writing bad data to the stream.\n");
double *restrict cov_alpha
JO vector_to_json(gsl_vector *vec)
void ld_write_as_json(LDP ld, FILE *stream)
double *restrict readings_sigma
int is_all_nan(const double *v, int n)
void jo_add_timestamp(JO jo, const char *name, struct timeval *tv)
void jo_add_int_array(JO root, const char *name, const int *v, int n)
int jo_read_double(JO jo, const char *name, double *p)
int ld_valid_fields(LDP ld)
enum correspondence::@5 type
int json_object_array_add(struct json_object *this, struct json_object *val)
double *restrict true_alpha
double *restrict readings
JO result_to_json(struct sm_params *p, struct sm_result *r)
LDP ld_from_json_stream(FILE *file)
const char * json_object_to_json_string(struct json_object *this)
int *restrict alpha_valid
struct json_object * json_object_new_array()
JO matrix_to_json(gsl_matrix *m)
int jo_read_double_array(JO s, const char *name, double *p, int n, double when_null)
struct json_object * json_object_new_object()
void jo_add_double_array(JO root, const char *name, const double *v, int n)
void jo_add_double_array_if_not_nan(JO jo, const char *name, const double *v, int n)
JO json_parse(const char *str)
JO corr_to_json(struct correspondence *corr, int n)
int all_is(int *a, int n, int v)
void jo_add_double(JO root, const char *name, double v)
int do_compute_covariance
int json_to_corr(JO array, struct correspondence *corr, int n)
JO json_read_stream(FILE *f)
LDP ld_alloc_new(int nrays)
struct json_object * json_object_array_get_idx(struct json_object *this, int idx)
LDP ld_from_json_string(const char *s)
void sm_error(const char *msg,...)
int jo_read_int_array(JO s, const char *name, int *p, int n, int when_null)
int jo_read_int(JO jo, const char *name, int *p)
void jo_add_int(JO root, const char *name, int v)
JO jo_double_or_null(double v)
int jo_has_field(JO s, const char *name)