Exemplo n.º 1
0
/**
* Allocate and populate a new PCSTATS from the raw data in
* a PCDOUBLESTATS
*/
static PCSTATS *
pc_stats_new_from_dstats(const PCSCHEMA *schema, const PCDOUBLESTATS *dstats)
{
    int i;
    PCSTATS *stats = pc_stats_new(schema);

    for ( i = 0; i < schema->ndims; i++ )
    {
        pc_point_set_double(&(stats->min), schema->dims[i], dstats->dims[i].min);
        pc_point_set_double(&(stats->max), schema->dims[i], dstats->dims[i].max);
        pc_point_set_double(&(stats->avg), schema->dims[i], dstats->dims[i].sum / dstats->npoints);
    }
    return stats;
}
Exemplo n.º 2
0
int
pc_point_set_double_by_name(PCPOINT *pt, const char *name, double val)
{
	PCDIMENSION *d;
	d = pc_schema_get_dimension_by_name(pt->schema, name);
	return pc_point_set_double(pt, d, val);
}
Exemplo n.º 3
0
int
pc_point_set_double_by_index(PCPOINT *pt, uint32_t idx, double val)
{
	PCDIMENSION *d;
	d = pc_schema_get_dimension(pt->schema, idx);
	return pc_point_set_double(pt, d, val);
}
Exemplo n.º 4
0
int
pc_point_set_m(PCPOINT *pt, double val)
{
	return pc_point_set_double(pt, pt->schema->mdim, val);
}