##useDynLib(MatrixModels, .registration=TRUE)

## Import non-base functions we need explicitly,
## notably for which we define methods
## -- prefering   importMethodsFrom(., ...)  where applicable

## importFrom("graphics", image)
## importFrom("utils", head, tail)
##
importFrom("stats", ## potentially all these (we import into 'lme4a'):
           # anova,
           coef,# confint, cov2cor, deviance,
           fitted,
           formula,# predict, profile,
           residuals# simulate, terms,
           , update
           )


## Those our methods and functions use:
importMethodsFrom("Matrix", as.matrix, as.vector, coerce,
                  ## Group Methods
                  "Arith", "Compare", "Logic", "Math", "Math2", "Ops", "Summary",
                  t, "%*%", crossprod, tcrossprod,
                  Cholesky, chol, chol2inv,
                  solve,
                  summary, print,
                  update
                  )

importClassesFrom("Matrix",
                  CHMfactor,
                  CHMsimpl,
                  CHMsuper,
                  Cholesky,
                  CsparseMatrix,
                  Matrix,
                  compMatrix,
                  corMatrix,
                  dCHMsimpl,
                  dCHMsuper,
                  dMatrix,
                  ddenseMatrix,
                  denseMatrix,
                  dgCMatrix,
                  dgeMatrix,
                  dsparseMatrix,
                  generalMatrix,
                  sparseMatrix)

## Generics and functions defined in this package
export(
       "getCall",
       "glm4",
#TODO       "lm.fit.sparse",# <- "somewhat experimental"
       "mkRespMod",
       "model.Matrix"

## not-yet-exported:
## , "solveCoef"
## , "reweight"
## , "updateMu"
## , "updateWts"
       )

exportClasses(
              "modelMatrix",
              "sparseModelMatrix",
              "denseModelMatrix",
              "dsparseModelMatrix",
              "ddenseModelMatrix",

              ## --- linear predictor modules, containing a model matrix
              "predModule",
              "dPredModule",# dense &
              "sPredModule",# sparse  (for now)

              ## --- response modules, containing a response vector, etc.
              "respModule",          # base class and also linear model
              "glmRespMod",          # generalized linear models
              "nlsRespMod",          # nonlinear regression response
              "nglmRespMod",         # generalized nonlinear

              "glpModel", "Model"
	      )



exportMethods(## for both own and "other" generics:
              "getCall"
              ## re-export S4 methods, for "stats"-S3-generics:
              ,"coef" ## "cov2cor",
              ,"fitted", "formula", "residuals"
              ,"update"
	      ,"print"# print(x, ...) when show(x) is not sufficient
	      ,"show"
## not yet      ,"summary"
	      )
