Package flanagan.math

Examples of flanagan.math.ArrayMaths


    public RankAnalysis(Cronbach 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


    public RankAnalysis(PCA 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

         // Construct matrix with a reference to an existing numberOfRows 1-D array of ArrayLists<Object>
        public Matrix(ArrayList<Object>[] twoDal){
            this.numberOfRows = twoDal.length;
            ArrayMaths[] twoD = new ArrayMaths[this.numberOfRows];
            for(int i=0; i<this.numberOfRows; i++){
                twoD[i] = new ArrayMaths(twoDal[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

        // Construct matrix with a reference to 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

        }

        // 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

        }

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

        }

        // print an array of Floats to screen with truncation
        // with line returns
        public static void println(Float[] aa, int trunc){
            ArrayMaths am = new ArrayMaths(aa);
            am = am.truncate(trunc);
            Float[] aaa = am.array_as_Float();
            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.