Ignore:
Timestamp:
2004-10-12T11:31:49+13:00 (20 years ago)
Author:
kjdon
Message:

some changes made to make this work with daniel's new server code. mostly to do with matrix changing from int [][] to float [][]

Location:
trunk/greenstone3-extensions/vishnu/src/vishnu/testvis
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/dendro/Clustering.java

    r8189 r8284  
    3434
    3535
    36     public Clustering (DataManager dm, int linkage, int [][]m,
     36    public Clustering (DataManager dm, int linkage, float [][]m,
    3737               int num_of_vectors,
    3838               int arraySize, int min_c_items,
     
    5353   
    5454    double[] heights;
    55     double [][] vectors = intToDoubleMatrix(m);
     55    double [][] vectors = floatToDoubleMatrix(m);//intToDoubleMatrix(m);
    5656    //int [] coding = new int[m.length];
    5757       
     
    214214        return res;
    215215   }
     216    static double[][] floatToDoubleMatrix(float [][] m)
     217    {
     218        int h=m.length;
     219        double [][] res = null;
     220        if (h > 0)
     221        {
     222          int w = m[0].length;
     223          res = new double[h][w];
     224          for(int c=0;c<h;c++)
     225            for(int d = 0; d<w; d++)
     226              res[c][d]=(double)m[c][d];
     227        }
     228        return res;
     229   }
    216230
    217231
  • trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/dendro/TreePanel.java

    r8189 r8284  
    375375        }
    376376       
    377         int [][] full = m.getExpanded();
    378        
     377        //int [][] full = m.getExpanded();
     378        float [][] full = m.getExpanded();
    379379        // the number of new clusters generated is either 20
    380380        // or if there are not many docs half the #docs
     
    385385                     
    386386        Clustering clustering = new Clustering(dataManager,Clustering.COMPLETE_LINKAGE,
    387                                                     full,m.getRowCount(),
    388                                                     m.getColumnCount(),1,
    389                                                     clusterNum,limit);
     387                           full,m.getRowCount(),
     388                           m.getColumnCount(),1,
     389                           clusterNum,limit);
    390390         
    391391        root = clustering.getRoot();
  • trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/object/DataManager.java

    r8189 r8284  
    1010
    1111import vishnu.testvis.sammon.*;
    12 import vishnu.sammon.Sammon;
     12import vishnu.util.Sammon;
    1313import vishnu.cluster.Clustering;
    1414import vishnu.testvis.browser.*;
     
    496496        }
    497497       
    498         int [][] full = m.getExpanded();
     498        float [][] full = m.getExpanded();
    499499       
    500500        // the number of new clusters generated is either 20
     
    507507                     
    508508        Clustering clustering = new Clustering(Clustering.COMPLETE_LINKAGE,
    509                                                     full,m.getRowCount(),
    510                                                     m.getColumnCount(),1,
    511                                                     clusterNum,limit);
     509                           full,/*m.getRowCount(),
     510                              m.getColumnCount(),*/1,
     511                           clusterNum,limit);
    512512                                                   
    513         Vector [] clusters = clustering.getTheResults();
    514         double [][] centroids= clustering.getTheCentroids();
     513        Vector [] clusters = clustering.getClusters();
     514        double [][] centroids= clustering.getCentroids();
    515515
    516516        Sammon map = new Sammon(centroids);
  • trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/object/DocObj.java

    r8189 r8284  
    4343        return _weights;
    4444    }
    45     public int getWeights(int i)
     45    public float getWeights(int i)
    4646    {
    4747        SparseNode test = _weights;
  • trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/object/GSDLEngine.java

    r8189 r8284  
    66import vishnu.testvis.visual.*;
    77import vishnu.server.Packaging;
    8 import vishnu.server.XMLUtil;
     8import vishnu.util.XMLUtil;
    99
    1010import org.w3c.dom.Element;
  • trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/visual/CvManyPoints.java

    r8189 r8284  
    9999    protected MapKeyWords mapping;
    100100    /** A two dimensional array of integers used for clustering */
    101     protected int [][] fullMatrix;
     101    //protected int [][] fullMatrix;
     102    protected float [][] fullMatrix;
    102103    /** array of data to draw target */
    103104    protected int circles[][] = new int[maxCircleCount][4];
  • trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/visual/HitCluster.java

    r8189 r8284  
    1313    static final int EMPTYARRAY[] = {};
    1414    static int matrix[][];
    15     static int data[][];
     15    // static int data[][];
     16    static float data [][];
    1617    static int clusters[][];
    1718    static int keywords[];
     
    106107    }
    107108
    108     static int[] maximunDistance (int[][] newData, int[] newKeywords, int documentCount)
     109    static int[] maximunDistance (float[][] newData, int[] newKeywords, int documentCount)
    109110    {
    110111        data = newData;
Note: See TracChangeset for help on using the changeset viewer.