本文整理汇总了Java中gnu.trove.function.TDoubleFunction类的典型用法代码示例。如果您正苦于以下问题:Java TDoubleFunction类的具体用法?Java TDoubleFunction怎么用?Java TDoubleFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TDoubleFunction类属于gnu.trove.function包,在下文中一共展示了TDoubleFunction类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: applyTruncation
import gnu.trove.function.TDoubleFunction; //导入依赖的package包/类
public void applyTruncation(StringKeyedVector instance) {
final double update = this.optimizer.getDecreasingLearningRate(epoch) * truncationUpdate;
final double threshold = truncationThreshold;
TDoubleFunction truncFn = new TDoubleFunction() {
public double execute(double parameter) {
if (parameter > 0 && parameter < threshold) {
return Math.max(0, parameter - update);
} else if (parameter < 0 && parameter > -threshold) {
return Math.min(0, parameter + update);
} else {
return parameter;
}
}
};
param.transformValues(truncFn);
param.removeZeroCoordinates();
}
开发者ID:etsy,项目名称:Conjecture,代码行数:20,代码来源:UpdateableLinearModel.java
示例2: transformValues
import gnu.trove.function.TDoubleFunction; //导入依赖的package包/类
/** {@inheritDoc} */
public void transformValues( TDoubleFunction function ) {
byte[] states = _states;
double[] values = _values;
for ( int i = values.length; i-- > 0; ) {
if ( states[i] == FULL ) {
values[i] = function.execute( values[i] );
}
}
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TByteDoubleHashMap.java
示例3: transformValues
import gnu.trove.function.TDoubleFunction; //导入依赖的package包/类
/**
* Transform the values in this map using <tt>function</tt>.
*
* @param function a <code>TDoubleFunction</code> value
*/
public void transformValues( TDoubleFunction function ) {
Object[] keys = _set;
double[] values = _values;
for ( int i = values.length; i-- > 0; ) {
if ( keys[i] != null && keys[i] != REMOVED ) {
values[i] = function.execute( values[i] );
}
}
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:15,代码来源:TObjectDoubleHashMap.java
示例4: transformValues
import gnu.trove.function.TDoubleFunction; //导入依赖的package包/类
/** {@inheritDoc} */
public void transformValues(TDoubleFunction function) {
for (TDoubleLink l = head; got(l);) {
//
l.setValue(function.execute(l.getValue()));
//
l = l.getNext();
}
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TDoubleLinkedList.java
示例5: transformValues
import gnu.trove.function.TDoubleFunction; //导入依赖的package包/类
/**
* Transform the values in this map using <tt>function</tt>.
*
* @param function a <code>TDoubleFunction</code> value
*/
public void transformValues(final TDoubleFunction function ) {
final Object[] keys = _set;
final double[] values = _values;
for ( int i = values.length; i-- > 0; ) {
if ( keys[i] != null && keys[i] != REMOVED ) {
values[i] = function.execute( values[i] );
}
}
}
开发者ID:digitalheir,项目名称:java-probabilistic-earley-parser,代码行数:15,代码来源:TObjectDoubleHashMap.java
示例6: transformValues
import gnu.trove.function.TDoubleFunction; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void transformValues( TDoubleFunction function ) {
TByteOffheapArray states = _states;
TDoubleOffheapArray values = _values;
for ( int i = capacity(); i-- > 0; ) {
if ( states.get( i ) == FULL ) {
values.put( i, function.execute( values.get( i ) ) );
}
}
}
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:12,代码来源:TIntDoubleOffheapHashMap.java
示例7: transformValues
import gnu.trove.function.TDoubleFunction; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void transformValues( TDoubleFunction function ) {
byte[] states = _states;
double[] values = _values;
for ( int i = values.length; i-- > 0; ) {
if ( states[i] == FULL ) {
values[i] = function.execute( values[i] );
}
}
}
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:12,代码来源:TByteDoubleHashMap.java
注:本文中的gnu.trove.function.TDoubleFunction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论