PPCKO: Principal Predictive Components for Estimating an Autoregressive Operator
 
Loading...
Searching...
No Matches
utils.hpp File Reference

Contains helpers functions. More...

#include "traits_ko.hpp"
#include <limits>

Go to the source code of this file.

Functions

Rcpp::List valid_err_disp (const valid_err_variant &var)
 Function to dispacth the error type depending on if cv is performed on one or two parameters, using visitor design pattern.
 
KO_Traits::StoringVector from_matrix_to_col (const KO_Traits::StoringMatrix &mat)
 Function to map a matrix into a column vector, column by column.
 
KO_Traits::StoringMatrix from_col_to_matrix (const KO_Traits::StoringVector &col, int rows, int cols)
 Function to map a column vector into a matrix, column by column.
 
KO_Traits::StoringVector add_nans_vec (const KO_Traits::StoringVector &pred, const std::vector< int > &row_ret, int complete_size)
 Function to add dummy NaNs to the curve/surface.
 

Detailed Description

Contains helpers functions.

Author
Andrea Enrico Franzoni

Function Documentation

◆ add_nans_vec()

KO_Traits::StoringVector add_nans_vec ( const KO_Traits::StoringVector & pred,
const std::vector< int > & row_ret,
int complete_size )

Function to add dummy NaNs to the curve/surface.

Parameters
predvector where NaNs have to be added
row_retvector containing the actual rows that are not dummy NaNs
complete_sizesize of the returning vector considering also the dummy NaNs
Returns
a vector with dummy NaNs in the requested positions

◆ from_col_to_matrix()

KO_Traits::StoringMatrix from_col_to_matrix ( const KO_Traits::StoringVector & col,
int rows,
int cols )

Function to map a column vector into a matrix, column by column.

Parameters
colvector to be mapped
rowsnumber of rows of the matrix
colsnumber of columns of the matrix
Returns
a matrix over which the vector has been mapped

◆ from_matrix_to_col()

KO_Traits::StoringVector from_matrix_to_col ( const KO_Traits::StoringMatrix & mat)

Function to map a matrix into a column vector, column by column.

Parameters
matmatrix to be mapped
Returns
a vector over which the matrix has been mapped

◆ valid_err_disp()

Rcpp::List valid_err_disp ( const valid_err_variant & var)

Function to dispacth the error type depending on if cv is performed on one or two parameters, using visitor design pattern.

Parameters
varerrors, stored in variant able to represent a vector or a matrix
Returns
a list containing the error stored according to the dimension of the cv input space