test_bufferedhistogram2d.cxx
Go to the documentation of this file.
2 #include "WireCellUtil/Testing.h"
3 
4 #include <vector>
5 #include <iostream>
6 
7 using namespace WireCell;
8 using namespace std;
9 
10 int main()
11 {
13  Assert(hist.popx().size() == 0);
14  Assert(false == hist.fill(-1,-1,0));
15  Assert(hist.xmin() == 0.0);
16  Assert(hist.ymin() == 0.0);
17 
18  cerr << "mins: " << hist.xmin() << " " << hist.ymin() << endl;
19 
20  Assert(hist.fill(0.5,3.5));
21  vector<double> dat = hist.popx();
22 
23  cerr << "dat size " << dat.size() << endl;
24 
25  Assert(dat.size() == 4);
26  Assert(dat[3] == 1.0);
27  Assert(hist.xmin() == 1.0);
28  Assert(hist.ymin() == 0.0);
29 
30 
31 }
bool fill(double x, double y, double v=1.0)
Add v to the bin holding x,y. Return false if point is out of bounds.
STL namespace.
#define Assert
Definition: Testing.h:7
Definition: Main.h:22
QTextStream & endl(QTextStream &s)