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 <float.h>
Include dependency graph for loess.cpp:

Classes

struct  Shared_State
struct  Thread_Data

Macros

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

Functions

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)
void * worker_thread (void *arg)
int get_number_of_available_cpus ()
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:81

◆ 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)

◆ EIGEN_DONT_PARALLELIZE

#define EIGEN_DONT_PARALLELIZE

Function Documentation

◆ bisquare()

double bisquare ( double x)
inline

◆ get_number_of_available_cpus()

int get_number_of_available_cpus ( )

◆ 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 )

◆ tricube()

double tricube ( double x)
inline

◆ worker_thread()

void * worker_thread ( void * arg)

Variable Documentation

◆ loess_debug

bool loess_debug = false

◆ loess_weight

WEIGHT_FUNC loess_weight = WEIGHT_TRICUBE

◆ ls_method