useDynLib(mgcv, .registration = TRUE, .fixes = "C_")

export("%.%",anova.gam, bam, bam.update,bandchol, bcg, betar,
       blas.thread.test, 
       choldrop,cholup,cpois,clog,cnorm,cox.ph,concurvity, 
       cSplineDes,dDeta,dmvn,d.mvt,dpnorm,dppois,
       exclude.too.far,extract.lme.cov, extract.lme.cov2,feasible,FFdes,
       formXtViX, formula.gam, gam.fit, fixDependence,fix.family.link,
       fix.family.var, fix.family.ls, fix.family.qf,fix.family.rd,   
       fs.test,fs.boundary,gam, gam2derivative, 
       gam2objective,
       gamm, gam.check, gam.control,gam.fit3,
       gam.fit5.post.proc,
       gamlss.etamu,gamlss.gH,gammals,gam.mh,
       gam.outer,gam.reparam, gam.vcomp, gamSim , 
       gaulss,gam.side,get.var,gevlss,ginla,gfam,gumbls,
       influence.gam, 
       in.out,inSide,interpret.gam,initial.sp,
       jagam,k.check,ldetS, 
       ldTweedie,
       logLik.gam,lp,ls.size,
       magic, magic.post.proc,mchol, model.matrix.gam,mini.roots,
       mono.con, mroot, multinom, mvn, nb, negbin, new.name, 
       notExp,notExp2,notLog,notLog2,pcls,null.space.dimension, 
       ocat,
       pen.edf,pdIdnot,pdTens,
       place.knots, plot.gam, polys.plot,print.anova.gam,
       print.gam,print.summary.gam,predict.gam,predict.bam,
       PredictMat,Predict.matrix,Predict.matrix2,
       Predict.matrix.Bspline.smooth,
       Predict.matrix.cr.smooth,
       Predict.matrix.duchon.spline,
       Predict.matrix.cs.smooth,
       Predict.matrix.cyclic.smooth,
       Predict.matrix.tensor.smooth,
       Predict.matrix.tprs.smooth,
       Predict.matrix.ts.smooth,
       Predict.matrix.sos.smooth,
       Predict.matrix.soap.film,
       Predict.matrix.sf.film,
       Predict.matrix.sf.wiggly,
       Predict.matrix.mrf.smooth,
       Predict.matrix.pspline.smooth,
       Predict.matrix.random.effect,
       Predict.matrix.t2.smooth,
       Predict.matrix.gp.smooth,
       psum.chisq,
       qq.gam,
       residuals.gam,rig,rTweedie,rmvn,r.mvt,
       Rrank,s,scat,scasm,sdiag,"sdiag<-",shash,
       sim2jam,Sl.initial.repara,Sl.inirep,Sl.repara,Sl.setup,
       slanczos,smooth2random,
       smoothCon,smooth.construct,smooth.construct2,
       smooth.construct.ad.smooth.spec,
       smooth.construct.ad.smooth.spec,
       smooth.construct.bs.smooth.spec,
       smooth.construct.cc.smooth.spec,
       smooth.construct.cp.smooth.spec,
       smooth.construct.cr.smooth.spec,
       smooth.construct.cs.smooth.spec,
       smooth.construct.ds.smooth.spec,
       smooth.construct.tensor.smooth.spec,
       smooth.construct.tp.smooth.spec,
       smooth.construct.ts.smooth.spec,
       smooth.construct.ps.smooth.spec,
       smooth.construct.re.smooth.spec,
       smooth.construct.mrf.smooth.spec,
       smooth.construct.gp.smooth.spec,
       smooth.construct.sc.smooth.spec,
       smooth.construct.scad.smooth.spec,
       smooth.construct.sos.smooth.spec,
       smooth.construct.so.smooth.spec,
       smooth.construct.sf.smooth.spec,
       smooth.construct.sw.smooth.spec,  
       smooth.construct.sos.smooth.spec,
       smooth.construct.t2.smooth.spec,
       smooth.info,
       summary.gam,sp.vcov,
       spasm.construct,spasm.sp,spasm.smooth,
       t2,te,ti,tensor.prod.model.matrix,tensor.prod.penalties,
       totalPenaltySpace,trichol,trind.generator,
       Tweedie,tw,twlss,uniquecombs, vcov.gam, vis.gam, 
       XWXd,XWyd,Xbd,diagXVXd,ijXVXd,
       ziP, ziplss,zipll)

importFrom(grDevices,cm.colors,dev.interactive,devAskNewPage,gray,grey,
           heat.colors,rgb,terrain.colors,topo.colors,axisTicks,hcl.colors)
importFrom(graphics,abline,axis,axTicks,box,contour,hist,image,lines,
           mtext, par, persp,plot,points,
           polygon,rect,strheight,strwidth,text,title)
importFrom(utils, setTxtProgressBar, txtProgressBar)

importFrom(splines,interpSpline)

importFrom(stats,.checkMFClasses,.getXlevels,anova,approx,as.formula,
binomial,coef,contrasts,"contrasts<-",cooks.distance,cor,cov,
delete.response,dbeta,dgamma,dnorm,dpois,fitted,formula,gaussian,glm,
influence,logLik,lm,mad,
make.link,median,model.frame,model.offset,model.matrix,model.response,
na.action,nlm,na.pass,napredict,na.omit,naresid,optim,pchisq,pnorm,pt,pf,
power,ppois,predict,printCoefmat,quantile,
qbeta,qbinom,qcauchy,qchisq,qnbinom,qgamma,qnorm,qpois,qqline,qqnorm,qqplot,
rchisq,reformulate,residuals,
rbeta,rbinom,rgamma,rnbinom,rnorm,rpois,runif,sd,
termplot,terms.formula,terms,uniroot,var,vcov,weights)

importFrom(utils,object.size)

importFrom(nlme,Dim,corMatrix,logDet,pdConstruct,pdFactor,pdMatrix,getGroupsFormula,lme,varFixed,lmeControl)

importMethodsFrom(Matrix,t,colMeans,colSums,chol,solve,lu,expand)
importFrom(Matrix,Diagonal,sparseMatrix,Matrix,sparse.model.matrix,diag)

importFrom(methods,cbind2,as)
importFrom(stats,weighted.mean)
importFrom(stats,optimize)

S3method(anova, gam)
S3method(influence, gam)
S3method(cooks.distance, gam)
S3method(formula, gam)
S3method(logLik, gam)
S3method(model.matrix,gam)
S3method(plot, gam)
S3method(plot, jam)
S3method(predict, gam)
S3method(predict, bam)
S3method(predict, jam)
S3method(print, anova.gam)
S3method(print, gam)
S3method(print, jam)
S3method(print, gam.vcomp)
S3method(print, summary.gam)
S3method(residuals, gam)
S3method(summary, gam)
S3method(vcov,gam)
S3method(print, anova.gam)
S3method(vcov,jam)

S3method(coef,pdTens)
S3method(pdConstruct,pdTens)
S3method(pdFactor,pdTens)
S3method(pdMatrix,pdTens)
S3method(summary,pdTens)

S3method(Dim,pdIdnot)
S3method(coef,pdIdnot)
S3method(corMatrix,pdIdnot)
S3method(logDet,pdIdnot)
S3method(pdConstruct,pdIdnot)
S3method(pdFactor,pdIdnot)
S3method(pdMatrix,pdIdnot)
S3method(solve,pdIdnot)
S3method(summary,pdIdnot)

S3method(fix.family.link,family)
S3method(fix.family.link,extended.family)
S3method(fix.family.link,general.family)
S3method(smooth.info,re.smooth.spec)
S3method(smooth.info,fs.smooth.spec)
S3method(smooth.info,sz.smooth.spec)
S3method(smooth.info,default)
S3method(smooth.construct,ad.smooth.spec)
S3method(smooth.construct,bs.smooth.spec)
S3method(smooth.construct, cc.smooth.spec)
S3method(smooth.construct,cp.smooth.spec)
S3method(smooth.construct, cr.smooth.spec)
S3method(smooth.construct, cs.smooth.spec)
S3method(smooth.construct,ds.smooth.spec)
S3method(smooth.construct, fs.smooth.spec)
S3method(smooth.construct, mrf.smooth.spec)
S3method(smooth.construct, gp.smooth.spec)
S3method(smooth.construct,ps.smooth.spec)
S3method(smooth.construct, re.smooth.spec)
S3method(smooth.construct,sc.smooth.spec)
S3method(smooth.construct,scad.smooth.spec)
S3method(smooth.construct,so.smooth.spec)
S3method(smooth.construct,sw.smooth.spec)
S3method(smooth.construct,sf.smooth.spec)
S3method(smooth.construct,sz.smooth.spec)
S3method(smooth.construct,sos.smooth.spec)
S3method(smooth.construct, tp.smooth.spec)
S3method(smooth.construct, tensor.smooth.spec)
S3method(smooth.construct, t2.smooth.spec)
S3method(smooth.construct, ts.smooth.spec)

S3method(Predict.matrix,Bspline.smooth)
S3method(Predict.matrix,cr.smooth)
S3method(Predict.matrix,cs.smooth)
S3method(Predict.matrix,cyclic.smooth)
S3method(Predict.matrix,cpspline.smooth)
S3method(Predict.matrix,duchon.spline)
S3method(Predict.matrix,fs.interaction)
S3method(Predict.matrix,mrf.smooth)
S3method(Predict.matrix,pspline.smooth)
S3method(Predict.matrix,random.effect)
S3method(Predict.matrix,tprs.smooth)
S3method(Predict.matrix,ts.smooth)
S3method(Predict.matrix,tensor.smooth)
S3method(Predict.matrix,t2.smooth)
S3method(Predict.matrix,soap.film)
S3method(Predict.matrix,sf.film)
S3method(Predict.matrix,sf.wiggly)
S3method(Predict.matrix,sz.interaction)
S3method(Predict.matrix,sos.smooth)
S3method(Predict.matrix,gp.smooth)


S3method(spasm.construct,cus)
S3method(spasm.construct,default)
S3method(spasm.sp,cus)
S3method(spasm.sp,default)
S3method(spasm.smooth,cus)
S3method(spasm.smooth,default)

S3method(smooth2random,mgcv.smooth)
S3method(smooth2random,fs.interaction)
S3method(smooth2random,tensor.smooth)
S3method(smooth2random,t2.smooth)
