C1DScalar Class Reference

A class for general scaling of one-dimensional arrays. More...

#include <mia/core/scaler1d.hh>

Public Types

typedef std::vector< double > std_double_vector
 

Public Member Functions

 C1DScalar (const CSplineKernel &kernel, size_t in_size, size_t out_size)
 
 C1DScalar (const CSplineKernel &kernel, size_t in_size, double scale)
 
size_t get_output_size () const
 
std_double_vector::iterator input_begin ()
 
std_double_vector::iterator input_end ()
 
void operator() (const std_double_vector &input, std_double_vector &output) const
 
std_double_vector::iterator output_begin ()
 
std_double_vector::iterator output_end ()
 
void run ()
 

Detailed Description

A class for general scaling of one-dimensional arrays.

Class for general scaling of one-dimensional arrays. kernels are the separable B-spline functions. For upscaling, an interpolator is created by using the provided interpolator factory. Downscaling is done solving an overdetermined linear system of equations Ax = y. At construction time the matrix A is QR decomposed, and later the downscaling is done by solving QRx=y

Todo:

see if scaling can be expressed by a filter

seems like downscaling isn't done properly

Definition at line 47 of file scaler1d.hh.

Member Typedef Documentation

◆ std_double_vector

typedef std::vector<double> C1DScalar::std_double_vector

Definition at line 49 of file scaler1d.hh.

Constructor & Destructor Documentation

◆ C1DScalar() [1/2]

C1DScalar::C1DScalar ( const CSplineKernel kernel,
size_t  in_size,
size_t  out_size 
)

Create the scaler prividing the given interpolator kernel.

Parameters
kernelinterpolation kernel
in_size
out_sizethe input will be scaled to the given size, the scale is set accordingly

◆ C1DScalar() [2/2]

C1DScalar::C1DScalar ( const CSplineKernel kernel,
size_t  in_size,
double  scale 
)

Create the scaler providing the given interpolator kernel.

Parameters
kernelinterpolation kernel
in_size
scalefactor by which tho scale the input size, the interpolation will be exact with respect to the scale

Member Function Documentation

◆ get_output_size()

size_t C1DScalar::get_output_size ( ) const
Returns
the size of the output vector

◆ input_begin()

std_double_vector::iterator C1DScalar::input_begin ( )
Returns
begin iterator of the input buffer

◆ input_end()

std_double_vector::iterator C1DScalar::input_end ( )
Returns
end iterator of the input buffer

◆ operator()()

void C1DScalar::operator() ( const std_double_vector input,
std_double_vector output 
) const

Scaling operator.

Parameters
inputinput data
[out]outputwhen calling the function, the size of this vector must be set to the requested size. The path for down or upscaling is automatically selected.

◆ output_begin()

std_double_vector::iterator C1DScalar::output_begin ( )
Returns
begin iterator of the output buffer

◆ output_end()

std_double_vector::iterator C1DScalar::output_end ( )
Returns
end iterator of the output buffer

◆ run()

void C1DScalar::run ( )

Alternate interface for scaling. Here the input data has to be copied into the pre-acclocated memory by using the input_begin() and input_end() iterators, and the result can be read using the output_begin(), output_end() iterators.


The documentation for this class was generated from the following file: