Package org.apache.mahout.math.function

Examples of org.apache.mahout.math.function.IntIntDoubleFunction


      final double alpha = ((PlusMult) function).getMultiplicator();
      if (alpha == 0) {
        return this;
      } // nothing to do
      y.forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              setQuick(i, j, getQuick(i, j) + alpha * value);
              return value;
            }
          }
View Full Code Here


    if (!(source instanceof RCDoubleMatrix2D)) {
      //return super.assign(source);

      assign(0);
      source.forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              setQuick(i, j, value);
              return value;
            }
          }
View Full Code Here

      final double alpha = ((PlusMult) function).getMultiplicator();
      if (alpha == 0) {
        return this;
      } // nothing to do
      y.forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              setQuick(i, j, getQuick(i, j) + alpha * value);
              return value;
            }
          }
View Full Code Here

      if (alpha != alpha) {
        return assign(alpha);
      } // the funny definition of isNaN(). This should better not happen.

      forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              return function.apply(value);
            }
          }
      );
View Full Code Here

    }

    if (source instanceof RCDoubleMatrix2D || source instanceof SparseDoubleMatrix2D) {
      assign(0);
      source.forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              setQuick(i, j, value);
              return value;
            }
          }
View Full Code Here

      final double alpha = ((PlusMult) function).getMultiplicator();
      if (alpha == 0) {
        return this;
      } // nothing to do
      y.forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              setQuick(i, j, getQuick(i, j) + alpha * value);
              return value;
            }
          }
      );
      return this;
    }

    if (function == Functions.mult) { // x[i] = x[i] * y[i]
      forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              setQuick(i, j, getQuick(i, j) * y.getQuick(i, j));
              return value;
            }
          }
      );
      return this;
    }

    if (function == Functions.div) { // x[i] = x[i] / y[i]
      forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              setQuick(i, j, getQuick(i, j) / y.getQuick(i, j));
              return value;
            }
          }
View Full Code Here

    if (yElements == null || zElements == null) {
      throw new InternalError();
    }

    forEachNonZero(
        new IntIntDoubleFunction() {
          public double apply(int i, int j, double value) {
            if (transposeA) {
              int tmp = i;
              i = j;
              j = tmp;
View Full Code Here

    }

    final PlusMult fun = PlusMult.plusMult(0);

    forEachNonZero(
        new IntIntDoubleFunction() {
          public double apply(int i, int j, double value) {
            fun.setMultiplicator(value * alpha);
            if (!transposeA) {
              Crows[i].assign(Brows[j], fun);
            } else {
View Full Code Here

      final double alpha = ((PlusMult) function).getMultiplicator();
      if (alpha == 0) {
        return this;
      } // nothing to do
      y.forEachNonZero(
          new IntIntDoubleFunction() {
            @Override
            public double apply(int i, int j, double value) {
              setQuick(i, j, getQuick(i, j) + alpha * value);
              return value;
            }
View Full Code Here

      final double alpha = ((PlusMult) function).getMultiplicator();
      if (alpha == 0) {
        return this;
      } // nothing to do
      y.forEachNonZero(
          new IntIntDoubleFunction() {
            public double apply(int i, int j, double value) {
              setQuick(i, j, getQuick(i, j) + alpha * value);
              return value;
            }
          }
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.function.IntIntDoubleFunction

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.