Package de.lmu.ifi.dbs.elki.data

Examples of de.lmu.ifi.dbs.elki.data.RationalNumber


          firstCol = col;
        }
      }
      if(firstCol > -1) {
        for(int currentRow = row - 1; currentRow >= 0; currentRow--) {
          RationalNumber multiplier = gauss[currentRow][firstCol].copy();
          for(int col = firstCol; col < gauss[currentRow].length; col++) {
            RationalNumber subtrahent = gauss[row][col].times(multiplier);
            gauss[currentRow][col] = gauss[currentRow][col].minus(subtrahent);
          }
        }
      }
    }
View Full Code Here


   */
  private final RationalNumber[][] exactGaussElimination() {
    final RationalNumber[][] gauss = new RationalNumber[elements.length][this.columndimension];
    for(int row = 0; row < elements.length; row++) {
      for(int col = 0; col < this.columndimension; col++) {
        gauss[row][col] = new RationalNumber(elements[row][col]);
      }
    }
    return exactGaussElimination(gauss);
  }
View Full Code Here

        System.arraycopy(row, 0, gauss[0], 0, row.length);
      }

      // 3. create leading 1
      if(!gauss[0][firstCol].equals(RationalNumber.ONE)) {
        final RationalNumber inverse = gauss[0][firstCol].multiplicativeInverse();
        for(int col = 0; col < gauss[0].length; col++) {
          gauss[0][col] = gauss[0][col].times(inverse);
        }
      }

      // 4. eliminate values unequal to zero below leading 1
      for(int row = 1; row < gauss.length; row++) {
        final RationalNumber multiplier = gauss[row][firstCol].copy();
        // if(multiplier != 0.0)
        if(!multiplier.equals(RationalNumber.ZERO)) {
          for(int col = firstCol; col < gauss[row].length; col++) {
            final RationalNumber subtrahent = gauss[0][col].times(multiplier);
            gauss[row][col] = gauss[row][col].minus(subtrahent);
          }
        }
      }
View Full Code Here

          firstCol = col;
        }
      }
      if(firstCol > -1) {
        for(int currentRow = row - 1; currentRow >= 0; currentRow--) {
          RationalNumber multiplier = gauss[currentRow][firstCol].copy();
          for(int col = firstCol; col < gauss[currentRow].length; col++) {
            RationalNumber subtrahent = gauss[row][col].times(multiplier);
            gauss[currentRow][col] = gauss[currentRow][col].minus(subtrahent);
          }
        }
      }
    }
View Full Code Here

   */
  private final RationalNumber[][] exactGaussElimination() {
    final RationalNumber[][] gauss = new RationalNumber[elements.length][this.columndimension];
    for(int row = 0; row < elements.length; row++) {
      for(int col = 0; col < this.columndimension; col++) {
        gauss[row][col] = new RationalNumber(elements[row][col]);
      }
    }
    return exactGaussElimination(gauss);
  }
View Full Code Here

        System.arraycopy(row, 0, gauss[0], 0, row.length);
      }

      // 3. create leading 1
      if(!gauss[0][firstCol].equals(RationalNumber.ONE)) {
        final RationalNumber inverse = gauss[0][firstCol].multiplicativeInverse();
        for(int col = 0; col < gauss[0].length; col++) {
          gauss[0][col] = gauss[0][col].times(inverse);
        }
      }

      // 4. eliminate values unequal to zero below leading 1
      for(int row = 1; row < gauss.length; row++) {
        final RationalNumber multiplier = gauss[row][firstCol].copy();
        // if(multiplier != 0.0)
        if(!multiplier.equals(RationalNumber.ZERO)) {
          for(int col = firstCol; col < gauss[row].length; col++) {
            final RationalNumber subtrahent = gauss[0][col].times(multiplier);
            gauss[row][col] = gauss[row][col].minus(subtrahent);
          }
        }
      }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.data.RationalNumber

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.