Index: /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/DataBlock.java
===================================================================
--- /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/DataBlock.java	(revision 8287)
+++ /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/DataBlock.java	(revision 8288)
@@ -8,26 +8,28 @@
 public class DataBlock implements Serializable
 {
-	public int [] docs;
-	public String [] descriptions;
-    public String [] words;
-	public SparseMatrix matrix;
-	public Vector [] clusters;
-	public Point2D [] sammon;
+    public int [] docs = null;
+    public String [] descriptions = null;
+    public String [] words = null;
+    public SparseMatrix matrix = null;
+    public Vector [] clusters = null;
+    public Point2D [] sammon = null;
 
-	public DataBlock(int[] docs,
-		String [] descriptions,
-        String [] words,
-		SparseMatrix matrix,
-		Vector [] clusters,
-		Point2D [] sammon)
-	{
-		this.docs = docs;
-		this.descriptions = descriptions;
+    public DataBlock() {
+    }
+    public DataBlock(int[] docs,
+		     String [] descriptions,
+		     String [] words,
+		     SparseMatrix matrix,
+		     Vector [] clusters,
+		     Point2D [] sammon)
+    {
+	this.docs = docs;
+	this.descriptions = descriptions;
         this.words = words;
-		this.matrix = matrix;
-		this.clusters = clusters;
-		this.sammon = sammon;
-	}
-
+	this.matrix = matrix;
+	this.clusters = clusters;
+	this.sammon = sammon;
+    }
+    
 }
 
Index: /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/SparseMatrix.java
===================================================================
--- /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/SparseMatrix.java	(revision 8287)
+++ /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/SparseMatrix.java	(revision 8288)
@@ -2,28 +2,29 @@
 import java.io.*;
 
-
-// a matrix of size (document# x columnCount)
-// columns represent 100 most important keywords present in the retrieved documents
 public class SparseMatrix implements Serializable
 {
     private SparseNode [] nodes;
-    private int columnCount;
-    private int rowCount;
-
-    public SparseMatrix(int docCount, int columnCount)
+    private int n_cols;
+    private int n_rows;
+    
+    public SparseMatrix(int rows, int cols)
     {
-        rowCount=docCount;
-        this.columnCount=columnCount;
-        nodes = new SparseNode[docCount];
-        for (int c= 0; c<docCount;c++)
-           nodes[c] = null;
+        n_rows = rows;
+	n_cols = cols;
+	
+        nodes = new SparseNode[n_rows];
+	
+        for (int c = 0; c < n_rows; c++)
+	    nodes[c] = null;
     }
     
-    public void addDataItem(int row, int column, int value)
+    
+    public void addDataItem(int row, int column, float value)
     {
-        SparseNode node;
-        node = new SparseNode(value, column);
-        nodes[row] =  node.push(nodes[row]);
+	SparseNode node; 
+	node = new SparseNode(value, column);
+	nodes[row] = node.push(nodes[row]);
     }
+    
     
     public SparseNode getRow(int row)
@@ -32,43 +33,49 @@
     }
 
+
     public int getRowCount()
     {
-	    return rowCount;
+	    return n_rows;
     }
+
 
     public int getColumnCount()
     {
-	    return columnCount;
-    }
-
-    public int[][] getExpanded()
-    {
-        int[][] full = new int[rowCount][columnCount];
-	    int r, c;
-	    SparseNode n;
-	    for (r = 0;r < rowCount; r++)
-	    {
-	        for (c = 0;c < columnCount; c++)
-		        full[r][c]=0;
-	        
-	        // n is now the first node in the list
-	        n=nodes[r];
-	        
-	        while(n!= null)
-	        {
-		        full[r][n.getColumn()]=n.getValue();
-		        n=n.getNext();
-	        }
-	    }
-	    return full;
+	    return n_cols;
     }
     
-    /*public SparseMatrix getReduced(int maxDoc)
+
+    public float[][] getExpanded()
     {
-        return this;
-        //SparseMatrix newMatrix = new SparseMatrix();
-        //return new Matrix
-        
-    }*/
+        float[][] full = new float[n_rows][n_cols];
+	
+	SparseNode n;
+	
+	for(int r = 0; r < n_rows; r++){
+	    for (int c = 0; c < n_cols; c++)
+		full[r][c]=0;
+	    
+	    n=nodes[r];
+	    
+	    while(n!= null){
+		full[r][n.getColumn()]=n.getValue();
+		n=n.getNext();
+	    }
+	}
+	return full;
+    }
+    
+    
+    public void print()
+    {
+	for( int i = 0; i < nodes.length; i++ ){
+	    SparseNode n = getRow(i);
+	    while(n != null ){
+		System.out.print(n.getColumn()+ " ");
+		n = n.getNext();
+	    }
+	    System.out.println();
+	}
+    }
+}
 
-}
Index: /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/SparseNode.java
===================================================================
--- /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/SparseNode.java	(revision 8287)
+++ /trunk/greenstone3-extensions/vishnu/src/vishnu/datablock/SparseNode.java	(revision 8288)
@@ -4,33 +4,28 @@
 public class SparseNode implements Serializable
 {
-	private int value;
-	private int column;
-	private SparseNode next;
+    private float value;
+    
+    private int column;
+    private SparseNode next;
+    
+    
+    SparseNode(float f, int c)
+    {
+	value = f;
+	column = c;
+	next = null;
+    }
+    
+    
+    SparseNode(float f, int c, SparseNode n)
+    {
+	value = f;
+	column = c;
+	next = n;
+    }
+    
 
-	SparseNode(int d, int c)
-	{
-		value = d;
-		column = c;
-		next = null;
-	}
-
-	SparseNode(int d, int c, SparseNode n)
-	{
-		value = d;
-		column = c;
-		next = n;
-	}
-
-
-    // this simply adds a node to the BEGINNING of a list that starts with n1
-    // node = new Node();
-    // n1 = node.push(n1);
-    // wicked!
-    // this would also add a node to the END of a list
-    // node = new Node();
-    // n1 = n1.push(node);
-    // in which case the return argument would not be required
-	public SparseNode push(SparseNode n)
-	{
+    public SparseNode push(SparseNode n)
+    {
         if (next != null) next.push(n);
         else next = n;
@@ -38,14 +33,16 @@
     }
 
-    // this simply returns the next node in a list with respect to "this"
-	public SparseNode pop()
-	{
-		return next;
-	}
 
+    public SparseNode pop()
+    {
+	return next;
+    }
+
+    
     public SparseNode getNext()
     {
         return next;
     }
+
     
     public int getColumn()
@@ -54,10 +51,9 @@
     }
     
-    public int getValue()
+
+    public float getValue()
     {
         return value;
     }
-
-
 }
 
Index: /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/DataBlock.java
===================================================================
--- /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/DataBlock.java	(revision 8287)
+++ /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/DataBlock.java	(revision 8288)
@@ -8,26 +8,28 @@
 public class DataBlock implements Serializable
 {
-	public int [] docs;
-	public String [] descriptions;
-    public String [] words;
-	public SparseMatrix matrix;
-	public Vector [] clusters;
-	public Point2D [] sammon;
+    public int [] docs = null;
+    public String [] descriptions = null;
+    public String [] words = null;
+    public SparseMatrix matrix = null;
+    public Vector [] clusters = null;
+    public Point2D [] sammon = null;
 
-	public DataBlock(int[] docs,
-		String [] descriptions,
-        String [] words,
-		SparseMatrix matrix,
-		Vector [] clusters,
-		Point2D [] sammon)
-	{
-		this.docs = docs;
-		this.descriptions = descriptions;
+    public DataBlock() {
+    }
+    public DataBlock(int[] docs,
+		     String [] descriptions,
+		     String [] words,
+		     SparseMatrix matrix,
+		     Vector [] clusters,
+		     Point2D [] sammon)
+    {
+	this.docs = docs;
+	this.descriptions = descriptions;
         this.words = words;
-		this.matrix = matrix;
-		this.clusters = clusters;
-		this.sammon = sammon;
-	}
-
+	this.matrix = matrix;
+	this.clusters = clusters;
+	this.sammon = sammon;
+    }
+    
 }
 
Index: /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/SparseMatrix.java
===================================================================
--- /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/SparseMatrix.java	(revision 8287)
+++ /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/SparseMatrix.java	(revision 8288)
@@ -2,28 +2,29 @@
 import java.io.*;
 
-
-// a matrix of size (document# x columnCount)
-// columns represent 100 most important keywords present in the retrieved documents
 public class SparseMatrix implements Serializable
 {
     private SparseNode [] nodes;
-    private int columnCount;
-    private int rowCount;
-
-    public SparseMatrix(int docCount, int columnCount)
+    private int n_cols;
+    private int n_rows;
+    
+    public SparseMatrix(int rows, int cols)
     {
-        rowCount=docCount;
-        this.columnCount=columnCount;
-        nodes = new SparseNode[docCount];
-        for (int c= 0; c<docCount;c++)
-           nodes[c] = null;
+        n_rows = rows;
+	n_cols = cols;
+	
+        nodes = new SparseNode[n_rows];
+	
+        for (int c = 0; c < n_rows; c++)
+	    nodes[c] = null;
     }
     
-    public void addDataItem(int row, int column, int value)
+    
+    public void addDataItem(int row, int column, float value)
     {
-        SparseNode node;
-        node = new SparseNode(value, column);
-        nodes[row] =  node.push(nodes[row]);
+	SparseNode node; 
+	node = new SparseNode(value, column);
+	nodes[row] = node.push(nodes[row]);
     }
+    
     
     public SparseNode getRow(int row)
@@ -32,43 +33,49 @@
     }
 
+
     public int getRowCount()
     {
-	    return rowCount;
+	    return n_rows;
     }
+
 
     public int getColumnCount()
     {
-	    return columnCount;
-    }
-
-    public int[][] getExpanded()
-    {
-        int[][] full = new int[rowCount][columnCount];
-	    int r, c;
-	    SparseNode n;
-	    for (r = 0;r < rowCount; r++)
-	    {
-	        for (c = 0;c < columnCount; c++)
-		        full[r][c]=0;
-	        
-	        // n is now the first node in the list
-	        n=nodes[r];
-	        
-	        while(n!= null)
-	        {
-		        full[r][n.getColumn()]=n.getValue();
-		        n=n.getNext();
-	        }
-	    }
-	    return full;
+	    return n_cols;
     }
     
-    /*public SparseMatrix getReduced(int maxDoc)
+
+    public float[][] getExpanded()
     {
-        return this;
-        //SparseMatrix newMatrix = new SparseMatrix();
-        //return new Matrix
-        
-    }*/
+        float[][] full = new float[n_rows][n_cols];
+	
+	SparseNode n;
+	
+	for(int r = 0; r < n_rows; r++){
+	    for (int c = 0; c < n_cols; c++)
+		full[r][c]=0;
+	    
+	    n=nodes[r];
+	    
+	    while(n!= null){
+		full[r][n.getColumn()]=n.getValue();
+		n=n.getNext();
+	    }
+	}
+	return full;
+    }
+    
+    
+    public void print()
+    {
+	for( int i = 0; i < nodes.length; i++ ){
+	    SparseNode n = getRow(i);
+	    while(n != null ){
+		System.out.print(n.getColumn()+ " ");
+		n = n.getNext();
+	    }
+	    System.out.println();
+	}
+    }
+}
 
-}
Index: /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/SparseNode.java
===================================================================
--- /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/SparseNode.java	(revision 8287)
+++ /trunk/gsdl3/extensions/vishnu/src/vishnu/datablock/SparseNode.java	(revision 8288)
@@ -4,33 +4,28 @@
 public class SparseNode implements Serializable
 {
-	private int value;
-	private int column;
-	private SparseNode next;
+    private float value;
+    
+    private int column;
+    private SparseNode next;
+    
+    
+    SparseNode(float f, int c)
+    {
+	value = f;
+	column = c;
+	next = null;
+    }
+    
+    
+    SparseNode(float f, int c, SparseNode n)
+    {
+	value = f;
+	column = c;
+	next = n;
+    }
+    
 
-	SparseNode(int d, int c)
-	{
-		value = d;
-		column = c;
-		next = null;
-	}
-
-	SparseNode(int d, int c, SparseNode n)
-	{
-		value = d;
-		column = c;
-		next = n;
-	}
-
-
-    // this simply adds a node to the BEGINNING of a list that starts with n1
-    // node = new Node();
-    // n1 = node.push(n1);
-    // wicked!
-    // this would also add a node to the END of a list
-    // node = new Node();
-    // n1 = n1.push(node);
-    // in which case the return argument would not be required
-	public SparseNode push(SparseNode n)
-	{
+    public SparseNode push(SparseNode n)
+    {
         if (next != null) next.push(n);
         else next = n;
@@ -38,14 +33,16 @@
     }
 
-    // this simply returns the next node in a list with respect to "this"
-	public SparseNode pop()
-	{
-		return next;
-	}
 
+    public SparseNode pop()
+    {
+	return next;
+    }
+
+    
     public SparseNode getNext()
     {
         return next;
     }
+
     
     public int getColumn()
@@ -54,10 +51,9 @@
     }
     
-    public int getValue()
+
+    public float getValue()
     {
         return value;
     }
-
-
 }
 
Index: /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/DataBlock.java
===================================================================
--- /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/DataBlock.java	(revision 8287)
+++ /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/DataBlock.java	(revision 8288)
@@ -8,26 +8,28 @@
 public class DataBlock implements Serializable
 {
-	public int [] docs;
-	public String [] descriptions;
-    public String [] words;
-	public SparseMatrix matrix;
-	public Vector [] clusters;
-	public Point2D [] sammon;
+    public int [] docs = null;
+    public String [] descriptions = null;
+    public String [] words = null;
+    public SparseMatrix matrix = null;
+    public Vector [] clusters = null;
+    public Point2D [] sammon = null;
 
-	public DataBlock(int[] docs,
-		String [] descriptions,
-        String [] words,
-		SparseMatrix matrix,
-		Vector [] clusters,
-		Point2D [] sammon)
-	{
-		this.docs = docs;
-		this.descriptions = descriptions;
+    public DataBlock() {
+    }
+    public DataBlock(int[] docs,
+		     String [] descriptions,
+		     String [] words,
+		     SparseMatrix matrix,
+		     Vector [] clusters,
+		     Point2D [] sammon)
+    {
+	this.docs = docs;
+	this.descriptions = descriptions;
         this.words = words;
-		this.matrix = matrix;
-		this.clusters = clusters;
-		this.sammon = sammon;
-	}
-
+	this.matrix = matrix;
+	this.clusters = clusters;
+	this.sammon = sammon;
+    }
+    
 }
 
Index: /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/SparseMatrix.java
===================================================================
--- /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/SparseMatrix.java	(revision 8287)
+++ /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/SparseMatrix.java	(revision 8288)
@@ -2,28 +2,29 @@
 import java.io.*;
 
-
-// a matrix of size (document# x columnCount)
-// columns represent 100 most important keywords present in the retrieved documents
 public class SparseMatrix implements Serializable
 {
     private SparseNode [] nodes;
-    private int columnCount;
-    private int rowCount;
-
-    public SparseMatrix(int docCount, int columnCount)
+    private int n_cols;
+    private int n_rows;
+    
+    public SparseMatrix(int rows, int cols)
     {
-        rowCount=docCount;
-        this.columnCount=columnCount;
-        nodes = new SparseNode[docCount];
-        for (int c= 0; c<docCount;c++)
-           nodes[c] = null;
+        n_rows = rows;
+	n_cols = cols;
+	
+        nodes = new SparseNode[n_rows];
+	
+        for (int c = 0; c < n_rows; c++)
+	    nodes[c] = null;
     }
     
-    public void addDataItem(int row, int column, int value)
+    
+    public void addDataItem(int row, int column, float value)
     {
-        SparseNode node;
-        node = new SparseNode(value, column);
-        nodes[row] =  node.push(nodes[row]);
+	SparseNode node; 
+	node = new SparseNode(value, column);
+	nodes[row] = node.push(nodes[row]);
     }
+    
     
     public SparseNode getRow(int row)
@@ -32,43 +33,49 @@
     }
 
+
     public int getRowCount()
     {
-	    return rowCount;
+	    return n_rows;
     }
+
 
     public int getColumnCount()
     {
-	    return columnCount;
-    }
-
-    public int[][] getExpanded()
-    {
-        int[][] full = new int[rowCount][columnCount];
-	    int r, c;
-	    SparseNode n;
-	    for (r = 0;r < rowCount; r++)
-	    {
-	        for (c = 0;c < columnCount; c++)
-		        full[r][c]=0;
-	        
-	        // n is now the first node in the list
-	        n=nodes[r];
-	        
-	        while(n!= null)
-	        {
-		        full[r][n.getColumn()]=n.getValue();
-		        n=n.getNext();
-	        }
-	    }
-	    return full;
+	    return n_cols;
     }
     
-    /*public SparseMatrix getReduced(int maxDoc)
+
+    public float[][] getExpanded()
     {
-        return this;
-        //SparseMatrix newMatrix = new SparseMatrix();
-        //return new Matrix
-        
-    }*/
+        float[][] full = new float[n_rows][n_cols];
+	
+	SparseNode n;
+	
+	for(int r = 0; r < n_rows; r++){
+	    for (int c = 0; c < n_cols; c++)
+		full[r][c]=0;
+	    
+	    n=nodes[r];
+	    
+	    while(n!= null){
+		full[r][n.getColumn()]=n.getValue();
+		n=n.getNext();
+	    }
+	}
+	return full;
+    }
+    
+    
+    public void print()
+    {
+	for( int i = 0; i < nodes.length; i++ ){
+	    SparseNode n = getRow(i);
+	    while(n != null ){
+		System.out.print(n.getColumn()+ " ");
+		n = n.getNext();
+	    }
+	    System.out.println();
+	}
+    }
+}
 
-}
Index: /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/SparseNode.java
===================================================================
--- /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/SparseNode.java	(revision 8287)
+++ /trunk/gsdl3/packages/vishnu/src/vishnu/datablock/SparseNode.java	(revision 8288)
@@ -4,33 +4,28 @@
 public class SparseNode implements Serializable
 {
-	private int value;
-	private int column;
-	private SparseNode next;
+    private float value;
+    
+    private int column;
+    private SparseNode next;
+    
+    
+    SparseNode(float f, int c)
+    {
+	value = f;
+	column = c;
+	next = null;
+    }
+    
+    
+    SparseNode(float f, int c, SparseNode n)
+    {
+	value = f;
+	column = c;
+	next = n;
+    }
+    
 
-	SparseNode(int d, int c)
-	{
-		value = d;
-		column = c;
-		next = null;
-	}
-
-	SparseNode(int d, int c, SparseNode n)
-	{
-		value = d;
-		column = c;
-		next = n;
-	}
-
-
-    // this simply adds a node to the BEGINNING of a list that starts with n1
-    // node = new Node();
-    // n1 = node.push(n1);
-    // wicked!
-    // this would also add a node to the END of a list
-    // node = new Node();
-    // n1 = n1.push(node);
-    // in which case the return argument would not be required
-	public SparseNode push(SparseNode n)
-	{
+    public SparseNode push(SparseNode n)
+    {
         if (next != null) next.push(n);
         else next = n;
@@ -38,14 +33,16 @@
     }
 
-    // this simply returns the next node in a list with respect to "this"
-	public SparseNode pop()
-	{
-		return next;
-	}
 
+    public SparseNode pop()
+    {
+	return next;
+    }
+
+    
     public SparseNode getNext()
     {
         return next;
     }
+
     
     public int getColumn()
@@ -54,10 +51,9 @@
     }
     
-    public int getValue()
+
+    public float getValue()
     {
         return value;
     }
-
-
 }
 
