#include <iostream>
#include <limits>
#include <cmath>
#include "boost/shared_ptr.hpp"
namespace math = lsst::afw::math;
namespace geom = lsst::afw::geom;
template<typename Image>
sctrl);
double const min = stats.getValue(
math::MIN);
double const max = stats.getValue(
math::MAX);
std::cout << "N " << npoint << std::endl;
std::cout << "dmean " << dmean << std::endl;
std::cout << "mean: " << mean << std::endl;
std::cout << "meanclip: " << meanclip << std::endl;
std::cout << "var: " << var << std::endl;
std::cout << "varclip: " << varclip << std::endl;
std::cout << "stdev: " << sd << std::endl;
std::cout << "stdevclip: " << stdevclip << std::endl;
std::cout << "min: " << min << std::endl;
std::cout << "max: " << max << std::endl;
std::cout << "median: " << median << std::endl;
std::cout << "iqrange: " << iqrange << std::endl;
std::cout << std::endl;
}
int const wid = 1024;
MaskedImageF mimg(img.getDimensions());
std::vector<double> v(0);
MaskedVectorF mv(wid*wid);
for (int j = 0; j != img.getHeight(); ++j) {
int k = 0;
MaskedImageF::x_iterator mip = mimg.row_begin(j);
for (ImageF::x_iterator ip = img.row_begin(j); ip != img.row_end(j); ++ip) {
double const xUniform = M_PI*static_cast<ImageF::Pixel>(std::rand())/RAND_MAX;
double xLorentz = xUniform;
if ( static_cast<double>(std::rand())/RAND_MAX < 0.01 ) { xLorentz = NAN; }
*ip = xLorentz;
*mip = MaskedImageF::Pixel(xLorentz, (k%2) ? 0x1 : 0
x0, (k%2) ? 1.0e99 : 1.0);
v.push_back(xLorentz);
++k;
++mip;
}
}
int j = 0;
for (MaskedVectorF::iterator mvp = mv.begin(); mvp != mv.end(); ++mvp) {
*mvp = MaskedVectorF::Pixel(v[j], (j%2) ? 0x1 : 0
x0, 10.0);
++j;
}
boost::shared_ptr<std::vector<float> > vF = mv.getVector();
std::cout << "image::Image" << std::endl;
printStats(img, sctrl);
std::cout << "image::MaskedImage" << std::endl;
printStats(mimg, sctrl);
std::cout << "std::vector" << std::endl;
printStats(v, sctrl);
std::cout << "image::MaskedVector" << std::endl;
printStats(mv, sctrl);
std::cout << "image::MaskedVector::getVector()" << std::endl;
printStats(*vF, sctrl);
std::cout << "image::MaskedImage (weighted)" << std::endl;
printStats(mimg, sctrl);
std::cout << "image::Mask" << std::endl;
return 0;
}