/* timing module for Coordinate Sparse Matrix Factorization */ import jnt.linear_algebra.*; import jnt.util.Stopwatch; import jnt.io.*; import java.util.*; public class tCoord { static private final int DEBUG=0; public static void main(String args[]) throws java.io.IOException { CoordinateSparseMatrixDouble A; int M; int N; int nz; int reps; if (args.length < 1) { System.out.println("Usage -f matrix-filename reps"); System.out.println(" M N nz reps (use random-matrices)"); return; } if (args[0].compareTo("-f") == 0) // initialize usinge file { A = CoordinateSparseMatrixDouble.readfile(args[1],1); M = A.M(); N = A.N(); nz = A.num_nonzeros(); reps = Integer.valueOf(args[2]).intValue(); } else // initialize using random matrices { M = Integer.valueOf(args[0]).intValue(); N = Integer.valueOf(args[1]).intValue(); nz = Integer.valueOf(args[2]).intValue(); reps = Integer.valueOf(args[3]).intValue(); double v[] = new double[nz]; int row[] = new int[nz]; int col[] = new int[nz]; Random R = new Random(); for (int i=0; i 0.0) System.out.println(" Mflops: " + (reps*1.0e-6)* ops / Q.read()); else System.out.println("Time too small."); } }