Package org.apache.mahout.math

Examples of org.apache.mahout.math.Swapper


        permute(A.viewColumn(j), indexes, doubleWork);
      }
      return A;
    }

    Swapper swapper = new Swapper() {
      public void swap(int a, int b) {
        A.viewRow(a).swap(A.viewRow(b));
      }
    };
View Full Code Here


    IntComparator comp = new IntComparator() {
      public int compare(int a, int b) {
        return Property.get(names, a).compareTo(Property.get(names, b));
      }
    };
    Swapper swapper = new Swapper() {
      public void swap(int a, int b) {
        String tmp = names.get(a);
        names.set(a, names.get(b));
        names.set(b, tmp);
        tmp = values.get(a);
View Full Code Here

        } // swap NaNs to the end
        return a < b ? -1 : (a == b) ? 0 : 1;
      }
    };
    // swaps aggregates and reorders indexes
    Swapper swapper = new Swapper() {
      public void swap(int x, int y) {
        int t1 = indexes[x];
        indexes[x] = indexes[y];
        indexes[y] = t1;
        double t2 = aggregates[x];
View Full Code Here

      throw new IllegalArgumentException();
    }

    // this one knows how to swap two row indexes (a,b)
    final int[] g = rowIndexes;
    Swapper swapper = new Swapper() {
      public void swap(int b, int c) {
        int tmp = g[b];
        g[b] = g[c];
        g[c] = tmp;
      }
View Full Code Here

    IntComparator comp = new IntComparator() {
      public int compare(int a, int b) {
        return get(names, a).compareTo(get(names, b));
      }
    };
    Swapper swapper = new Swapper() {
      public void swap(int a, int b) {
        String tmp = names.get(a);
        names.set(a, names.get(b));
        names.set(b, tmp);
        tmp = values.get(a);
View Full Code Here

  public void pairsSortedByValue(final List<T> keyList, ShortArrayList valueList) {
    keys(keyList);
    values(valueList);

    final short[] v = valueList.elements();
    Swapper swapper = new Swapper() {
      @Override
      public void swap(int a, int b) {
        short t1 = v[a];
        v[a] = v[b];
        v[b] = t1;
View Full Code Here

    keys(keyList);
    values(valueList);

    final int[] k = keyList.elements();
    final double[] v = valueList.elements();
    Swapper swapper = new Swapper() {
      @Override
      public void swap(int a, int b) {
        double t1 = v[a];
        v[a] = v[b];
        v[b] = t1;
View Full Code Here

    keys(keyList);
    values(valueList);

    final int[] k = keyList.elements();
    final char[] v = valueList.elements();
    Swapper swapper = new Swapper() {
      @Override
      public void swap(int a, int b) {
        char t1 = v[a];
        v[a] = v[b];
        v[b] = t1;
View Full Code Here

    keys(keyList);
    values(valueList);

    final char[] k = keyList.elements();
    final char[] v = valueList.elements();
    Swapper swapper = new Swapper() {
      @Override
      public void swap(int a, int b) {
        char t1 = v[a];
        v[a] = v[b];
        v[b] = t1;
View Full Code Here

    keys(keyList);
    values(valueList);

    final float[] k = keyList.elements();
    final float[] v = valueList.elements();
    Swapper swapper = new Swapper() {
      @Override
      public void swap(int a, int b) {
        float t1 = v[a];
        v[a] = v[b];
        v[b] = t1;
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.Swapper

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.