int main()
{
using MeasurementType = int;
constexpr unsigned int MeasurementVectorLength = 2;
using MeasurementVectorType =
SampleType::Pointer sample = SampleType::New();
sample->SetMeasurementVectorSize( MeasurementVectorLength );
MeasurementVectorType mv;
for (unsigned int i = 1; i < 6; ++i)
{
for (unsigned int j = 0; j < 2; ++j)
{
mv[j] = ( MeasurementType ) i;
}
for (unsigned int j = 0; j < i; ++j)
{
sample->PushBack(mv);
}
}
SamplerType::Pointer sampler = SamplerType::New();
sampler->SetInputSample( sample );
SamplerType::CenterType center( MeasurementVectorLength );
center[0] = 3;
center[1] = 3;
double radius = 1.5;
sampler->SetCenter( ¢er );
sampler->SetRadius( &radius );
sampler->Update();
SamplerType::OutputType::Pointer output = sampler->GetOutput();
SamplerType::OutputType::Iterator iter = output->Begin();
while ( iter != output->End() )
{
std::cout << "instance identifier = " << iter.GetInstanceIdentifier()
<< "\t measurement vector = "
<< iter.GetMeasurementVector()
<< "\t frequency = "
<< iter.GetFrequency() << std::endl;
++iter;
}
return EXIT_SUCCESS;
}