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 () |
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
see if scaling can be expressed by a filter
seems like downscaling isn't done properly
Definition at line 47 of file scaler1d.hh.
typedef std::vector<double> C1DScalar::std_double_vector |
Definition at line 49 of file scaler1d.hh.
C1DScalar::C1DScalar | ( | const CSplineKernel & | kernel, |
size_t | in_size, | ||
size_t | out_size | ||
) |
Create the scaler prividing the given interpolator kernel.
kernel | interpolation kernel |
in_size | |
out_size | the input will be scaled to the given size, the scale is set accordingly |
C1DScalar::C1DScalar | ( | const CSplineKernel & | kernel, |
size_t | in_size, | ||
double | scale | ||
) |
Create the scaler providing the given interpolator kernel.
kernel | interpolation kernel |
in_size | |
scale | factor by which tho scale the input size, the interpolation will be exact with respect to the scale |
size_t C1DScalar::get_output_size | ( | ) | const |
std_double_vector::iterator C1DScalar::input_begin | ( | ) |
std_double_vector::iterator C1DScalar::input_end | ( | ) |
void C1DScalar::operator() | ( | const std_double_vector & | input, |
std_double_vector & | output | ||
) | const |
Scaling operator.
input | input data | |
[out] | output | when calling the function, the size of this vector must be set to the requested size. The path for down or upscaling is automatically selected. |
std_double_vector::iterator C1DScalar::output_begin | ( | ) |
std_double_vector::iterator C1DScalar::output_end | ( | ) |
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.