本文整理汇总了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()));
}
}
示例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()));
}
}
示例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()));
}
示例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()));
}
示例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()));
}
}
示例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()));
}
}
示例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()));
}
}
示例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()));
}
}
示例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()));
}
示例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()));
}
示例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()));
}
}
示例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()));
}
}
示例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()));
}
}
示例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()));
}
}
示例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()));
}