import SVDC_j.*; import Blas_j.*; import Blas_j2.*; //import gt_util9.*; public class gt2 extends Object { // The variables with "static" exist as long as the class exists. static double gt_world[][]; static double gt_proj[][]; static double gt_plot[][]; static double shift[]; static double xi[][], xi0[][], xi1[][]; double u[][], u_init[][]; static double u0[][], u1[][]; static double v0[][], v1[][], w[][], w0[][], w1[][]; static double b[][]; // Structure lim in C---> static double lims_min[]; static double lims_max[]; int tour_vars[]; //int active[]; int ntour_vars; static double tv[][], tmat[][]; static double s[]; static double coss[], sins[]; static double tau[], tinc[]; // tinc should be radian static double step, dv, delta; // static double dv, delta; static int spandim, ds; static int generate_new_path; int got_new_target_plane; static int count; int pdim, tourlength; int ncols, nrows, ndim, ndim2; static double raw_data[][]; /* VARIABLES TO BE DEFINED IN READ.JAVA : ncols, ncols_used, nrows, raw_data[][], vgroup_ids[] VARIABLES TO BE DEFINED ELSEWHERE : collab[][], color_name[]; */ // In JAVA, we cannot declare "static" variables in the method (run_tour() ). static double uold[][]; static int firsttime=1; /***************** CONSTRUCTOR OF GT CLASS TO INITIALIZE ARRAYS AND VARIABLES **********/ // public gt2(int nc, int nr, int nd) public gt2(int nc, int nr, int nd, double st) { ncols = nc; nrows = nr; ndim = nd; ndim2 = ndim * 2; step = st; // step = 0.1; s = new double[nd]; coss = new double[nd]; sins = new double[nd]; generate_new_path=0; count = 0; delta = 0.0; // step = 0.0; spandim=0; ds = 0; // d_alloc_gt() gt_world = new double[nrows][ncols]; gt_proj = new double[nrows][ncols]; gt_plot = new double[nrows][ncols]; shift = new double[ncols]; lims_min = new double[ncols]; //ncols=ntour_vars lims_max = new double[ncols]; tour_vars = new int[ncols]; xi = new double[ndim2][nrows]; // 2*PROJ_DIM=4 xi1 = new double[ndim][nrows]; u = new double[ndim][ncols]; u_init = new double[ndim][ncols]; u0 = new double[ndim][ncols]; u1 = new double[ndim][ncols]; v0 = new double[ndim][ncols]; v1 = new double[ndim][ncols]; b = new double[ndim2][ncols]; w = new double[ndim2][ndim]; w0 = new double[ndim2][ndim]; w1 = new double[ndim2][ndim]; tv = new double[ndim][ncols]; tmat = new double[ndim][ncols]; tau = new double[ndim]; tinc = new double[ndim]; raw_data = new double[nrows][ncols]; } /* This only gives the correct result if the vgroups vector is of the form {0,1,2,.....,ngroups-1} */ /* public static int numvargroups() { int nvgroups=0; for (int j=0; i nvgroups) {nvgroups = read.vgroup_idsp[j]; } nvgroup=nvgroups+1; return nvgroups; }*/ /* Find the minimum and maximum values of each column or variable group scaling by mean and std_width standard deviations */ public void mean_lgdist(double data[][], double min, double max) { double dx, sumxi; double sumdist=0.0; double mean[]; double lgdist=0.0; int nvgroups; nvgroups = 3; mean = new double[ncols]; for (int j=0; j lgdist) { lgdist = sumdist; } } lgdist = Math.sqrt(lgdist); for (int j=0; j0) { tour_reproject(); } } } /* This routine uses the data projected into the span of the starting basis and ending basis, and then rotates in this space*/ public void tour_reproject() { double tmpf; double costf[], sintf[]; costf = new double[ndim]; sintf = new double[ndim]; // static int firsttime=1; firsttime=1; int firstvar[]; firstvar = new int[ndim]; for (int i=0; i