Examples of VectorFunction


Examples of net.fec.openrq.util.linearalgebra.vector.functor.VectorFunction

     * @param row
     * @return a row vector function from a matrix function and a row index
     */
    public static VectorFunction asRowVectorFunction(final MatrixFunction function, final int row) {

        return new VectorFunction() {

            @Override
            public byte evaluate(int j, byte value) {

                return function.evaluate(row, j, value);
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.functor.VectorFunction

     * @param column
     * @return a column vector function from a matrix function and a column index
     */
    public static VectorFunction asColumnVectorFunction(final MatrixFunction function, final int column) {

        return new VectorFunction() {

            @Override
            public byte evaluate(int i, byte value) {

                return function.evaluate(i, column, value);
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.functor.VectorFunction

     *            a const value
     * @return a closure object that does {@code _}
     */
    public static VectorFunction asConstFunction(final byte arg) {

        return new VectorFunction() {

            @Override
            public byte evaluate(int i, byte value) {

                return arg;
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.functor.VectorFunction

     *            a value to be added to function's argument
     * @return a closure object that does {@code _ + _}
     */
    public static VectorFunction asPlusFunction(final byte arg) {

        return new VectorFunction() {

            @Override
            public byte evaluate(int i, byte value) {

                return aPlusB(value, arg);
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.functor.VectorFunction

     *            a value to be subtracted from function's argument
     * @return a closure that does {@code _ - _}
     */
    public static VectorFunction asMinusFunction(final byte arg) {

        return new VectorFunction() {

            @Override
            public byte evaluate(int i, byte value) {

                return aMinusB(value, arg);
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.functor.VectorFunction

     *            a value to be multiplied by function's argument
     * @return a closure that does {@code _ * _}
     */
    public static VectorFunction asMulFunction(final byte arg) {

        return new VectorFunction() {

            @Override
            public byte evaluate(int i, byte value) {

                return aTimesB(value, arg);
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.functor.VectorFunction

     *            a divisor value
     * @return a closure that does {@code _ / _}
     */
    public static VectorFunction asDivFunction(final byte arg) {

        return new VectorFunction() {

            @Override
            public byte evaluate(int i, byte value) {

                return aDividedByB(value, arg);
View Full Code Here

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

    data.assign(new Normal());

    Matrix queries = new DenseMatrix(numQueries, dimension);
    queries.assign(new Normal());

    Vector queryNorms = queries.aggregateRows(new VectorFunction() {
      @Override
      public double apply(Vector f) {
        return f.getLengthSquared();
      }
    });
View Full Code Here

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

      x.viewRow(row).assign(c.viewPart(0, 5));
      row++;
    }

    // verify that each column looks right.  Should contain zeros except for a single 6.
    final Vector columnNorms = x.aggregateColumns(new VectorFunction() {
      @Override
      public double apply(Vector f) {
        // return the sum of three discrepancy measures
        return Math.abs(f.minValue()) + Math.abs(f.maxValue() - 6) + Math.abs(f.norm(1) - 6);
      }
View Full Code Here

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

    }
  }

  @Test
  public void testAggregateRows() {
    Vector v = test.aggregateRows(new VectorFunction() {
      @Override
      public double apply(Vector v) {
        return v.zSum();
      }
    });
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.