Package com.almworks.integers.func

Examples of com.almworks.integers.func.IntIntProcedure


          @Override
          public int invoke(int a, int b) {
            return IntCollections.compare(sorted.get(a), sorted.get(b));
          }
        },
        new IntIntProcedure() {
          @Override
          public void invoke(int a, int b) {
            sorted.swap(a, b);
            perms.swap(a, b);
          }
View Full Code Here


            int comp = IntCollections.compare(primary.get(i), primary.get(j));
            if (comp == 0) comp = IntCollections.compare(secondary.get(i), secondary.get(j));
            return comp;
          }
        },
        new IntIntProcedure() {
          @Override
          public void invoke(int i, int j) {
            primary.swap(i, j);
            secondary.swap(i, j);
          }
View Full Code Here

    }
    IntegersUtils.quicksort(size(), new IntIntToInt() {
      public int invoke(int a, int b) {
        return LongCollections.compare(get(a), get(b));
      }
    }, new IntIntProcedure() {
      public void invoke(int a, int b) {
        swap(a, b);
        if (sortAlso != null)
          for (WritableLongList list : sortAlso) {
            list.swap(a, b);
View Full Code Here

    final IntArray r = new IntArray(IntProgression.arithmetic(0, n));
    IntegersUtils.quicksort(n,
        // order
        LongFunctions.comparator(myValues),
        // swap
        new IntIntProcedure() {
          @Override
          public void invoke(int i, int j) {
            myValues.swap(i, j);
            r.swap(i, j);
          }
View Full Code Here

    // We cannot use PArray.sort(PArray... sortAlso) because types are different
    IntegersUtils.quicksort(main.size(),
        // compare
        LongFunctions.comparator(main),
        // swap
        new IntIntProcedure() {
          @Override
          public void invoke(int a, int b) {
            main.swap(a, b);
            parallel.swap(a, b);
          }
View Full Code Here

        public int invoke(int i, int j) {
          return LongCollections.compare(myValues.get(i), myValues.get(j));
        }
      },
      // swap
      new IntIntProcedure() {
        @Override
        public void invoke(int i, int j) {
          myValues.swap(i, j);
          r.swap(i, j);
        }
View Full Code Here

      // compare
      new IntIntToInt() { public int invoke(int a, int b) {
        return LongCollections.compare(main.get(a), main.get(b));
      }},
      // swap
      new IntIntProcedure() {
        @Override
        public void invoke(int a, int b) {
          main.swap(a, b);
          parallel.swap(a, b);
        }
View Full Code Here

        public int invoke(int i, int j) {
          return IntCollections.compare(myValues.get(i), myValues.get(j));
        }
      },
      // swap
      new IntIntProcedure() {
        @Override
        public void invoke(int i, int j) {
          myValues.swap(i, j);
          r.swap(i, j);
        }
View Full Code Here

      // compare
      new IntIntToInt() { public int invoke(int a, int b) {
        return IntCollections.compare(main.get(a), main.get(b));
      }},
      // swap
      new IntIntProcedure() {
        @Override
        public void invoke(int a, int b) {
          main.swap(a, b);
          parallel.swap(a, b);
        }
View Full Code Here

          @Override
          public int invoke(int a, int b) {
            return LongCollections.compare(sorted.get(a), sorted.get(b));
          }
        },
        new IntIntProcedure() {
          @Override
          public void invoke(int a, int b) {
            sorted.swap(a, b);
            perms.swap(a, b);
          }
View Full Code Here

TOP

Related Classes of com.almworks.integers.func.IntIntProcedure

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.