Révision 1105
tmp/org.txm.ahc.core/src/org/txm/ahc/core/functions/AHC.java (revision 1105) | ||
---|---|---|
257 | 257 |
public boolean loadParameters() { |
258 | 258 |
if(this.ca == null) { |
259 | 259 |
this.ca = (CA) this.getParent(); |
260 |
this.ca.setVisible(false); |
|
260 |
this.ca.setVisible(false); // hide the temporary CA
|
|
261 | 261 |
} |
262 | 262 |
return true; |
263 | 263 |
} |
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java (revision 1105) | ||
---|---|---|
295 | 295 |
forms[i] = split[0]; |
296 | 296 |
for( int j = 1 ; j < ncol ; j++) |
297 | 297 |
freqs[i][j-1] = Integer.parseInt(split[j]); |
298 |
} else { |
|
298 |
} |
|
299 |
else { |
|
299 | 300 |
throw new IOException(LexicalTableCoreMessages.bind(LexicalTableCoreMessages.error_lineXDoesNotHaveXXolumns, i, ncol)); |
300 | 301 |
} |
301 | 302 |
i++; |
... | ... | |
325 | 326 |
String[] rownames, String[] colnames, int Fmin) throws RWorkspaceException { |
326 | 327 |
|
327 | 328 |
ArrayList<Integer> idx = new ArrayList<Integer>(); |
328 |
for (int j = 0; j < rownames.length; j++) |
|
329 |
{ |
|
329 |
for (int j = 0; j < rownames.length; j++) { |
|
330 | 330 |
int sum = 0; |
331 |
for (int i = 0; i < colnames.length; i++) |
|
332 |
{ |
|
331 |
for (int i = 0; i < colnames.length; i++) { |
|
333 | 332 |
sum += freqs[j][i]; |
334 | 333 |
} |
335 |
if (sum >= Fmin) |
|
334 |
if (sum >= Fmin) {
|
|
336 | 335 |
idx.add(j); |
336 |
} |
|
337 | 337 |
} |
338 | 338 |
|
339 | 339 |
DoubleMatrix2D mat = DoubleFactory2D.sparse.make(idx.size(), colnames.length, 0); |
... | ... | |
347 | 347 |
} |
348 | 348 |
|
349 | 349 |
String[] filteredrownames = new String[idx.size()]; |
350 |
for (int i = 0 ; i < idx.size() ; i++) |
|
350 |
for (int i = 0 ; i < idx.size() ; i++) {
|
|
351 | 351 |
filteredrownames[i] = rownames[idx.get(i)]; |
352 |
} |
|
352 | 353 |
|
353 | 354 |
LexicalTableImpl table = new LexicalTableImpl(mat, filteredrownames, colnames); |
354 | 355 |
return table; |
... | ... | |
361 | 362 |
public int getFMax() { |
362 | 363 |
List<Integer> freqs = getFreqs(); |
363 | 364 |
int max = 0; |
364 |
for (int i : freqs) |
|
365 |
if (max < i) |
|
365 |
for (int i : freqs) {
|
|
366 |
if (max < i) {
|
|
366 | 367 |
max = i; |
368 |
} |
|
369 |
} |
|
367 | 370 |
return max; |
368 | 371 |
} |
369 | 372 |
|
... | ... | |
374 | 377 |
public int getFMin() { |
375 | 378 |
List<Integer> freqs = getFreqs(); |
376 | 379 |
int min = 999999; |
377 |
for (int i : freqs) |
|
378 |
if (min > i) |
|
380 |
for (int i : freqs) {
|
|
381 |
if (min > i) {
|
|
379 | 382 |
min = i; |
383 |
} |
|
384 |
} |
|
380 | 385 |
return min; |
381 | 386 |
} |
382 | 387 |
|
... | ... | |
391 | 396 |
ArrayList<double[]> cols = new ArrayList<double[]>(); |
392 | 397 |
int Nrows = this.getNRows(); |
393 | 398 |
int Ncols = this.getNColumns(); |
394 |
for (int i = 0; i < Ncols; i++) |
|
399 |
for (int i = 0; i < Ncols; i++) {
|
|
395 | 400 |
try { |
396 | 401 |
cols.add(this.getCol(i).asDoubleArray()); |
397 | 402 |
} catch (RException e) { |
... | ... | |
404 | 409 |
// TODO Auto-generated catch block |
405 | 410 |
org.txm.utils.logger.Log.printStackTrace(e); |
406 | 411 |
} |
412 |
} |
|
407 | 413 |
int sum = 0; |
408 | 414 |
|
409 | 415 |
for (int i = 0; i < Nrows; i++) { |
410 | 416 |
sum = 0; |
411 |
for (int j = 0; j < Ncols; j++) |
|
417 |
for (int j = 0; j < Ncols; j++) {
|
|
412 | 418 |
sum += (int) cols.get(j)[i]; |
419 |
} |
|
413 | 420 |
freqs.add(sum); |
414 | 421 |
} |
415 | 422 |
return freqs; |
... | ... | |
418 | 425 |
public void setReference(String refSymbol) { |
419 | 426 |
try { |
420 | 427 |
RWorkspace rw = RWorkspace.getRWorkspaceInstance(); |
421 |
rw.voidEval("missingrownames <- rownames("+symbol+")[!rownames("+symbol+")%in%rownames("+refSymbol+")]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
|
428 |
rw.voidEval("missingrownames <- rownames(" + symbol + ")[!rownames(" + symbol + ")%in%rownames(" + refSymbol + ")]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
|
422 | 429 |
rw.voidEval("missingrows <- matrix(ncol=1, nrow=length(missingrownames))"); //$NON-NLS-1$ |
423 | 430 |
rw.voidEval("missingrows[,] <- 0"); //$NON-NLS-1$ |
424 | 431 |
rw.voidEval("rownames(missingrows) <- missingrownames"); //$NON-NLS-1$ |
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1105) | ||
---|---|---|
583 | 583 |
*/ |
584 | 584 |
public final boolean isDirtyFromHistory() throws Exception { |
585 | 585 |
|
586 |
if (hasBeenComputedOnce) return false; // can't be dirty from history if the result has never been computed |
|
586 |
//if (hasBeenComputedOnce) return false; // can't be dirty from history if the result has never been computed
|
|
587 | 587 |
|
588 | 588 |
Class clazz = this.getClass(); |
589 | 589 |
|
... | ... | |
1241 | 1241 |
else { |
1242 | 1242 |
ArrayList<TXMResult> results = root.getDeepChildren(); |
1243 | 1243 |
for (int i = 0; i < results.size(); i++) { |
1244 |
|
|
1245 |
// FIXME: skipping invisible results |
|
1246 |
// if(!results.get(i).isVisible()) { |
|
1247 |
// continue; |
|
1248 |
// } |
|
1249 |
|
|
1250 | 1244 |
if(results.get(i).getUUID().equals(UUID)) { |
1251 | 1245 |
result = results.get(i); |
1252 | 1246 |
break; |
... | ... | |
1281 | 1275 |
nodes.add(child); |
1282 | 1276 |
} |
1283 | 1277 |
|
1284 |
// FIXME: test to add children of a non visible result
|
|
1278 |
// add children of a non visible result |
|
1285 | 1279 |
else if (!child.isVisible() && child.hasChildren()) { |
1286 | 1280 |
ArrayList<TXMResult> subChidlren = child.getChildren(type, onlyVisible); |
1287 | 1281 |
nodes.addAll(subChidlren); |
... | ... | |
1676 | 1670 |
this.monitor = monitor; |
1677 | 1671 |
|
1678 | 1672 |
if (!this.isDirtyFromHistory() && !this.isDirty()) { |
1679 |
Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": result is not dirty, computing skipped.");
|
|
1673 |
Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": result parameters have not changed since last computing, computing skipped.");
|
|
1680 | 1674 |
skipComputing = true; |
1681 | 1675 |
} |
1676 |
// FIXME: need to check if it's REALLY useless because the Progression is broken since the modifs |
|
1677 |
// else if (!this.isDirty()) { |
|
1678 |
// Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": result is not dirty, computing skipped."); |
|
1679 |
// skipComputing = true; |
|
1680 |
// } |
|
1682 | 1681 |
|
1683 | 1682 |
if(!skipComputing) { |
1684 | 1683 |
|
Formats disponibles : Unified diff