testdiscrimin <- function(npermut, rank, pl, indica, tab, l1, c1)
  .C("testdiscrimin",
     as.integer(npermut),
     as.double(rank),
     as.double(pl),
     as.integer(length(pl)),
     as.double(indica),
     as.integer(length(indica)),
     as.double(t(tab)),
     as.integer(l1),
     as.integer(c1),
     inersim = double(npermut+1),
     PACKAGE="ade4")$inersim

testertrace <- function(npermut, pc1, pc2, tab1, tab2, l1, c1, c2)
  .C("testertrace",
     as.integer(npermut),
     as.double(pc1),
     as.double(pc2),
     as.double(t(tab1)),
     as.integer(l1),
     as.integer(c1),
     as.double(t(tab2)),
     as.integer(c2),
     inersim = double(npermut+1),
     PACKAGE="ade4")$inersim

testertracenu <- function(npermut, pc1, pc2, pl, tab1, tab2, l1, c1, c2, Xinit, Yinit, typX, typY)
  .C("testertracenu",
     as.integer(npermut),
     as.double(pc1),
     as.double(pc2),
     as.double(pl),       
     as.double(t(tab1)),
     as.integer(l1),
     as.integer(c1),
     as.double(t(tab2)),
     as.integer(c2),
     as.double(t(Xinit)),
     as.double(t(Yinit)),
     as.integer(typX),
     as.integer(typY),
     inersim = double(npermut+1),
     PACKAGE="ade4")$inersim

testertracenubis <- function(npermut, pc1, pc2, pl, tab1, tab2, l1, c1, c2, Xinit, Yinit, typX, typY, fixed)
  .C("testertracenubis",
     as.integer(npermut),
     as.double(pc1),
     as.double(pc2),
     as.double(pl),
     as.double(t(tab1)),
     as.integer(l1),
     as.integer(c1),
     as.double(t(tab2)),
     as.integer(c2),
     as.double(t(Xinit)),
     as.double(t(Yinit)),
     as.integer(typX),
     as.integer(typY),
     as.integer(fixed),
     inersim = double(npermut+1),
     PACKAGE="ade4")$inersim

testinter <- function(npermut, pl, pc, moda, indica, tab, l1, c1)
  .C("testinter",
     as.integer(npermut),
     as.double(pl),
     as.integer(length(pl)),
     as.double(pc),
     as.integer(length(pc)),
     as.integer(moda),
     as.double(indica),
     as.integer(length(indica)),
     as.double(t(tab)),
     as.integer(l1),
     as.integer(c1),
     inersim = double(npermut+1),
     PACKAGE="ade4")$inersim

testprocuste <- function(npermut, lig, c1, c2, tab1, tab2)
  .C("testprocuste",
     as.integer(npermut),
     as.integer(lig),
     as.integer(c1),
     as.integer(c2),
     as.double(t(tab1)),
     as.double(t(tab2)),
     inersim = double(npermut+1),
     PACKAGE="ade4")$inersim

testmantel <- function(npermut, col, tab1, tab2)
  .C("testmantel",
     as.integer(npermut),
     as.integer(col),
     as.double(t(tab1)),
     as.double(t(tab2)),
     inersim = double(npermut+1),
     PACKAGE="ade4")$inersim

testamova <- function(distab, l1, c1, samtab, l2, c2, strtab, l3, c3, indic, nbhapl, npermut, divtotal, df, r2)
  .C("testamova",
     as.double(t(distab)),
     as.integer(l1),
     as.integer(c1),
     as.integer(t(samtab)),
     as.integer(l2),
     as.integer(c2),
     as.integer(t(strtab)),
     as.integer(l3),
     as.integer(c3),
     as.integer(indic),
     as.integer(nbhapl),
     as.integer(npermut),
     as.double(divtotal),
     as.double(df),
     result = double(r2),
     PACKAGE="ade4")$result


testertracerlq <- function (npermut, pcR, pcQ, plL, pcL, tabR, tabQ, tabL, typQ, typR, indexR, assignR, indexQ, assignQ, modeltype)
  .C("testertracerlq",
     as.integer(npermut),
     as.double(pcR),
     as.integer(length(pcR)), 
     as.double(pcQ),
     as.integer(length(pcQ)),
     as.double(plL),
     as.integer(length(plL)),
     as.double(pcL),
     as.integer(length(pcL)), 
     as.double(t(tabR)),
     as.double(t(tabQ)),
     as.double(t(tabL)),
     as.integer(assignR),
     as.integer(assignQ),
     as.integer(indexR),
     as.integer (length(indexR)),
     as.integer(indexQ),
     as.integer (length(indexQ)),
     as.integer(typQ),
     as.integer(typR),
     inersim = double(npermut+1),
     modeltype=as.integer(modeltype),
     PACKAGE = "ade4")$inersim

