Added addToSummary.R
This commit is contained in:
parent
07912ccf1f
commit
95598800fe
1 changed files with 18 additions and 0 deletions
18
R/addToSummary.R
Normal file
18
R/addToSummary.R
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
addToSummary <- funciton(logml, partitionSummary, worstIndex) {
|
||||||
|
# Tiedet<65><74>n, ett<74> annettu logml on isompi kuin huonoin arvo
|
||||||
|
# partitionSummary taulukossa. Jos partitionSummary:ss<73> ei viel<65> ole
|
||||||
|
# annettua logml arvoa, niin lis<69>t<EFBFBD><74>n worstIndex:in kohtaan uusi logml ja
|
||||||
|
# nykyist<73> partitiota vastaava nclusters:in arvo. Muutoin ei tehd<68> mit<69><74>n.
|
||||||
|
|
||||||
|
apu <- find(abs(partitionSummary[, 2] - logml) < 1e-5)
|
||||||
|
if (isempty(apu)) {
|
||||||
|
# Nyt l<>ydetty partitio ei ole viel<65> kirjattuna summaryyn.
|
||||||
|
npops <- length(unique(PARTITION))
|
||||||
|
partitionSummary[worstIndex, 1] <- npops
|
||||||
|
partitionSummary[worstIndex, 2] <- logml
|
||||||
|
added <- 1
|
||||||
|
} else {
|
||||||
|
added <- 0
|
||||||
|
}
|
||||||
|
return(list(partitionSummary = partitionSummary, added = added))
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue