Package flanagan.math

Examples of flanagan.math.ArrayMaths


           int nPoints=x.length;
          if(nPoints!=y.length)throw new IllegalArgumentException("Arrays x and y-row are of different length " + nPoints + " " + y.length);
            if(nPoints<nl)throw new IllegalArgumentException("The data matrix must have a minimum size of " + nl + " X " + nl);

            // order data
            ArrayMaths am = new ArrayMaths(x);
            am = am.sort();
            this.xIndices = am.originalIndices();
            x = am.array();
            double[] hold = new double[nPoints];

            for(int i=0; i<nPoints; i++){
              hold[i] = y[this.xIndices[i]];
          }
View Full Code Here


            // Calculate weighting matrix
            this.calcWeights();

            // order data
            ArrayMaths am = new ArrayMaths(x1);
            am = am.sort();
            this.x1indices = am.originalIndices();
            x1 = am.array();
            double[][][] hold = new double[lPoints][mPoints][nPoints];
            double[][][] hold1 = null;
            double[][][] hold2 = null;
            double[][][] hold12 = null;

            for(int i=0; i<lPoints; i++){
              for(int j=0; j<mPoints; j++){
                  for(int k=0; k<nPoints; k++){
                      hold[i][j][k] = y[this.x1indices[i]][j][k];
                  }
              }
          }
            for(int i=0; i<lPoints; i++){
              for(int j=0; j<mPoints; j++){
                  for(int k=0; k<nPoints; k++){
                      y[i][j][k] = hold[i][j][k];
                  }
              }
          }

          if(flag){
                hold1 = new double[lPoints][mPoints][nPoints];
                hold2 = new double[lPoints][mPoints][nPoints];
                hold12 = new double[lPoints][mPoints][nPoints];
                for(int i=0; i<lPoints; i++){
                  for(int j=0; j<mPoints; j++){
                      for(int k=0; k<nPoints; k++){
                          hold1[i][j][k] = dydx1[this.x1indices[i]][j][k];
                          hold2[i][j][k] = dydx2[this.x1indices[i]][j][k];
                          hold12[i][j][k] = d2ydx1dx2[this.x1indices[i]][j][k];
                      }
                  }
              }
                for(int i=0; i<lPoints; i++){
                  for(int j=0; j<mPoints; j++){
                      for(int k=0; k<nPoints; k++){
                          dydx1[i][j][k] = hold1[i][j][k];
                          dydx2[i][j][k] = hold2[i][j][k];
                          d2ydx1dx2[i][j][k] = hold12[i][j][k];
                      }
                  }
              }
            }

          am = new ArrayMaths(x2);
            am = am.sort();
            this.x2indices = am.originalIndices();
            x2 = am.array();

            for(int i=0; i<lPoints; i++){
              for(int j=0; j<mPoints; j++){
                  for(int k=0; k<nPoints; k++){
                      hold[i][j][k] = y[i][this.x2indices[j]][k];
                  }
              }
          }
            for(int i=0; i<lPoints; i++){
              for(int j=0; j<mPoints; j++){
                  for(int k=0; k<nPoints; k++){
                      y[i][j][k] = hold[i][j][k];
                  }
              }
          }

          if(flag){
                for(int i=0; i<lPoints; i++){
                  for(int j=0; j<mPoints; j++){
                      for(int k=0; k<nPoints; k++){
                          hold1[i][j][k] = dydx1[i][this.x2indices[j]][k];
                          hold2[i][j][k] = dydx2[i][this.x2indices[j]][k];
                          hold12[i][j][k] = d2ydx1dx2[i][this.x2indices[j]][k];
                      }
                  }
              }
                for(int i=0; i<lPoints; i++){
                  for(int j=0; j<mPoints; j++){
                      for(int k=0; k<nPoints; k++){
                          dydx1[i][j][k] = hold1[i][j][k];
                          dydx2[i][j][k] = hold2[i][j][k];
                          d2ydx1dx2[i][j][k] = hold12[i][j][k];
                      }
                  }
              }
          }

            am = new ArrayMaths(x3);
            am = am.sort();
            this.x3indices = am.originalIndices();
            x3 = am.array();

            for(int i=0; i<lPoints; i++){
              for(int j=0; j<mPoints; j++){
                  for(int k=0; k<nPoints; k++){
                      hold[i][j][k] = y[i][j][this.x3indices[k]];
View Full Code Here

    }

    public RankAnalysis(float[][] values, float[] errors){
        Matrix matv = new Matrix(values);
        this.values = matv.getArrayCopy();
        ArrayMaths ame = new ArrayMaths(errors);
        this.errors = this.oneToTwo(ame.array(), this.values[0].length);
        this.errorType = 1;
        this.preprocessDataOne();
    }
View Full Code Here


    public RankAnalysis(long[][] values, long[] errors){
        Matrix matv = new Matrix(values);
        this.values = matv.getArrayCopy();
        ArrayMaths ame = new ArrayMaths(errors);
        this.errors = this.oneToTwo(ame.array(), this.values[0].length);
        this.errorType = 1;
        this.preprocessDataOne();
    }
View Full Code Here

    }

    public RankAnalysis(int[][] values, int[] errors){
        Matrix matv = new Matrix(values);
        this.values = matv.getArrayCopy();
        ArrayMaths ame = new ArrayMaths(errors);
        this.errors = this.oneToTwo(ame.array(), this.values[0].length);
        this.errorType = 1;
        this.preprocessDataOne();
    }
View Full Code Here

    }

    public RankAnalysis(BigDecimal[][] values, BigDecimal[] errors){
        Matrix matv = new Matrix(values);
        this.values = matv.getArrayCopy();
        ArrayMaths ame = new ArrayMaths(errors);
        this.errors = this.oneToTwo(ame.array(), this.values[0].length);
        this.errorType = 1;
        this.preprocessDataOne();
    }
View Full Code Here

    }

    public RankAnalysis(BigInteger[][] values, BigInteger[] errors){
        Matrix matv = new Matrix(values);
        this.values = matv.getArrayCopy();
        ArrayMaths ame = new ArrayMaths(errors);
        this.errors = this.oneToTwo(ame.array(), this.values[0].length);
        this.errorType = 1;
        this.preprocessDataOne();
    }
View Full Code Here

    }

    public RankAnalysis(ArrayList<Object>[] values, ArrayList<Object> errors){
        Matrix matv = new Matrix(values);
        this.values = matv.getArrayCopy();
        ArrayMaths ame = new ArrayMaths(errors);
        this.errors = this.oneToTwo(ame.array(), this.values[0].length);
        this.errorType = 1;
        this.preprocessDataOne();
    }
View Full Code Here

    }

    public RankAnalysis(Vector<Object>[] values, Vector<Object> errors){
        Matrix matv = new Matrix(values);
        this.values = matv.getArrayCopy();
        ArrayMaths ame = new ArrayMaths(errors);
        this.errors = this.oneToTwo(ame.array(), this.values[0].length);
        this.errorType = 1;
        this.preprocessDataOne();
    }
View Full Code Here

    public RankAnalysis(Scores values){
        this.values = values.usedScoresAsRowPerItem();
        Matrix mat = new Matrix(this.values);
        double[] errors = mat.rowStandardDeviations();
        ArrayMaths ame = new ArrayMaths(errors);
        this.errors = this.oneToTwo(ame.array(), this.values[0].length);
        this.errorType = 1;
        this.preprocessDataOne();
    }
View Full Code Here

TOP

Related Classes of flanagan.math.ArrayMaths

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.