Changeset 4211


Ignore:
Timestamp:
07/21/08 10:56:25 (12 years ago)
Author:
curtis
Message:

Initial implementation of subsampling computation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/slim/CurveCollection.java

    r4210 r4211  
    5959   *  if numRows or numCols is not a power of two or numRows != numCols 
    6060   */ 
    61   public CurveCollection(CurveFitter[][] cf) { 
    62     int numRows = cf.length; 
    63     int numCols = cf[0].length; 
     61  public CurveCollection(CurveFitter[][] curveFitters) { 
     62    int numRows = curveFitters.length; 
     63    int numCols = curveFitters[0].length; 
    6464    if (numRows != numCols) { 
    6565      throw new IllegalArgumentException("Row and column counts do not match"); 
     
    7171    } 
    7272    curves = new CurveFitter[depth + 1][][]; 
    73     curves[0] = cf; 
     73    curves[0] = curveFitters; 
    7474 
    7575    // compute subsamplings 
    76     for (int i=1; i<=depth; i++) { 
    77       curves[i] = null;//TODO 
     76    int res = numRows; 
     77    for (int d=1; d<=depth; d++) { 
     78      res /= 2; 
     79      curves[d] = new CurveFitter[res][res]; 
     80      for (int y=0; y<res; y++) { 
     81        for (int x=0; x<res; x++) { 
     82          CurveFitter cf = new GACurveFitter(); 
     83          /* 
     84          int[] data0 = curves[d-1][2*y][2*x].getData(); 
     85          int[] data1 = curves[d-1][2*y][2*x+1].getData(); 
     86          int[] data2 = curves[d-1][2*y+1][2*x].getData(); 
     87          int[] data3 = curves[d-1][2*y+1][2*x+1].getData(); 
     88          int[] data = new int[data0.length]; 
     89          for (int i=0; i<data.length; i++) { 
     90            data[i] = data0[i] + data1[i] + data2[i] + data3[i]; 
     91          } 
     92          cf.setData(data); 
     93          */ 
     94          curves[d][y][x] = cf; 
     95        } 
     96      } 
    7897    } 
    7998  } 
Note: See TracChangeset for help on using the changeset viewer.