RandomBallCover  1.2.1
 Hosted by GitHub
Classes | Functions | Variables
2d_plot.cpp File Reference

An application examining the resulting arrangement of the Random Ball Cover data structure on 2-D data. More...

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <chrono>
#include <random>
#include <cmath>
#include <CLUtils.hpp>
#include <RBC/algorithms.hpp>
#include <plstream.h>
Include dependency graph for 2d_plot.cpp:

Classes

class  plot
 

Functions

std::default_random_engine gen (seed)
 
std::uniform_int_distribution< unsigned int > distc (1, 15)
 
template<typename iterator >
void random_unique (iterator xBegin, iterator yBegin, iterator rxBegin, iterator ryBegin, size_t n, size_t rn)
 Picks a number of elements uniformly at random without replacement from the input sequences. More...
 
int main (int argc, const char **argv)
 

Variables

const std::vector< std::string > kernel_files
 
auto seed = std::chrono::system_clock::now ().time_since_epoch ().count ()
 
std::function< unsigned int()> randColor = std::bind (distc, gen)
 

Detailed Description

An application examining the resulting arrangement of the Random Ball Cover data structure on 2-D data.

Note
The application requires further processing to extract the representative radii. This feature is not offered by the RBCConstruct class and is implemented on the CPU.
Author
Nick Lamprianidis
Version
1.2.1
Date
2015
Copyright (c) 2015 Nick Lamprianidis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

std::uniform_int_distribution<unsigned int> distc ( ,
15   
)
std::default_random_engine gen ( seed  )
int main ( int  argc,
const char **  argv 
)
template<typename iterator >
void random_unique ( iterator  xBegin,
iterator  yBegin,
iterator  rxBegin,
iterator  ryBegin,
size_t  n,
size_t  rn 
)

Picks a number of elements uniformly at random without replacement from the input sequences.

The function implements a Fisher-Yates shuffle.

Parameters
[in]xBegininput iterator to the initial position of the database sequence with the x dimension.
[in]yBegininput iterator to the initial position of the database sequence with the y dimension.
[out]rxBeginoutput iterator to the initial position of the representatives sequence with the x dimension.
[out]ryBeginoutput iterator to the initial position of the representatives sequence with the y dimension.
[in]nnumber of database points.
[in]rnnumber of representative points.

Variable Documentation

const std::vector<std::string> kernel_files
Initial value:
= { "kernels/rbc_kernels.cl",
"kernels/scan_kernels.cl" }
std::function<unsigned int ()> randColor = std::bind (distc, gen)
auto seed = std::chrono::system_clock::now ().time_since_epoch ().count ()