useDynLib(pmclust)

import(methods, MASS)
importFrom(stats,rnorm)
importFrom(pbdMPI,spmd.allgather.integer)
importFrom(pbdMPI,spmd.allgather.object)
importFrom(pbdMPI,spmd.allreduce.integer)
importFrom(pbdMPI,spmd.allreduce.double)
importFrom(pbdMPI,spmd.bcast.integer)
importFrom(pbdMPI,spmd.bcast.object)
importFrom(pbdMPI,spmd.comm.rank)
importFrom(pbdMPI,spmd.comm.size)
importFrom(pbdMPI,spmd.isend.double)
importFrom(pbdMPI,spmd.recv.double)
importFrom(pbdMPI,spmd.wait)
importFrom(pbdMPI,comm.all)
importFrom(pbdMPI,comm.any)
importFrom(pbdMPI,comm.cat)
importFrom(pbdMPI,comm.size)
importFrom(pbdMPI,comm.stop)
importFrom(pbdMPI,get.jid)

# exportPattern("^[[:alpha:]]+")
# exportPattern("^[\\.]")

export(
### General functions.
  "pmclust",
  "pmclust.reduceK",
  "pkmeans",

  ### Example functions in SPMD.
  "generate.basic",
  "generate.MixSim",
  "assign.N.sample",
  "mb.print",

### SPMD functions.
  ### Readme function.
  "readme",

  ### Global objects.
  "set.global",

  ### Initial functions.
  "initial.em",
  "initial.RndEM",
  "initial.center",

  ### EM methods.
  "em.step",
  "aecm.step",
  "apecm.step",
  "apecma.step",
  "em.update.class",
  
  ### EM utility functions.
  "em.onestep",
  "e.step",
  "m.step",
  "indep.logL",

  ### K-means.
  "kmeans.step",
  "kmeans.update.class",

  ### Utility functions.
  "get.N.CLASS",
  "get.CLASS",

### GBD functions.
  ### Global objects.
  "set.global.gbd"
)

S3method(print, pmclust)
S3method(print, pkmeans)
