useDynLib(hypervolume)

export( 
  ### (internal functions)
  #sample_model_rejection,
  #sample_model_ellipsoid,
  #calculate_density,
  #kdtree_build,
  #kdtree_ball_query_multiple,
  #nball_volume,
  #evalfrectangular,
  #evalfspherical,
  #bootstrap,
  #bootstrap_seq,
  #k_split,
  #sampling_bias_bootstrap,
  
  ### (external functions)
  copy_param_hypervolume,
  estimate_bandwidth, 
  expectation_ball, 
  expectation_box, 
  expectation_convex,
  expectation_convex, 
  expectation_maximal, 
  get_centroid,
  get_centroid_weighted,
  get_volume, 
  hypervolume_box,
  hypervolume_distance, 
  hypervolume_estimate_probability,
  hypervolume_funnel,
  hypervolume_gaussian,
  hypervolume_general_model,
  hypervolume_holes, 
  hypervolume_inclusion_test, 
  hypervolume_join, 
  hypervolume_overlap_confidence,
  hypervolume_overlap_statistics,
  hypervolume_overlap_test,
  hypervolume_n_occupancy,
  hypervolume_n_occupancy_permute,
  hypervolume_n_occupancy_test,
  hypervolume_n_occupancy_bootstrap,
  occupancy_filter,
  occupancy_to_intersection,
  occupancy_to_unshared,
  hypervolume_to_data_frame,
  occupancy_to_union,
  occupancy_bootstrap_gof, 
  get_occupancy_stats,
  get_occupancy_volume_bootstrap,
  get_occupancy_intersection_bootstrap,
  get_occupancy_unshared_bootstrap,
  get_occupancy_stats_bootstrap,
  get_relative_volume,
  hypervolume_n_resample,
  find_optimal_occupancy_thin,
  hypervolume_permute,
  hypervolume_project,
  hypervolume_prune, 
  hypervolume_threshold,
  hypervolume_redundancy,
  hypervolume_resample,
  hypervolume_save_animated_gif,
  hypervolume_segment, 
  hypervolume_set, 
  hypervolume_set_n_intersection,
  hypervolume_svm,
  hypervolume_thin, 
  hypervolume_variable_importance, 
  hypervolume, 
  padded_range,
  plot.Hypervolume,
  plot.HypervolumeList,
  print.Hypervolume,
  print.HypervolumeList,
  show.Hypervolume,
  show.HypervolumeList,
  summary.Hypervolume,
  summary.HypervolumeList,
  to_hv_list,
  weight_data

       ) 

exportClasses(
    "Hypervolume",
     "HypervolumeList" 
)

S3method(show, Hypervolume)
S3method(show, HypervolumeList)
 	
S3method(print, Hypervolume)
S3method(print, HypervolumeList)
S3method(summary, Hypervolume)
S3method(summary, HypervolumeList)
S3method(plot, Hypervolume)
S3method(plot, HypervolumeList)
S3method("[[",HypervolumeList)
S3method("[[<-",HypervolumeList)

S3method(get_volume, Hypervolume)
S3method(get_volume, HypervolumeList)

import(Rcpp)
import(geometry)
import(MASS)
import(methods)
#import(rgl)
import(ks)
import(fastcluster)
import(compiler)
import(e1071)
import(mvtnorm)
import(data.table)
import(progress)
import(pdist)
import(foreach)
import(doParallel)
import(parallel)
import(ggplot2)
import(palmerpenguins)
#import(alphahull)
#import(concaveman)

#importFrom("raster","raster", "getValues","values","extent","rasterToPolygons","rasterize")
importFrom("grDevices", "col2rgb", "rainbow", "rgb", "hsv", "rgb2hsv")
importFrom("graphics", ".filled.contour", "axis", "box", "contour","par", "plot", "points", "text","lines")
importFrom("stats", "cor", "cutree", "dist", "dnorm", "na.omit", "pgamma", "rmultinom", "rnorm", "runif", "sd", "median", "quantile","rbinom", "p.adjust", "predict", "var", "weighted.mean", "aggregate")
importFrom("utils", "data", "head", "write.table", "str", "combn", "read.table")
importFrom("maps", "map")
importFrom("graphics", "abline", "legend", "mtext")
importFrom("utils", "str", "combn")
importFrom("terra","buffer","values","rast","rasterize","as.polygons","ext")
importFrom("purrr","reduce")
importFrom("caret","findLinearCombos")

# problematic sections when using rastertopolygons with dissolve=TRUE
#importMethodsFrom("rgeos", "rbind2")
#importFrom(sp, rbind.SpatialPolygons)