当前位置: 首页>>代码示例>>Java>>正文


Java Lambda类代码示例

本文整理汇总了Java中edu.jhu.prim.util.Lambda的典型用法代码示例。如果您正苦于以下问题:Java Lambda类的具体用法?Java Lambda怎么用?Java Lambda使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Lambda类属于edu.jhu.prim.util包,在下文中一共展示了Lambda类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: add

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise sum of this vector with the other. */
public void add(LongDoubleVector other) {
    if (other instanceof LongDoubleUnsortedVector) {
        LongDoubleUnsortedVector vec = (LongDoubleUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], vec.vals[i]);
        }
    } else {
        //  TODO: Add special case for LongDoubleDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.DoubleAdd()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:LongDoubleDenseVector.java

示例2: subtract

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise difference of this vector with the other. */
public void subtract(LongDoubleVector other) {
    if (other instanceof LongDoubleUnsortedVector) {
        LongDoubleUnsortedVector vec = (LongDoubleUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], -vec.vals[i]);
        }
    } else {
        // TODO: Add special case for LongDoubleDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.DoubleSubtract()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:LongDoubleDenseVector.java

示例3: product

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise product (i.e. Hadamard product) of this vector with the other. */
public void product(LongDoubleVector other) { 
    // TODO: This is correct, but will create lots of zero entries and not remove any.
    // Also this will be very slow if other is a LongDoubleSortedVector since it will have to
    // call get() each time.
    this.apply(new SparseBinaryOpApplier2(this, other, new Lambda.DoubleProd()));
}
 
开发者ID:mgormley,项目名称:prim,代码行数:8,代码来源:LongDoubleHashVector.java

示例4: product

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise product (i.e. Hadamard product) of this vector with the other. */
public void product(IntLongVector other) { 
    // TODO: This is correct, but will create lots of zero entries and not remove any.
    // Also this will be very slow if other is a IntLongSortedVector since it will have to
    // call get() each time.
    this.apply(new SparseBinaryOpApplier2(this, other, new Lambda.LongProd()));
}
 
开发者ID:mgormley,项目名称:prim,代码行数:8,代码来源:IntLongHashVector.java

示例5: add

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise sum of this vector with the other. */
public void add(IntDoubleVector other) {
    if (other instanceof IntDoubleUnsortedVector) {
        IntDoubleUnsortedVector vec = (IntDoubleUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], vec.vals[i]);
        }
    } else {
        //  TODO: Add special case for IntDoubleDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.DoubleAdd()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:IntDoubleDenseVector.java

示例6: subtract

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise difference of this vector with the other. */
public void subtract(IntDoubleVector other) {
    if (other instanceof IntDoubleUnsortedVector) {
        IntDoubleUnsortedVector vec = (IntDoubleUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], -vec.vals[i]);
        }
    } else {
        // TODO: Add special case for IntDoubleDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.DoubleSubtract()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:IntDoubleDenseVector.java

示例7: add

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise sum of this vector with the other. */
public void add(IntIntVector other) {
    if (other instanceof IntIntUnsortedVector) {
        IntIntUnsortedVector vec = (IntIntUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], vec.vals[i]);
        }
    } else {
        //  TODO: Add special case for IntIntDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.IntAdd()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:IntIntDenseVector.java

示例8: subtract

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise difference of this vector with the other. */
public void subtract(IntIntVector other) {
    if (other instanceof IntIntUnsortedVector) {
        IntIntUnsortedVector vec = (IntIntUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], -vec.vals[i]);
        }
    } else {
        // TODO: Add special case for IntIntDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.IntSubtract()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:IntIntDenseVector.java

示例9: product

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise product (i.e. Hadamard product) of this vector with the other. */
public void product(LongIntVector other) { 
    // TODO: This is correct, but will create lots of zero entries and not remove any.
    // Also this will be very slow if other is a LongIntSortedVector since it will have to
    // call get() each time.
    this.apply(new SparseBinaryOpApplier2(this, other, new Lambda.IntProd()));
}
 
开发者ID:mgormley,项目名称:prim,代码行数:8,代码来源:LongIntHashVector.java

示例10: product

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise product (i.e. Hadamard product) of this vector with the other. */
public void product(IntFloatVector other) { 
    // TODO: This is correct, but will create lots of zero entries and not remove any.
    // Also this will be very slow if other is a IntFloatSortedVector since it will have to
    // call get() each time.
    this.apply(new SparseBinaryOpApplier2(this, other, new Lambda.FloatProd()));
}
 
开发者ID:mgormley,项目名称:prim,代码行数:8,代码来源:IntFloatHashVector.java

示例11: add

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise sum of this vector with the other. */
public void add(IntLongVector other) {
    if (other instanceof IntLongUnsortedVector) {
        IntLongUnsortedVector vec = (IntLongUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], vec.vals[i]);
        }
    } else {
        //  TODO: Add special case for IntLongDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.LongAdd()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:IntLongDenseVector.java

示例12: subtract

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise difference of this vector with the other. */
public void subtract(IntLongVector other) {
    if (other instanceof IntLongUnsortedVector) {
        IntLongUnsortedVector vec = (IntLongUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], -vec.vals[i]);
        }
    } else {
        // TODO: Add special case for IntLongDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.LongSubtract()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:IntLongDenseVector.java

示例13: add

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise sum of this vector with the other. */
public void add(LongIntVector other) {
    if (other instanceof LongIntUnsortedVector) {
        LongIntUnsortedVector vec = (LongIntUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], vec.vals[i]);
        }
    } else {
        //  TODO: Add special case for LongIntDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.IntAdd()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:LongIntDenseVector.java

示例14: subtract

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise difference of this vector with the other. */
public void subtract(LongIntVector other) {
    if (other instanceof LongIntUnsortedVector) {
        LongIntUnsortedVector vec = (LongIntUnsortedVector) other;
        for (int i=0; i<vec.top; i++) {
            this.add(vec.idx[i], -vec.vals[i]);
        }
    } else {
        // TODO: Add special case for LongIntDenseVector.
        other.iterate(new SparseBinaryOpApplier(this, new Lambda.IntSubtract()));
    }
}
 
开发者ID:mgormley,项目名称:prim,代码行数:13,代码来源:LongIntDenseVector.java

示例15: product

import edu.jhu.prim.util.Lambda; //导入依赖的package包/类
/** Updates this vector to be the entrywise product (i.e. Hadamard product) of this vector with the other. */
public void product(IntIntVector other) { 
    // TODO: This is correct, but will create lots of zero entries and not remove any.
    // Also this will be very slow if other is a IntIntSortedVector since it will have to
    // call get() each time.
    this.apply(new SparseBinaryOpApplier2(this, other, new Lambda.IntProd()));
}
 
开发者ID:mgormley,项目名称:prim,代码行数:8,代码来源:IntIntHashVector.java


注:本文中的edu.jhu.prim.util.Lambda类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。