Skip to content

Commit 8479d50

Browse files
committed
Drop dependence
1 parent f7ba34d commit 8479d50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+93
-83
lines changed

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Package: pmclust
22
Version: 0.1-6
3-
Date: 2013-07-03
3+
Date: 2014-01-09
44
Title: Parallel Model-Based Clustering
55
Authors@R: c(person("Wei-Chen", "Chen", role = c("aut", "cre"), email =
66
"[email protected]"), person("George", "Ostrouchov", role = "aut"))
7-
Depends: R (>= 2.15.0), methods, rlecuyer, pbdMPI (>= 0.1-6), pbdSLAP
8-
(>= 0.1-5), pbdBASE (>= 0.2-1), pbdDMAT (>= 0.2-1)
9-
Enhances: MixSim
7+
Depends: R (>= 3.0.0), methods, rlecuyer, pbdMPI (>= 0.1-7)
8+
Enhances: MixSim, pbdSLAP (>= 0.1-7), pbdBASE (>= 0.3-0), pbdDMAT (>=
9+
0.2-4)
1010
LazyLoad: yes
1111
LazyData: yes
1212
Description: The pmclust aims to utilize model-based clustering (unsupervised)
@@ -25,7 +25,7 @@ URL: http://r-pbd.org/
2525
BugReports: http://group.r-pbd.org/
2626
MailingList: Please send questions and comments regarding pbdR to
2727
28-
Packaged: 2013-07-09 14:46:57 UTC; snoweye
28+
Packaged: 2014-01-10 05:28:26 UTC; snoweye
2929
Author: Wei-Chen Chen [aut, cre],
3030
George Ostrouchov [aut]
3131
Maintainer: Wei-Chen Chen <[email protected]>

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
useDynLib(pmclust)
22

3-
import(methods, rlecuyer, pbdMPI, pbdSLAP, pbdBASE, pbdDMAT)
3+
import(methods, rlecuyer, pbdMPI)
44

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

R/00_pmclust.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ pmclust <- function(X = NULL, K = 2, MU = NULL,
2121
}
2222
# Check matrix type if dmat algorithm is used.
2323
if(B & algorithm[1] %in% .PMC.CT$algorithm.dmat){
24-
if(! is.ddmatrix(.GlobalEnv$X.dmat)){
24+
if(! pbdDMAT::is.ddmatrix(.GlobalEnv$X.dmat)){
2525
comm.stop("X.dmat is not a ddmatrix.")
2626
}
2727
}
2828
} else{
2929
# Check matrix type if dmat algorithm is used.
3030
if(algorithm[1] %in% .PMC.CT$algorithm.dmat){
31-
if(! is.ddmatrix(X)){
31+
if(! pbdDMAT::is.ddmatrix(X)){
3232
comm.stop("X is not a ddmatrix.")
3333
}
3434
}
@@ -86,14 +86,14 @@ pkmeans <- function(X = NULL, K = 2, MU = NULL,
8686
}
8787
# Check matrix type if dmat algorithm is used.
8888
if(B & algorithm[1] %in% .PMC.CT$algorithm.dmat){
89-
if(! is.ddmatrix(.GlobalEnv$X.dmat)){
89+
if(! pbdDMAT::is.ddmatrix(.GlobalEnv$X.dmat)){
9090
comm.stop("X.dmat is not a ddmatrix.")
9191
}
9292
}
9393
} else{
9494
# Check matrix type if dmat algorithm is used.
9595
if(algorithm[1] %in% .PMC.CT$algorithm.dmat){
96-
if(! is.ddmatrix(X)){
96+
if(! pbdDMAT::is.ddmatrix(X)){
9797
comm.stop("X is not a ddmatrix.")
9898
}
9999
}

R/00_pmclust_internal_dmat.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ pmclust.internal.dmat <- function(X = NULL, K = 2, MU = NULL,
1111

1212
# Check X.
1313
if(comm.all(is.null(X))){
14-
if(! is.ddmatrix(.GlobalEnv$X.dmat)){
14+
if(! pbdDMAT::is.ddmatrix(.GlobalEnv$X.dmat)){
1515
comm.stop("X.dmat is not a ddmatrix.")
1616
} else{
1717
# Assume X.dmat in .GlobalEnv and no need for converting.
1818
PARAM.org <- set.global.dmat(K = K, RndEM.iter = RndEM.iter)
1919
}
2020
} else{
2121
# Assign X to .pmclustEnv if it is not in .GlobalEnv
22-
if(! is.ddmatrix(X)){
22+
if(! pbdDMAT::is.ddmatrix(X)){
2323
comm.stop("A ddmatrix is required.")
2424
}
2525
PARAM.org <- set.global.dmat(K = K, RndEM.iter = RndEM.iter, X.dmat = X)

R/01_as_dmat.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Convert X.spmd to X.dmat
22

3-
as.dmat <- function(X.spmd, bldim = .BLDIM, ICTXT = .ICTXT,
3+
as.dmat <- function(X.spmd, bldim = pbdDMAT::.BLDIM, ICTXT = pbdDMAT::.ICTXT,
44
comm = .SPMD.CT$comm){
55
X.spmd <- load.balance(X.spmd, comm = comm)
66

@@ -9,9 +9,9 @@ as.dmat <- function(X.spmd, bldim = .BLDIM, ICTXT = .ICTXT,
99
N <- spmd.allreduce.integer(N.spmd, integer(1), op = "sum", comm = comm)
1010
N.block.row <- spmd.allreduce.integer(N.spmd, integer(1), op = "max",
1111
comm = comm)
12-
X.dmat <- ddmatrix(0, N, p, bldim = c(N.block.row, p), ICTXT = 2)
12+
X.dmat <- pbdDMAT::ddmatrix(0, N, p, bldim = c(N.block.row, p), ICTXT = 2)
1313
X.dmat@Data <- X.spmd
14-
X.dmat <- redistribute(X.dmat, bldim = bldim, ICTXT = ICTXT)
14+
X.dmat <- pbdDMAT::redistribute(X.dmat, bldim = bldim, ICTXT = ICTXT)
1515

1616
X.dmat
1717
} # End of as.dmat().

R/01_as_spmd.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ as.spmd <- function(X.dmat, comm = .SPMD.CT$comm){
44
COMM.SIZE <- comm.size(comm)
55

66
### check data.
7-
all.check <- spmd.allreduce.integer(is.ddmatrix(X.dmat), integer(1),
7+
all.check <- spmd.allreduce.integer(pbdDMAT::is.ddmatrix(X.dmat), integer(1),
88
op = "sum", comm = comm) == COMM.SIZE
99
if(!all.check){
1010
stop("X.dmat is not consistent accross processors.")
1111
}
1212

1313
### block-cyclic in context 2.
1414
bldim.new <- c(ceiling(nrow(X.dmat) / COMM.SIZE), ncol(X.dmat))
15-
X.dmat <- dmat.reblock(X.dmat, bldim = bldim.new, ICTXT = 2)
15+
X.dmat <- pbdDMAT::dmat.reblock(X.dmat, bldim = bldim.new, ICTXT = 2)
1616

1717
### copy to spmd.
18-
if(base.ownany(dim(X.dmat), bldim(X.dmat), ICTXT = 2)){
18+
if(pbdBASE::base.ownany(dim(X.dmat), pbdDMAT::bldim(X.dmat), ICTXT = 2)){
1919
X.spmd <- X.dmat@Data
2020
} else{
2121
X.spmd <- matrix(0, nrow = 0, ncol = 0)

R/02_convert_data.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ convert.data <- function(X, method.own.X = .PMC.CT$method.own.X,
66
COMM.RANK <- spmd.comm.rank(comm)
77

88
# Assign X to .pmclustEnv
9-
if(is.ddmatrix(X)){
9+
if(pbdDMAT::is.ddmatrix(X)){
1010
# For a ddmatrix.
1111

1212
.pmclustEnv$X.spmd <- as.spmd(X, comm = comm)

R/02_load_balance.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ load.balance <- function(X.spmd, bal.info = NULL, comm = .SPMD.CT$comm,
116116
} else{
117117
tmp <- matrix(X.spmd[bal.info$send$belong == i,], ncol = p)
118118
}
119-
ret <- base:::rbind(ret, tmp)
119+
ret <- base::rbind(ret, tmp)
120120
}
121121
} else{
122122
for(i in recv.from){
@@ -128,7 +128,7 @@ load.balance <- function(X.spmd, bal.info = NULL, comm = .SPMD.CT$comm,
128128
} else{
129129
tmp <- matrix(X.spmd[, bal.info$send$belong == i], nrow = p)
130130
}
131-
ret <- base:::cbind(ret, tmp)
131+
ret <- base::cbind(ret, tmp)
132132
}
133133
}
134134
} else{

R/dmat_em_base.r

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ update.expectation.dmat <- function(PARAM, update.logL = TRUE){
2727
### WCC: temp spmd
2828
tmp.1 <- as.matrix(.pmclustEnv$W.dmat)
2929
tmp.2 <- sweep(tmp.1, 2, PARAM$log.ETA, FUN = "+")
30-
.pmclustEnv$U.dmat <- as.ddmatrix(tmp.2)
30+
.pmclustEnv$U.dmat <- pbdDMAT::as.ddmatrix(tmp.2)
3131

3232
### WCC: original
3333
# .pmclustEnv$Z.dmat <- exp(.pmclustEnv$U.dmat)
@@ -37,7 +37,7 @@ update.expectation.dmat <- function(PARAM, update.logL = TRUE){
3737
### WCC: temp spmd
3838
tmp.1 <- as.matrix(.pmclustEnv$U.dmat)
3939
tmp.2 <- exp(tmp.1)
40-
.pmclustEnv$Z.dmat <- as.ddmatrix(tmp.2)
40+
.pmclustEnv$Z.dmat <- pbdDMAT::as.ddmatrix(tmp.2)
4141

4242
### WCC: original
4343
# tmp.id <- rowSums(.pmclustEnv$U.dmat < .pmclustEnv$CONTROL$exp.min) == K |
@@ -67,7 +67,7 @@ update.expectation.dmat <- function(PARAM, update.logL = TRUE){
6767
if(tmp.flag == 1){
6868
tmp.2 <- matrix(tmp.2, nrow = 1)
6969
}
70-
tmp.dmat <- as.ddmatrix(tmp.2)
70+
tmp.dmat <- pbdDMAT::as.ddmatrix(tmp.2)
7171

7272
if(tmp.flag == 1){
7373
### WCC: original
@@ -106,7 +106,7 @@ update.expectation.dmat <- function(PARAM, update.logL = TRUE){
106106
tmp.id <- which(tmp.id)
107107
tmp.2 <- as.matrix(.pmclustEnv$Z.dmat)
108108
tmp.2[tmp.id,] <- tmp.1
109-
.pmclustEnv$Z.dmat <- as.ddmatrix(tmp.2)
109+
.pmclustEnv$Z.dmat <- pbdDMAT::as.ddmatrix(tmp.2)
110110
}
111111

112112
### WCC: original
@@ -124,7 +124,7 @@ update.expectation.dmat <- function(PARAM, update.logL = TRUE){
124124
### WCC: temp spmd
125125
tmp.1 <- as.matrix(.pmclustEnv$Z.dmat)
126126
tmp.2 <- tmp.1 / .pmclustEnv$W.rowSums
127-
.pmclustEnv$Z.dmat <- as.ddmatrix(tmp.2)
127+
.pmclustEnv$Z.dmat <- pbdDMAT::as.ddmatrix(tmp.2)
128128

129129

130130
### For semi-supervised clustering.
@@ -345,7 +345,7 @@ em.update.class.dmat <- function(){
345345
### WCC: temp spmd
346346
# tmp.1 <- as.matrix(.pmclustEnv$Z.dmat)
347347
# tmp.2 <- matrix(apply(tmp.1, 1, which.max), ncol = 1)
348-
# tmp.3 <- as.ddmatrix(tmp.2)
348+
# tmp.3 <- pbdDMAT::as.ddmatrix(tmp.2)
349349
# .pmclustEnv$CLASS.dmat <- tmp.3
350350

351351
invisible()

R/dmat_em_initial.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ initial.em.dmat <- function(PARAM, MU = NULL){
55
X.dmat <- get("X.dmat", envir = .pmclustEnv)
66
}
77

8-
if(! is.ddmatrix(X.dmat)){
8+
if(! pbdDMAT::is.ddmatrix(X.dmat)){
99
stop("X.dmat is not a ddmatrix.")
1010
}
1111

0 commit comments

Comments
 (0)