Package org.apache.mahout.math

Examples of org.apache.mahout.math.Vector.times()


      blckCnt++;
      cnt = 0;
    }

    for (int i = 0; i < n; i++) {
      btEmitter.emitRow(i, qRowV.times(aRow.getQuick(i)));
    }

  }

View Full Code Here


    for (Map.Entry<Integer, Vector> btRowEntry : btRows.entrySet()) {
      Vector btRow = btRowEntry.getValue();
      assert btRow.size() == kp;
      for (int i = 0; i < kp; i++) {
        bbtEmitter.emitRow(i, btRow.times(btRow.getQuick(i)));
      }
    }

    double[][] bbtValues = new double[kp][];
    for (int i = 0; i < kp; i++) {
View Full Code Here

    for (Map.Entry<Integer, Vector> btRowEntry : btRows.entrySet()) {
      Vector btRow = btRowEntry.getValue();
      assert btRow.size() == kp;
      for (int i = 0; i < kp; i++) {
        bbtEmitter.emitRow(i, btRow.times(btRow.getQuick(i)));
      }
    }

    double[][] bbtValues = new double[kp][];
    for (int i = 0; i < kp; i++) {
View Full Code Here

        int itemIDIndex = usedItemsIterator.next().index();
        numberOfSimilarItemsUsed.setQuick(itemIDIndex, numberOfSimilarItemsUsed.getQuick(itemIDIndex) + 1);
      }

      numerators = numerators == null
          ? prefValue == BOOLEAN_PREF_VALUE ? simColumn.clone() : simColumn.times(prefValue)
          : numerators.plus(prefValue == BOOLEAN_PREF_VALUE ? simColumn : simColumn.times(prefValue));

      simColumn.assign(ABSOLUTE_VALUES);
      denominators = denominators == null ? simColumn : denominators.plus(simColumn);
    }
View Full Code Here

        numberOfSimilarItemsUsed.setQuick(itemIDIndex, numberOfSimilarItemsUsed.getQuick(itemIDIndex) + 1);
      }

      numerators = numerators == null
          ? prefValue == BOOLEAN_PREF_VALUE ? simColumn.clone() : simColumn.times(prefValue)
          : numerators.plus(prefValue == BOOLEAN_PREF_VALUE ? simColumn : simColumn.times(prefValue));

      simColumn.assign(ABSOLUTE_VALUES);
      denominators = denominators == null ? simColumn : denominators.plus(simColumn);
    }
View Full Code Here

      s1 = v.clone();
    } else {
      s1 = s1.plus(v);
    }
    if (s2 == null) {
      s2 = v.times(v);
    } else {
      s2 = s2.plus(v.times(v));
    }
  }
View Full Code Here

      s1 = s1.plus(v);
    }
    if (s2 == null) {
      s2 = v.times(v);
    } else {
      s2 = s2.plus(v.times(v));
    }
  }

  @Override
  public void computeParameters() {
View Full Code Here

      s1 = x.clone();
    } else {
      s1 = s1.plus(x);
    }
    if (s2 == null) {
      s2 = x.times(x);
    } else {
      s2 = s2.plus(x.times(x));
    }
  }
View Full Code Here

      s1 = s1.plus(x);
    }
    if (s2 == null) {
      s2 = x.times(x);
    } else {
      s2 = s2.plus(x.times(x));
    }
  }

  @Override
  public void computeParameters() {
View Full Code Here

    for (int c = 0; c < n; c++) {
      Vector col = mx.viewColumn(c);
      for (int c1 = 0; c1 < c; c1++) {
        Vector viewC1 = mx.viewColumn(c1);
        col.assign(col.minus(viewC1.times(viewC1.dot(col))));

      }
      final double norm2 = col.norm(2);
      col.assign(new DoubleFunction() {
        @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.