/*
 *                      Nividic development code
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  If you do not have a copy,
 * see:
 *
 *      http://www.gnu.org/copyleft/lesser.html
 *
 * Copyright for this code is held jointly by the microarray platform
 * of the École Normale Supérieure and the individual authors.
 * These should be listed in @author doc comments.
 *
 * For more information on the Nividic project and its aims,
 * or to join the Nividic mailing list, visit the home page
 * at:
 *
 *      http://www.transcriptome.ens.fr/nividic
 *
 */

package fr.ens.transcriptome.nividic.om.filters;

import java.io.InputStream;

import junit.framework.TestCase;
import fr.ens.transcriptome.nividic.om.BioAssay;
import fr.ens.transcriptome.nividic.om.ExpressionMatrix;
import fr.ens.transcriptome.nividic.om.io.NividicIOException;
import fr.ens.transcriptome.nividic.om.io.SimpleExpressionMatrixReader;

public class ExpressionMatrixRowFilterSpeedTest extends TestCase {

  public void tesFilter1() throws NividicIOException {

    String file1 = "/files/PDR1_huge.txt";

    InputStream is = this.getClass().getResourceAsStream(file1);
    SimpleExpressionMatrixReader reader = new SimpleExpressionMatrixReader(is);

    ExpressionMatrix matrix = reader.read();

    // System.out.println(matrix.size() + " rows, "+ matrix.getColumnCount()+ "
    // columns.");

    final double threshold = 1.0;
    final String comparator = "<";
    final boolean absolute = true;

    BioAssayDoubleThresholdFilter bioAssayFilter =
        new BioAssayDoubleThresholdFilter(BioAssay.FIELD_NAME_M, threshold,
            comparator, absolute);

    ExpressionMatrixFilter matrixfilter =
        new ExpressionMatrixRowFilterBioAssayFilterAdapter(bioAssayFilter, 0);

    long start = System.currentTimeMillis();

    ExpressionMatrix m2 = matrix.filter(matrixfilter);

    long end = System.currentTimeMillis();

    // System.out.println(m2.size() + " rows, result in " + (end - start) + "
    // ms.");

  }

  public void testFilter2() throws NividicIOException {

    String file1 = "/files/huge_matrix.txt";

    InputStream is = this.getClass().getResourceAsStream(file1);
    SimpleExpressionMatrixReader reader = new SimpleExpressionMatrixReader(is);

    ExpressionMatrix matrix = reader.read();

    /*System.out.println("rows: "
        + matrix.getRowCount() + "\tcolumns: " + matrix.getColumnCount()
        + "\tdimensions: " + matrix.getDimensionCount());*/

    // System.out.println(matrix.size() + " rows, "+ matrix.getColumnCount()+ "
    // columns.");

    final double threshold = 1.0;
    final String comparator = "<";
    final boolean absolute = true;

    BioAssayDoubleThresholdFilter bioAssayFilter =
        new BioAssayDoubleThresholdFilter(BioAssay.FIELD_NAME_M, threshold,
            comparator, absolute);

    ExpressionMatrixFilter matrixfilter =
        new ExpressionMatrixRowFilterBioAssayFilterAdapter(bioAssayFilter, 0);

    long start = System.currentTimeMillis();

    ExpressionMatrix m2 = matrix.filter(matrixfilter);

    long end = System.currentTimeMillis();

    /*System.out
        .println(m2.size() + " rows, result in " + (end - start) + " ms.");*/

  }

  public static void main(String [] args) throws Exception{
      
      new ExpressionMatrixRowFilterSpeedTest().testFilter2();
      
  }
  
}

@@ -2411,32 +2411,40 @@
 .read();%0A%0A    /*
+%0A     * 
 System.out.print
@@ -2454,24 +2454,16 @@
 %22rows: %22
-%0A       
  + matri
@@ -2491,24 +2491,31 @@
 columns: %22 +
+%0A     *
  matrix.getC
@@ -2526,24 +2526,16 @@
 nCount()
-%0A       
  + %22%5Ctdi
@@ -2576,16 +2576,22 @@
 ount());
+%0A     
 */%0A%0A    
@@ -2658,32 +2658,32 @@
 olumnCount()+ %22%0A
+
     // columns.%22
@@ -2677,33 +2677,32 @@
  // columns.%22);%0A
-%0A
     final double
@@ -3227,16 +3227,24 @@
 %0A%0A    /*
+%0A     * 
 System.o
@@ -3245,24 +3245,16 @@
 stem.out
-%0A       
  .printl
@@ -3306,23 +3306,36 @@
 art) + %22
+%0A     *
  ms.%22);
+%0A     
 */%0A%0A  %7D%0A
@@ -3367,17 +3367,16 @@
 n(String
- 
 %5B%5D args)
@@ -3396,19 +3396,12 @@
 tion
+ 
 %7B%0A
-      %0A  
+%0A
     
@@ -3460,20 +3460,12 @@
 ();%0A
-      
 %0A  %7D%0A
-  
 %0A%7D%0A

Fix Typo