Hawaii Hybrid
Loading...
Searching...
No Matches
loess.cpp File Reference
#include <iostream>
#include <cmath>
#include <vector>
#include "loess.hpp"
#include "hawaii.h"
#include "arena.h"
#include <Eigen/Dense>
#include <omp.h>
#include <float.h>
Include dependency graph for loess.cpp:

Macros

#define ARENA_IMPLEMENTATION
#define da_append(da, item)
#define da_insert(da, i, item)

Functions

int omp_get_num_threads ()
int omp_get_thread_num ()
void loess_init (double *x, double *y, size_t ilen)
void loess_free ()
Window make_window (double *distances, size_t window_size)
double tricube (double x)
double bisquare (double x)
double loess_estimate (double x, size_t window_size, size_t degree)
double * loess_create_grid (double grid_xmin, double grid_xmax, size_t grid_npoints)
double * loess_apply_smoothing (Smoothing_Config *config)

Variables

bool loess_debug = false
WEIGHT_FUNC loess_weight = WEIGHT_TRICUBE
LS_METHOD ls_method = LS_COMPLETE_ORTHOGONAL_DECOMPOSITION

Macro Definition Documentation

◆ ARENA_IMPLEMENTATION

#define ARENA_IMPLEMENTATION

◆ da_append

#define da_append ( da,
item )
Value:
do { \
if ((da)->count >= (da)->capacity) { \
(da)->capacity = (da)->capacity == 0 ? DA_INIT_CAP : (da)->capacity*2; \
(da)->items = (size_t*) realloc((da)->items, (da)->capacity*sizeof(*(da)->items)); \
assert((da)->items != NULL && "ASSERT: not enough memory\n"); \
} \
\
(da)->items[(da)->count++] = (item); \
} while (0)
#define DA_INIT_CAP
Definition hawaii.h:80

◆ da_insert

#define da_insert ( da,
i,
item )
Value:
do { \
if ((i < 0) || ((i) > (da)->count)) { \
assert(0 && "ASSERT: index out of bounds\n"); \
} \
if ((da)->count >= (da)->capacity) { \
(da)->capacity = (da)->capacity == 0 ? DA_INIT_CAP : (da)->capacity*2; \
(da)->items = (size_t*) realloc((da)->items, (da)->capacity*sizeof(*(da)->items)); \
assert((da)->items != NULL && "ASSERT: not enough memory\n"); \
} \
memmove((da)->items + (i) + 1, (da)->items + (i), ((da)->count - (i))*sizeof(*(da)->items)); \
(da)->items[(i)] = (item); \
(da)->count++; \
} while(0)

Function Documentation

◆ bisquare()

double bisquare ( double x)
inline

◆ loess_apply_smoothing()

double * loess_apply_smoothing ( Smoothing_Config * config)

◆ loess_create_grid()

double * loess_create_grid ( double grid_xmin,
double grid_xmax,
size_t grid_npoints )

◆ loess_estimate()

double loess_estimate ( double x,
size_t window_size,
size_t degree )

◆ loess_free()

void loess_free ( )

◆ loess_init()

void loess_init ( double * x,
double * y,
size_t ilen )

◆ make_window()

Window make_window ( double * distances,
size_t window_size )

◆ omp_get_num_threads()

int omp_get_num_threads ( )

◆ omp_get_thread_num()

int omp_get_thread_num ( )

◆ tricube()

double tricube ( double x)
inline

Variable Documentation

◆ loess_debug

bool loess_debug = false

◆ loess_weight

WEIGHT_FUNC loess_weight = WEIGHT_TRICUBE

◆ ls_method