vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Typedefs | Functions | Variables
grind.cc File Reference

performance test. The test is twofold: one aspect is the 'fidelity' of the filtering operations: if we repeatedly prefilter and restore the data, how badly do they suffer, given different data types? The second question is, how long does a prefilter-restore cycle take (roughly)? More...

#include <vigra/multi_array.hxx>
#include <vigra/accumulator.hxx>
#include <vigra/multi_math.hxx>
#include <iostream>
#include <typeinfo>
#include <random>
#include <ctime>
#include <chrono>
#include <vspline/vspline.h>

Go to the source code of this file.

Typedefs

template<class T >
using is_singular = typename std::conditional< std::is_fundamental< T > ::value, std::true_type, std::false_type > ::type
 

Functions

template<typename T >
double condense (const T &t, std::true_type)
 
template<typename T >
double condense (const T &t, std::false_type)
 
template<typename T >
double condense (const std::complex< T > &t, std::false_type)
 
template<typename T >
double condense (const T &t)
 
template<int dim, typename T >
double check_diff (vigra::MultiArrayView< dim, T > &reference, vigra::MultiArrayView< dim, T > &candidate)
 
template<int dim, typename T , typename math_ele_type >
void grind_test (vigra::TinyVector< int, dim > shape, vspline::bc_code bc, int spline_degree)
 create an array of random data ditributed between -1 and 1. Then repeatedly prefilter and restore the data, and check the difference between the restored and original data, plus the time needed to do the processing. This test shows that for higher-degree splines, arithmetic precision becomes an issue, and using floats becomes futile. But it also shows that using double data and operating in double precision does not cost too much more processing time. keeping the data in float and using double maths does not help. More...
 
int main (int argc, char *argv[])
 

Variables

bool verbose = true
 

Detailed Description

performance test. The test is twofold: one aspect is the 'fidelity' of the filtering operations: if we repeatedly prefilter and restore the data, how badly do they suffer, given different data types? The second question is, how long does a prefilter-restore cycle take (roughly)?

Definition in file grind.cc.

Typedef Documentation

◆ is_singular

template<class T >
using is_singular = typename std::conditional < std::is_fundamental < T > :: value , std::true_type , std::false_type > :: type

Definition at line 83 of file grind.cc.

Function Documentation

◆ check_diff()

template<int dim, typename T >
double check_diff ( vigra::MultiArrayView< dim, T > &  reference,
vigra::MultiArrayView< dim, T > &  candidate 
)

Definition at line 97 of file grind.cc.

◆ condense() [1/4]

template<typename T >
double condense ( const std::complex< T > &  t,
std::false_type   
)

Definition at line 77 of file grind.cc.

◆ condense() [2/4]

template<typename T >
double condense ( const T &  t)

Definition at line 91 of file grind.cc.

◆ condense() [3/4]

template<typename T >
double condense ( const T &  t,
std::false_type   
)

Definition at line 71 of file grind.cc.

◆ condense() [4/4]

template<typename T >
double condense ( const T &  t,
std::true_type   
)

Definition at line 65 of file grind.cc.

◆ grind_test()

template<int dim, typename T , typename math_ele_type >
void grind_test ( vigra::TinyVector< int, dim >  shape,
vspline::bc_code  bc,
int  spline_degree 
)

create an array of random data ditributed between -1 and 1. Then repeatedly prefilter and restore the data, and check the difference between the restored and original data, plus the time needed to do the processing. This test shows that for higher-degree splines, arithmetic precision becomes an issue, and using floats becomes futile. But it also shows that using double data and operating in double precision does not cost too much more processing time. keeping the data in float and using double maths does not help.

Definition at line 142 of file grind.cc.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 210 of file grind.cc.

Variable Documentation

◆ verbose

bool verbose = true

Definition at line 60 of file grind.cc.