Package flanagan.math

Examples of flanagan.math.ArrayMaths


        // Construct matrix with a copy of an existing numberOfRows 1-D array of Vector<Object>
        public Matrix(Vector<Object>[] twoDv){
            this.numberOfRows = twoDv.length;
            ArrayMaths[] twoD = new ArrayMaths[this.numberOfRows];
            for(int i=0; i<this.numberOfRows; i++){
                twoD[i] = new ArrayMaths(twoDv[i]);
            }

        this.numberOfColumns = twoD[0].length();
        this.matrix = new double[this.numberOfRows][this.numberOfColumns];
        for(int i=0; i<numberOfRows; i++){
View Full Code Here


      // MAXIMUM ELEMENT
      // Returns the value, row index and column index of the maximum element
      public double[] maximumElement(){
          double[] ret = new double[3];
          double[] holdD = new double[this.numberOfRows];
          ArrayMaths am = null;
          int[] holdI = new int [this.numberOfRows];
          for(int i=0; i<this.numberOfRows; i++){
              am = new ArrayMaths(this.matrix[i]);
              holdD[i] = am.maximum();
              holdI[i] = am.maximumIndex();
          }
          am = new ArrayMaths(holdD);
          ret[0] = am.maximum();
          int maxI = am.maximumIndex();
          ret[1] = (double)maxI;
          ret[2] = (double)holdI[maxI];

          return ret;
      }
View Full Code Here

      // MINIMUM ELEMENT
      // Returns the value, row index and column index of the minimum element
      public double[] minimumElement(){
          double[] ret = new double[3];
          double[] holdD = new double[this.numberOfRows];
          ArrayMaths am = null;
          int[] holdI = new int [this.numberOfRows];
          for(int i=0; i<this.numberOfRows; i++){
              am = new ArrayMaths(this.matrix[i]);
              holdD[i] = am.minimum();
              holdI[i] = am.minimumIndex();
          }
          am = new ArrayMaths(holdD);
          ret[0] = am.minimum();
          int minI = am.minimumIndex();
          ret[1] = (double)minI;
          ret[2] = (double)holdI[minI];

          return ret;
      }
View Full Code Here

        // Argument:  coefficients of the real polynomial  a0 + a1.x + a2.x^2 + ....
        // Returns ArrayList:
        // First element: numertor as ComplexPoly
        // Second element: denominator as ComplexPoly
        public static ArrayList<ComplexPoly> sTransform(double[] coeff){
            ArrayMaths am = new ArrayMaths(coeff);
            Complex[] coeffc = am.getArray_as_Complex();
            return ComplexPoly.sTransform(coeffc);
        }
View Full Code Here

        // Calculate Gaussian N[0,1] order statistic medians
        this.gaussianOrderMedians = Stat.gaussianOrderStatisticMedians(this.nData);

        // calculate the correlation coefficient of the probability plot for the untransformed data
        Regression reg = new Regression(this.gaussianOrderMedians, ((new ArrayMaths(this.standardizedOriginalData)).sort().array()));
        reg.linear();
        this.originalSampleR = reg.getSampleR();
        double[] coeff = reg.getBestEstimates();
        this.originalIntercept = coeff[0];
        this.originalGradient = coeff[1];
View Full Code Here

    }

    // Return ordered transformed data
    public double[] orderedTransformedData(){
        if(!this.transformDone)this.transform();
        ArrayMaths am = new ArrayMaths(this.transformedData);
        double[] ordered = (am.sort()).array();
        return ordered;
    }
View Full Code Here

    public void transformedProbabilityPlot(){
        if(!this.transformDone)this.transform();

        double[][] data = PlotGraph.data(2,this.nData);
        data[0] = this.gaussianOrderMedians;
        data[1] = ((new ArrayMaths(this.standardizedTransformedData)).sort()).array();

        data[2] = this.gaussianOrderMedians;
        for(int i=0; i<this.nData; i++){
            data[3][i] = this.transformedIntercept + this.transformedGradient*this.gaussianOrderMedians[i];
        }
View Full Code Here

    public void originalProbabilityPlot(){
        if(!this.initializationDone)this.initialize();

        double[][] data = PlotGraph.data(2,this.nData);
        data[0] = this.gaussianOrderMedians;
        data[1] = ((new ArrayMaths(this.standardizedOriginalData)).sort()).array();
        data[2] = this.gaussianOrderMedians;
        for(int i=0; i<this.nData; i++){
            data[3][i] = this.originalIntercept + this.originalGradient*this.gaussianOrderMedians[i];
        }
        PlotGraph pg = new PlotGraph(data);
View Full Code Here

        }

        // print an array of Doubles to screen with truncation
        // No line returns except at the end
        public static void print(Double[] aa, int trunc){
            ArrayMaths am = new ArrayMaths(aa);
            am = am.truncate(trunc);
            Double[] aaa = am.array_as_Double();
            for(int i=0; i<aa.length; i++){
                System.out.print(aaa[i]+"   ");
            }
            System.out.println();
        }
View Full Code Here

        }

        // print an array of Doubles to screen with truncation
        // with line returns
        public static void println(Double[] aa, int trunc){
            ArrayMaths am = new ArrayMaths(aa);
            am = am.truncate(trunc);
            Double[] aaa = am.array_as_Double();
            for(int i=0; i<aa.length; i++){
                System.out.println(aaa[i]+"   ");
            }
        }
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.