WeightedLowess
A C++ library for LOWESS with various weighting schemes
|
Utility class for sorting on a covariate. More...
#include <SortBy.hpp>
Public Member Functions | |
template<typename Sortable_ > | |
SortBy (size_t num_points, const Sortable_ *x) | |
SortBy ()=default | |
template<typename Sortable_ > | |
void | set (size_t num_points, const Sortable_ *x) |
template<typename Data_ , typename Used_ > | |
void | permute (Data_ *data, Used_ *work) const |
template<typename Data_ , typename Used_ > | |
void | permute (std::initializer_list< Data_ > data, Used_ *work) const |
template<typename DataPointers_ , typename Used_ > | |
void | permute (DataPointers_ data, Used_ *work) const |
template<typename Data_ , typename Used_ > | |
void | permute (Data_ *data, std::vector< Used_ > &work) const |
template<typename Data_ , typename Used_ > | |
void | permute (std::initializer_list< Data_ > data, std::vector< Used_ > &work) const |
template<typename DataPointers_ , typename Used_ > | |
void | permute (DataPointers_ data, std::vector< Used_ > &work) const |
template<typename Data_ , typename Used_ > | |
void | unpermute (Data_ *data, Used_ *work) const |
template<typename Data_ , typename Used_ > | |
void | unpermute (std::initializer_list< Data_ * > data, Used_ *work) const |
template<typename DataPointers_ , typename Used_ > | |
void | unpermute (DataPointers_ data, Used_ *work) const |
template<typename Data_ , typename Used_ > | |
void | unpermute (Data_ *data, std::vector< Used_ > &work) const |
template<typename Data_ , typename Used_ > | |
void | unpermute (std::initializer_list< Data_ * > data, std::vector< Used_ > &work) const |
template<typename DataPointers_ , typename Used_ > | |
void | unpermute (DataPointers_ data, std::vector< Used_ > &work) const |
Utility class for sorting on a covariate.
This is typically used to ensure that x-values are sorted prior to calling compute()
. The idea is to create a permutation vector from the x-values to sort them in ascending order; use permute()
to apply that permutation to the various arrays of x-values, y-values and weights (if applicable); calculate the fitted values from the permuted arrays with compute()
, now that the x-values are sorted; and then use unpermute()
on the results of the fit, to obtain fitted values for the points in their original (pre-sort) order.
|
inline |
Sortable_ | Sortable type. |
num_points | Number of points. | |
[in] | x | Pointer to an array of sortable values, typically x-values for the dataset. |
|
default |
Default constructor. The object should not be used until set()
is called.
|
inline |
Data_ | Any data type. |
Used_ | Boolean value for the workspace. |
[in,out] | data | Pointer to an array of length num_points to be permuted in-place, in the same manner that x (from the constructor) would be permuted for sorting. |
work | Workspace. This can be empty and will be recycled across permute() and unpermute() calls. |
|
inline |
Data_ | Any data type. |
Used_ | Boolean value for the workspace. |
[in,out] | data | Pointer to an array of length num_points to be permuted in-place, in the same manner that x (from the constructor) would be permuted for sorting. |
[in] | work | Pointer to an array of length num_points , to use as the workspace. This can recycled across permute() and unpermute() calls. |
|
inline |
DataPointers_ | Iterable container of pointers. |
Used_ | Boolean value for the workspace. |
[in,out] | data | One or more pointers to arrays of length num_points to be permuted in-place, in the same manner that x (from the constructor) would be permuted for sorting. |
work | Workspace. This can be empty and will be recycled across permute() and unpermute() calls. |
|
inline |
DataPointers_ | Iterable container of pointers. |
Used_ | Boolean value for the workspace. |
[in,out] | data | One or more pointers to arrays of length num_points to be permuted in-place, in the same manner that x (from the constructor) would be permuted for sorting. |
[in] | work | Pointer to an array of length num_points , to use as the workspace. This can recycled across permute() and unpermute() calls. |
|
inline |
Data_ | Any data type. |
Used_ | Boolean value for the workspace. |
[in,out] | data | One or more pointers to arrays of length num_points to be permuted in-place, in the same manner that x (from the constructor) would be permuted for sorting. |
work | Workspace. This can be empty and will be recycled across permute() and unpermute() calls. |
|
inline |
Data_ | Any data type. |
Used_ | Boolean value for the workspace. |
[in,out] | data | One or more pointers to arrays of length num_points to be permuted in-place, in the same manner that x (from the constructor) would be permuted for sorting. |
[in] | work | Pointer to an array of length num_points , to use as the workspace. This can recycled across permute() and unpermute() calls. |
|
inline |
Sortable_ | Sortable type. |
num_points | Number of points. | |
[in] | x | Pointer to an array of sortable values, typically x-values for the dataset. |
|
inline |
Data_ | Any data type. |
Used_ | Boolean type for the workspace. |
[in,out] | data | Pointer to an array of length num_points to be permuted in-place to reverse the effect of permute() . |
work | Workspace. This can be empty and will be recycled across permute() and unpermute() calls. |
|
inline |
Data_ | Any data type. |
Used_ | Boolean type for the workspace. |
[in,out] | data | Pointer to an array of length num_points to be permuted in-place to reverse the effect of permute() . |
[in] | work | Pointer to an array of length num_points . This can be recycled across permute() and unpermute() calls. |
|
inline |
DataPointers_ | Iterable container of pointers. |
Used_ | Boolean type for the workspace. |
[in,out] | data | One or more pointers to arrays of length num_points to be permuted in-place to reverse the effect of permute() . |
work | Workspace. This can be empty and will be recycled across permute() and unpermute() calls. |
|
inline |
DataPointers_ | Iterable container of pointers. |
Used_ | Boolean type for the workspace. |
[in,out] | data | One or more pointers to arrays of length num_points to be permuted in-place to reverse the effect of permute() . |
[in] | work | Pointer to an array of length num_points . This can be recycled across permute() and unpermute() calls. |
|
inline |
Data_ | Any data type. |
Used_ | Boolean type for the workspace. |
[in,out] | data | One or more pointers to arrays of length num_points to be permuted in-place to reverse the effect of permute() . |
work | Workspace. This can be empty and will be recycled across permute() and unpermute() calls. |
|
inline |
Data_ | Any data type. |
Used_ | Boolean type for the workspace. |
[in,out] | data | One or more pointers to arrays of length num_points to be permuted in-place to reverse the effect of permute() . |
[in] | work | Pointer to an array of length num_points . This can be recycled across permute() and unpermute() calls. |