本文整理汇总了Java中gnu.trove.list.TDoubleList.toArray方法的典型用法代码示例。如果您正苦于以下问题:Java TDoubleList.toArray方法的具体用法?Java TDoubleList.toArray怎么用?Java TDoubleList.toArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.list.TDoubleList
的用法示例。
在下文中一共展示了TDoubleList.toArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sort
import gnu.trove.list.TDoubleList; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void sort(int fromIndex, int toIndex) {
TDoubleList tmp = subList(fromIndex, toIndex);
double[] vals = tmp.toArray();
Arrays.sort(vals);
set(fromIndex, vals);
}
示例2: sort
import gnu.trove.list.TDoubleList; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void sort(int fromIndex, int toIndex) {
TDoubleList tmp = subList(fromIndex, toIndex);
double[] vals = tmp.toArray();
Arrays.sort(vals);
set(fromIndex, vals);
}
示例3: arange
import gnu.trove.list.TDoubleList; //导入方法依赖的package包/类
/**
* Returns an array which starts from lowerBounds (inclusive) and
* ends at the upperBounds (exclusive).
*
* @param lowerBounds the starting value
* @param upperBounds the maximum value (exclusive)
* @param interval the amount by which to increment the values
* @return
*/
public static double[] arange(double lowerBounds, double upperBounds, double interval) {
TDoubleList doubs = new TDoubleArrayList();
for (double i = lowerBounds; i < upperBounds; i += interval) {
doubs.add(i);
}
return doubs.toArray();
}