Commit 9560818a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Refactor class HistogramSet.

parent a940ed90
......@@ -23,26 +23,24 @@
#include <cdi.h>
#include "functs.h"
#include "process_int.h"
#include "cdo_vlist.h"
#include "param_conversion.h"
#include "percentiles_hist.h"
#include "percentiles.h"
#include "datetime.h"
#include "cdo_season.h"
void *
Seaspctl(void *process)
{
TimeStat timestat_date = TimeStat::MEAN;
int nrecs;
int gridID, varID, levelID;
int varID, levelID;
int year, month, day, seas0 = 0;
size_t nmiss;
int nlevels;
int oldmon = 0;
int season_start;
......@@ -96,14 +94,13 @@ Seaspctl(void *process)
FieldVector2D vars1;
fieldsFromVlist(vlistID1, vars1, FIELD_VEC);
HISTOGRAM_SET *hset = hsetCreate(nvars);
HistogramSet hset(nvars);
for (varID = 0; varID < nvars; varID++)
{
gridID = vlistInqVarGrid(vlistID1, varID);
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsetCreateVarLevels(hset, varID, nlevels, gridID);
auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hset.createVarLevels(varID, nlevels, gridsize);
}
int tsID = 0;
......@@ -135,7 +132,7 @@ Seaspctl(void *process)
field.grid = vars1[varID][levelID].grid;
field.missval = vars1[varID][levelID].missval;
hsetDefVarLevelBounds(hset, varID, levelID, &vars1[varID][levelID], &field);
hset.defVarLevelBounds(varID, levelID, vars1[varID][levelID], field);
}
int nsets = 0;
......@@ -176,7 +173,7 @@ Seaspctl(void *process)
cdoReadRecord(streamID1, vars1[varID][levelID].vec.data(), &nmiss);
vars1[varID][levelID].nmiss = nmiss;
hsetAddVarLevelValues(hset, varID, levelID, &vars1[varID][levelID]);
hset.addVarLevelValues(varID, levelID, vars1[varID][levelID]);
}
nsets++;
......@@ -188,10 +185,10 @@ Seaspctl(void *process)
for (varID = 0; varID < nvars; varID++)
{
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
const auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
hsetGetVarLevelPercentiles(&vars1[varID][levelID], hset, varID, levelID, pn);
hset.getVarLevelPercentiles(vars1[varID][levelID], varID, levelID, pn);
}
dtlist.statTaxisDefTimestep(taxisID4, nsets);
......@@ -211,8 +208,6 @@ Seaspctl(void *process)
otsID++;
}
hsetDestroy(hset);
cdoStreamClose(streamID4);
cdoStreamClose(streamID3);
cdoStreamClose(streamID2);
......
......@@ -43,9 +43,8 @@ timpctl(int operatorID)
TimeStat timestat_date = TimeStat::MEAN;
char indate1[DATE_LEN + 1], indate2[DATE_LEN + 1];
int nrecs;
int gridID, varID, levelID;
int varID, levelID;
size_t nmiss;
int nlevels;
operatorInputArg("percentile number");
const auto pn = parameter2double(cdoOperatorArgv(0));
......@@ -95,14 +94,13 @@ timpctl(int operatorID)
FieldVector2D vars1;
fieldsFromVlist(vlistID1, vars1, FIELD_VEC);
HISTOGRAM_SET *hset = hsetCreate(nvars);
HistogramSet hset(nvars);
for (varID = 0; varID < nvars; varID++)
{
gridID = vlistInqVarGrid(vlistID1, varID);
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsetCreateVarLevels(hset, varID, nlevels, gridID);
auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hset.createVarLevels(varID, nlevels, gridsize);
}
int tsID = 0;
......@@ -134,7 +132,7 @@ timpctl(int operatorID)
field.grid = vars1[varID][levelID].grid;
field.missval = vars1[varID][levelID].missval;
hsetDefVarLevelBounds(hset, varID, levelID, &vars1[varID][levelID], &field);
hset.defVarLevelBounds(varID, levelID, vars1[varID][levelID], field);
}
int nsets = 0;
......@@ -161,7 +159,7 @@ timpctl(int operatorID)
cdoReadRecord(streamID1, vars1[varID][levelID].vec.data(), &nmiss);
vars1[varID][levelID].nmiss = nmiss;
hsetAddVarLevelValues(hset, varID, levelID, &vars1[varID][levelID]);
hset.addVarLevelValues(varID, levelID, vars1[varID][levelID]);
}
nsets++;
......@@ -173,10 +171,10 @@ timpctl(int operatorID)
for (varID = 0; varID < nvars; varID++)
{
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
const auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
hsetGetVarLevelPercentiles(&vars1[varID][levelID], hset, varID, levelID, pn);
hset.getVarLevelPercentiles(vars1[varID][levelID], varID, levelID, pn);
}
dtlist.statTaxisDefTimestep(taxisID4, nsets);
......@@ -196,8 +194,6 @@ timpctl(int operatorID)
otsID++;
}
hsetDestroy(hset);
cdoStreamClose(streamID4);
cdoStreamClose(streamID3);
cdoStreamClose(streamID2);
......
......@@ -23,7 +23,6 @@
#include <cdi.h>
#include "cdo_options.h"
#include "functs.h"
#include "process_int.h"
......@@ -33,15 +32,15 @@
#include "percentiles.h"
#include "datetime.h"
void *
Timselpctl(void *process)
{
TimeStat timestat_date = TimeStat::MEAN;
int nrecs = 0;
int gridID, varID, levelID;
int varID, levelID;
int tsID;
size_t nmiss;
int nlevels;
cdoInitialize(process);
......@@ -101,14 +100,13 @@ Timselpctl(void *process)
FieldVector2D vars1;
fieldsFromVlist(vlistID1, vars1, FIELD_VEC);
HISTOGRAM_SET *hset = hsetCreate(nvars);
HistogramSet hset(nvars);
for (varID = 0; varID < nvars; varID++)
{
gridID = vlistInqVarGrid(vlistID1, varID);
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsetCreateVarLevels(hset, varID, nlevels, gridID);
auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hset.createVarLevels(varID, nlevels, gridsize);
}
for (tsID = 0; tsID < noffset; tsID++)
......@@ -163,7 +161,7 @@ Timselpctl(void *process)
field.grid = vars1[varID][levelID].grid;
field.missval = vars1[varID][levelID].missval;
hsetDefVarLevelBounds(hset, varID, levelID, &vars1[varID][levelID], &field);
hset.defVarLevelBounds(varID, levelID, vars1[varID][levelID], field);
}
int nsets = 0;
......@@ -189,7 +187,7 @@ Timselpctl(void *process)
cdoReadRecord(streamID1, vars1[varID][levelID].vec.data(), &nmiss);
vars1[varID][levelID].nmiss = nmiss;
hsetAddVarLevelValues(hset, varID, levelID, &vars1[varID][levelID]);
hset.addVarLevelValues(varID, levelID, vars1[varID][levelID]);
}
tsID++;
......@@ -200,10 +198,10 @@ Timselpctl(void *process)
for (varID = 0; varID < nvars; varID++)
{
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
const auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
hsetGetVarLevelPercentiles(&vars1[varID][levelID], hset, varID, levelID, pn);
hset.getVarLevelPercentiles(vars1[varID][levelID], varID, levelID, pn);
}
dtlist.statTaxisDefTimestep(taxisID4, nsets);
......@@ -234,8 +232,6 @@ Timselpctl(void *process)
LABEL_END:
hsetDestroy(hset);
cdoStreamClose(streamID4);
cdoStreamClose(streamID3);
cdoStreamClose(streamID2);
......
......@@ -40,17 +40,15 @@ void *
Ydaypctl(void *process)
{
int varID;
int gridID;
int year, month, day;
int nrecs;
int levelID;
size_t nmiss;
int nlevels;
int64_t vdates1[MAX_DAYS], vdates2[MAX_DAYS];
int vtimes1[MAX_DAYS];
long nsets[MAX_DAYS];
FieldVector2D vars1[MAX_DAYS];
HISTOGRAM_SET *hsets[MAX_DAYS];
HistogramSet hsets[MAX_DAYS];
cdoInitialize(process);
cdoOperatorAdd("ydaypctl", func_pctl, 0, nullptr);
......@@ -59,11 +57,7 @@ Ydaypctl(void *process)
const auto pn = parameter2double(cdoOperatorArgv(0));
percentile_check_number(pn);
for (int dayoy = 0; dayoy < MAX_DAYS; dayoy++)
{
hsets[dayoy] = nullptr;
nsets[dayoy] = 0;
}
for (int dayoy = 0; dayoy < MAX_DAYS; dayoy++) nsets[dayoy] = 0;
const auto streamID1 = cdoOpenRead(0);
const auto streamID2 = cdoOpenRead(1);
......@@ -123,14 +117,13 @@ Ydaypctl(void *process)
if (!vars1[dayoy].size())
{
fieldsFromVlist(vlistID1, vars1[dayoy], FIELD_VEC);
hsets[dayoy] = hsetCreate(nvars);
hsets[dayoy].create(nvars);
for (varID = 0; varID < nvars; varID++)
{
gridID = vlistInqVarGrid(vlistID1, varID);
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsetCreateVarLevels(hsets[dayoy], varID, nlevels, gridID);
auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsets[dayoy].createVarLevels(varID, nlevels, gridsize);
}
}
......@@ -148,7 +141,7 @@ Ydaypctl(void *process)
field.grid = vars1[dayoy][varID][levelID].grid;
field.missval = vars1[dayoy][varID][levelID].missval;
hsetDefVarLevelBounds(hsets[dayoy], varID, levelID, &vars1[dayoy][varID][levelID], &field);
hsets[dayoy].defVarLevelBounds(varID, levelID, vars1[dayoy][varID][levelID], field);
}
tsID++;
......@@ -186,7 +179,7 @@ Ydaypctl(void *process)
cdoReadRecord(streamID1, vars1[dayoy][varID][levelID].vec.data(), &nmiss);
vars1[dayoy][varID][levelID].nmiss = nmiss;
hsetAddVarLevelValues(hsets[dayoy], varID, levelID, &vars1[dayoy][varID][levelID]);
hsets[dayoy].addVarLevelValues(varID, levelID, vars1[dayoy][varID][levelID]);
}
nsets[dayoy]++;
......@@ -204,10 +197,10 @@ Ydaypctl(void *process)
for (varID = 0; varID < nvars; varID++)
{
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
const auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
hsetGetVarLevelPercentiles(&vars1[dayoy][varID][levelID], hsets[dayoy], varID, levelID, pn);
hsets[dayoy].getVarLevelPercentiles(vars1[dayoy][varID][levelID], varID, levelID, pn);
}
taxisDefVdate(taxisID4, vdates1[dayoy]);
......@@ -227,9 +220,6 @@ Ydaypctl(void *process)
otsID++;
}
for (int dayoy = 0; dayoy < MAX_DAYS; dayoy++)
if (vars1[dayoy].size()) hsetDestroy(hsets[dayoy]);
cdoStreamClose(streamID4);
cdoStreamClose(streamID3);
cdoStreamClose(streamID2);
......
......@@ -48,18 +48,16 @@ void *
Ydrunpctl(void *process)
{
int varID;
int gridID;
int nrecs;
int levelID;
int inp, its;
size_t nmiss;
int nlevels;
int year, month, day;
int64_t vdates1[MAX_DAYS], vdates2[MAX_DAYS];
int vtimes1[MAX_DAYS] /*, vtimes2[MAX_DAYS]*/;
int nsets[MAX_DAYS];
FieldVector2D vars2[MAX_DAYS];
HISTOGRAM_SET *hsets[MAX_DAYS];
HistogramSet hsets[MAX_DAYS];
cdoInitialize(process);
cdoOperatorAdd("ydrunpctl", func_pctl, 0, nullptr);
......@@ -138,14 +136,13 @@ Ydrunpctl(void *process)
if (!vars2[dayoy].size())
{
fieldsFromVlist(vlistID2, vars2[dayoy], FIELD_VEC);
hsets[dayoy] = hsetCreate(nvars);
hsets[dayoy].create(nvars);
for (varID = 0; varID < nvars; varID++)
{
gridID = vlistInqVarGrid(vlistID2, varID);
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
hsetCreateVarLevels(hsets[dayoy], varID, nlevels, gridID);
auto gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
hsets[dayoy].createVarLevels(varID, nlevels, gridsize);
}
}
......@@ -163,7 +160,7 @@ Ydrunpctl(void *process)
field.grid = vars2[dayoy][varID][levelID].grid;
field.missval = vars2[dayoy][varID][levelID].missval;
hsetDefVarLevelBounds(hsets[dayoy], varID, levelID, &vars2[dayoy][varID][levelID], &field);
hsets[dayoy].defVarLevelBounds(varID, levelID, vars2[dayoy][varID][levelID], field);
}
tsID++;
......@@ -213,10 +210,10 @@ Ydrunpctl(void *process)
for (varID = 0; varID < nvars; varID++)
{
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
const auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
for (inp = 0; inp < ndates; inp++) hsetAddVarLevelValues(hsets[dayoy], varID, levelID, &vars1[inp][varID][levelID]);
for (inp = 0; inp < ndates; inp++) hsets[dayoy].addVarLevelValues(varID, levelID, vars1[inp][varID][levelID]);
}
datetime[ndates] = datetime[0];
......@@ -274,10 +271,10 @@ Ydrunpctl(void *process)
for (varID = 0; varID < nvars; varID++)
{
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
const auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
hsetGetVarLevelPercentiles(&vars2[dayoy][varID][levelID], hsets[dayoy], varID, levelID, pn);
hsets[dayoy].getVarLevelPercentiles(vars2[dayoy][varID][levelID], varID, levelID, pn);
}
taxisDefVdate(taxisID4, vdates1[dayoy]);
......@@ -297,9 +294,6 @@ Ydrunpctl(void *process)
otsID++;
}
for (int dayoy = 0; dayoy < MAX_DAYS; dayoy++)
if (vars2[dayoy].size()) hsetDestroy(hsets[dayoy]);
cdoStreamClose(streamID4);
cdoStreamClose(streamID3);
cdoStreamClose(streamID2);
......
......@@ -45,16 +45,15 @@ void *
Ymonpctl(void *process)
{
int varID;
int gridID;
int year, month, day;
int levelID;
size_t nmiss;
int nrecs, nlevels;
int nrecs;
int64_t vdates1[NMONTH], vdates2[NMONTH];
int vtimes1[NMONTH];
long nsets[NMONTH];
FieldVector2D vars1[NMONTH];
HISTOGRAM_SET *hsets[NMONTH];
HistogramSet hsets[NMONTH];
cdoInitialize(process);
cdoOperatorAdd("ymonpctl", func_pctl, 0, nullptr);
......@@ -63,11 +62,7 @@ Ymonpctl(void *process)
const auto pn = parameter2double(cdoOperatorArgv(0));
percentile_check_number(pn);
for (month = 0; month < NMONTH; month++)
{
hsets[month] = nullptr;
nsets[month] = 0;
}
for (month = 0; month < NMONTH; month++) nsets[month] = 0;
const auto streamID1 = cdoOpenRead(0);
const auto streamID2 = cdoOpenRead(1);
......@@ -125,14 +120,13 @@ Ymonpctl(void *process)
if (!vars1[month].size())
{
fieldsFromVlist(vlistID1, vars1[month], FIELD_VEC);
hsets[month] = hsetCreate(nvars);
hsets[month].create(nvars);
for (varID = 0; varID < nvars; varID++)
{
gridID = vlistInqVarGrid(vlistID1, varID);
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsetCreateVarLevels(hsets[month], varID, nlevels, gridID);
auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsets[month].createVarLevels(varID, nlevels, gridsize);
}
}
......@@ -150,7 +144,7 @@ Ymonpctl(void *process)
field.grid = vars1[month][varID][levelID].grid;
field.missval = vars1[month][varID][levelID].missval;
hsetDefVarLevelBounds(hsets[month], varID, levelID, &vars1[month][varID][levelID], &field);
hsets[month].defVarLevelBounds(varID, levelID, vars1[month][varID][levelID], field);
}
tsID++;
......@@ -186,7 +180,7 @@ Ymonpctl(void *process)
cdoReadRecord(streamID1, vars1[month][varID][levelID].vec.data(), &nmiss);
vars1[month][varID][levelID].nmiss = nmiss;
hsetAddVarLevelValues(hsets[month], varID, levelID, &vars1[month][varID][levelID]);
hsets[month].addVarLevelValues(varID, levelID, vars1[month][varID][levelID]);
}
nsets[month]++;
......@@ -204,10 +198,10 @@ Ymonpctl(void *process)
for (varID = 0; varID < nvars; varID++)
{
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
const auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
hsetGetVarLevelPercentiles(&vars1[month][varID][levelID], hsets[month], varID, levelID, pn);
hsets[month].getVarLevelPercentiles(vars1[month][varID][levelID], varID, levelID, pn);
}
taxisDefVdate(taxisID4, vdates1[month]);
......@@ -227,9 +221,6 @@ Ymonpctl(void *process)
otsID++;
}
for (month = 0; month < NMONTH; month++)
if (vars1[month].size()) hsetDestroy(hsets[month]);
cdoStreamClose(streamID4);
cdoStreamClose(streamID3);
cdoStreamClose(streamID2);
......
......@@ -48,16 +48,14 @@ void *
Yseaspctl(void *process)
{
int varID;
int gridID;
int year, month, day, seas;
int nrecs;
int levelID;
size_t nmiss;
int nlevels;
long nsets[NSEAS];
date_time_t datetime1[NSEAS], datetime2[NSEAS];
FieldVector2D vars1[NSEAS];
HISTOGRAM_SET *hsets[NSEAS];
HistogramSet hsets[NSEAS];
cdoInitialize(process);
cdoOperatorAdd("yseaspctl", func_pctl, 0, nullptr);
......@@ -68,7 +66,6 @@ Yseaspctl(void *process)
for (seas = 0; seas < NSEAS; seas++)
{
hsets[seas] = nullptr;
nsets[seas] = 0;
datetime1[seas].vdate = 0;
datetime1[seas].vtime = 0;
......@@ -134,14 +131,13 @@ Yseaspctl(void *process)
{
fieldsFromVlist(vlistID1, vars1[seas], FIELD_VEC);
hsets[seas] = hsetCreate(nvars);
hsets[seas].create(nvars);
for (varID = 0; varID < nvars; varID++)
{
gridID = vlistInqVarGrid(vlistID1, varID);
nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsetCreateVarLevels(hsets[seas], varID, nlevels, gridID);
auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
hsets[seas].createVarLevels(varID, nlevels, gridsize);
}
}
......@@ -158,7 +154,7 @@ Yseaspctl(void *process)
field.grid = vars1[seas][varID][levelID].grid;
field.missval = vars1[seas][varID][levelID].missval;
hsetDefVarLevelBounds(hsets[seas], varID, levelID, &vars1[seas][varID][levelID], &field);
hsets[seas].defVarLevelBounds(varID, levelID, vars1[seas][varID][levelID], field);
}
tsID++;
......@@ -193,7 +189,7 @@ Yseaspctl(void *process)
cdoReadRecord(streamID1, vars1[seas][varID][levelID].vec.data(), &nmiss);
vars1[seas][varID][levelID].nmiss = nmiss;
hsetAddVarLevelValues(hsets[seas], varID, levelID, &vars1[seas][varID][levelID]);
hsets[seas].addVarLevelValues(varID, levelID, vars1[seas][varID][levelID]);
}
nsets[seas]++;
......@@ -214,7 +210,7 @@ Yseaspctl(void *process)
const auto nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
hsetGetVarLevelPercentiles(&vars1[seas][varID][levelID], hsets[seas], varID, levelID, pn);
hsets[seas].getVarLevelPercentiles(vars1[seas][varID][levelID], varID, levelID, pn);
}
taxisDefVdate(taxisID4, datetime1[seas].vdate);
......@@ -234,9 +230,6 @@ Yseaspctl(void *process)
otsID++;
}
for (int seas = 0; seas < NSEAS; seas++)
if (vars1[seas].size()) hsetDestroy(hsets[seas]);
cdoStreamClose(streamID4);
cdoStreamClose(streamID3);
cdoStreamClose(streamID2);
......
......@@ -15,12 +15,10 @@
GNU General Public License for more details.
*/
#include <assert.h>
#include <stdlib.h>
#include <cdi.h>
#include "cdo_output.h"
#include "dmemory.h"
#include "cdo_math.h"
......@@ -43,324 +41,224 @@ histGetEnvNBins()
}
static void
histDefBounds(HISTOGRAM *hist, double a, double b)
histDefBounds(Histogram &hist, double a, double b)
{
assert(hist != nullptr);
assert(hist->nbins > 0);
assert(hist.nbins > 0);
hist->min = cdo::min(a, b);
hist->max = cdo::max(a, b);
hist->step = (hist->max - hist->min) / hist->nbins;
hist->nsamp = 0;
hist.min = cdo::min(a, b);
hist.max = cdo::max(a, b);
hist.step = (hist.max - hist.min) / hist.nbins;
hist.nsamp = 0;
for (int i = 0; i < hist->nbins; i++) INT_PTR(hist->ptr)[i] = 0;
for (int i = 0; i < hist.nbins; i++) INT_PTR(hist.ptr)[i] = 0;
}
static void
histBinValue(HISTOGRAM *hist, double value)
histBinValue(Histogram &hist, double value)