useDynLib(geoR)

# Export all names
#exportPattern(".")
#exportPattern("^[^\\.]")
#
# Import all packages listed as Imports or Depends
import(graphics)
#import(tcltk)
  importFrom("grDevices", "chull", "gray", "heat.colors",
             "terrain.colors")
  importFrom("utils", "getS3method", "read.table")

#importFrom(graphics,plot)
#importFrom(graphics,persp)
#importFrom(graphics,image)
#importFrom(graphics,contour)

import(stats,sp,methods)
importFrom(MASS,boxcox)

#importFrom(scatterplot3d,scatterplot3d)

## dependencis for grf() in simul.R
importFrom(splancs,csr)
importFrom(splancs,gridpts)
importFrom(RandomFields,GaussRF)

## exports for geoRglm
export(.geoR.check.locations)
export(.check.locations,.cond.sim)
export(.cor.number,.diagquadraticformXAX)
export(.solve.geoR,.bilinearformXAY)
export(hist.krige.bayes)
export(.ldots.set,.prepare.graph.krige.bayes)

# defined in geoR as generic functions :
export(as.geodata,jitterDupCoords,zoom.coords,dup.coords,lines.variomodel)

# exported functions (sample is not generic!!)
export(sample.geodata,sample.posterior,sample.prior)
export(output.control,krige.control,statistics.predictive)
#export(rmvnorm)

## auxiliar.R
export(coords.aniso,dinvchisq,legend.krige,locations.inside,pars.limits,plot.1d,
       polygrid,pred_grid,rinvchisq,set.coords.lims,trend.spatial)
export(.geoR_inout,.geoR_pip,.solve.geoR)

##bivar.R     
export(likfitBGCCM,loglikBGCCM,varcovBGCCM)

##boxcox.R    
export(backtransform.moments,BCtransform,dboxcox,rboxcox,boxcoxfit)

## corcov.R     
export(cov.spatial,matern,practicalRange,varcov.spatial,geoRCovModels)

##Cwrappers.R  
export(diffpairs,loccoords)

##eyefit.R     
export(eyefit)

## geobayes.R     
export(post2prior,krige.bayes,prior.control,model.control)

##geodata.R      
export(is.geodata,read.geodata,as.geodata)
export(points.geodata)
export(plot.geodata)

##geoRdefunct.R  

##geoRmisc.R   
export(jitter2d,nearloc,coords2coords,globalvar,rect.coords,subarea)

##kriging.R    
export(krige.control,krige.conv)

##krweights.R  
export(krweights,ksline)

##ksline.R  

##likGRF.R  
export(likfit,likfit.limits,likfit.nospatial,loglik.GRF,loglik.spatial)

##likOLD.R  
#export(.nlmP)

##profiles.R  
export(proflik)

##simul.R     
export(geoR2RF,grf)

##variofit.R
export(boot.variofit,variofit,variog.model.env)

##variogram.R
export(variog,variog.mc.env,variog4)

##xvalid.R
export(xvalid)

# S3 Methods:
S3method(as.data.frame,geodata)
S3method(as.geodata, default)
S3method(as.geodata,geodata.frame)
S3method(as.geodata,SpatialPointsDataFrame)

S3method(boxcox, geodata)

S3method(contour,grf)
S3method(contour,krige.bayes)
S3method(contour,kriging)

S3method(dup.coords,default)
S3method(dup.coords,geodata)

S3method(duplicated,geodata)

S3method(fitted,likGRF)

S3method(hist,krige.bayes)

S3method(image,grf)
S3method(image,krige.bayes)
S3method(image,kriging)

S3method(jitterDupCoords,default)
S3method(jitterDupCoords,geodata)

S3method(lines,eyefit)
S3method(lines,boxcoxfit)
S3method(lines,grf)
S3method(lines,variogram)
S3method(lines,variogram.envelope)
S3method(lines,variomodel)

S3method(lines.variomodel,default)
S3method(lines.variomodel,grf)
S3method(lines.variomodel,likGRF)
S3method(lines.variomodel,krige.bayes)
S3method(lines.variomodel,variofit)

S3method(logLik,likGRF)

S3method(names,geodata)

S3method(print,BGCCM)
S3method(print,boxcoxfit)
S3method(print,krige.bayes)
S3method(print,eyefit)
S3method(print,variofit)
S3method(print,likGRF)
S3method(print,summary.likGRF)
S3method(print,summary.eyefit)
S3method(print,summary.variofit)
S3method(print,summary.xvalid)
S3method(print,betavar)
S3method(print,grf)                  
S3method(print,posterior.krige.bayes) 
S3method(print,summary.geodata)      

S3method(plot,boxcoxfit)
S3method(plot,eyefit)
S3method(plot,geodata)
S3method(plot,grf)
S3method(plot,krige.bayes)
S3method(plot,proflik)
S3method(plot,variog4)
S3method(plot,variogram)
S3method(plot,xvalid)

S3method(points,geodata)

S3method(persp,grf)
S3method(persp,krige.bayes)
S3method(persp,kriging)

S3method(predict,BGCCM)

S3method(resid,likGRF)
#S3method(residual,likGRF)

S3method(subset,geodata)

S3method(summary,eyefit)
S3method(summary,geodata)
S3method(summary,likGRF)
S3method(summary,variofit)
S3method(summary,xvalid)

S3method(zoom.coords,default)
S3method(zoom.coords,geodata)

S3method(residuals,likGRF)

S3method(plot,"1d")
