Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix warning related to namespace issues. #1

Merged
merged 1 commit into from

2 participants

@doobwa

Changed NAMESPACE, DESCRIPTION files to include functionality from the latest version of Rcpp.

Also changed R function to be flim(). The C++ class is still called Flim.

@slycoder slycoder merged commit 3342900 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 10, 2012
  1. @doobwa
This page is out of date. Refresh to see the latest.
View
4 pkg/DESCRIPTION
@@ -8,3 +8,7 @@ Maintainer: Jonathan Chang <jonchang@fb.com>
Description: This package implements the Fast Learning of Ising Models (FLIM) technique which aims to perform inference and learning for large-scale fully-connected pairwise Ising models.
License: LGPL
LazyLoad: yes
+Depends: methods, Rcpp (>= 0.9.7)
+LinkingTo: Rcpp
+RcppModules: Rflim
+
View
5 pkg/NAMESPACE
@@ -1,5 +1,4 @@
-import(methods)
-importClassesFrom(Rcpp, "C++Object", "C++Class", "Module")
useDynLib(Rflim)
-export(Flim)
+import(Rcpp)
export(count.pairs)
+export(flim)
View
5 pkg/R/Flim.R
@@ -1,4 +1,4 @@
-Flim <- function(singleton.counts,
+flim <- function(singleton.counts,
pairwise.counts,
document.count,
beta.1 = 0.1,
@@ -13,8 +13,7 @@ Flim <- function(singleton.counts,
stop("Atrocity! Pairwise count indices must be between 1 and N.");
}
- flim.obj <- new(.module$Flim, N, beta.1, beta.2)
-
+ flim.obj <- new(Flim, N, beta.1, beta.2)
flim.obj$loadCorpus(singleton.counts,
pairwise.counts[,1],
View
12 pkg/R/onload.R
@@ -1,10 +1,4 @@
-NAMESPACE <- environment()
-.module <- new("Module")
-
-.onLoad <- function(libname, pkgname) {
- require(methods)
- unlockBinding(".module", NAMESPACE)
- assign(".module", Rcpp:::Module("Rflim"), NAMESPACE)
- lockBinding(".module", NAMESPACE)
+.onLoad <- function(pkgname, libname){
+ require("methods", character=TRUE, quietly=TRUE)
+ loadRcppModules()
}
-
View
2  tests/cora.test.R
@@ -18,7 +18,7 @@ pairwise.counts <- subset(data.frame(
save(pairwise.counts, singleton.counts, file="counts.Rdata")
-flim.instance <- Flim(singleton.counts,
+flim.instance <- flim(singleton.counts,
pairwise.counts,
length(documents),
0.0, 0.0, 15)
Something went wrong with that request. Please try again.