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


Java DescriptiveStatistics.INFINITE_WINDOW属性代码示例

本文整理汇总了Java中org.apache.commons.math.stat.descriptive.DescriptiveStatistics.INFINITE_WINDOW属性的典型用法代码示例。如果您正苦于以下问题:Java DescriptiveStatistics.INFINITE_WINDOW属性的具体用法?Java DescriptiveStatistics.INFINITE_WINDOW怎么用?Java DescriptiveStatistics.INFINITE_WINDOW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.math.stat.descriptive.DescriptiveStatistics的用法示例。


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

示例1: getValues

/**
 * @see org.apache.commons.math.stat.descriptive.DescriptiveStatistics#getValues()
 */
public double[] getValues() {

    int length = list.size();

    // If the window size is not INFINITE_WINDOW AND
    // the current list is larger that the window size, we need to
    // take into account only the last n elements of the list
    // as definied by windowSize

    if (windowSize != DescriptiveStatistics.INFINITE_WINDOW &&
        windowSize < list.size())
    {
        length = list.size() - Math.max(0, list.size() - windowSize);
    }

    // Create an array to hold all values
    double[] copiedArray = new double[length];

    for (int i = 0; i < copiedArray.length; i++) {
        copiedArray[i] = getElement(i);
    }
    return copiedArray;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:26,代码来源:ListUnivariateImpl.java

示例2: getElement

/**
 * @see org.apache.commons.math.stat.descriptive.DescriptiveStatistics#getElement(int)
 */
public double getElement(int index) {

    double value = Double.NaN;

    int calcIndex = index;

    if (windowSize != DescriptiveStatistics.INFINITE_WINDOW &&
        windowSize < list.size())
    {
        calcIndex = (list.size() - windowSize) + index;
    }

    
    try {
        value = transformer.transform(list.get(calcIndex));
    } catch (MathException e) {
        e.printStackTrace();
    }
    
    return value;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:24,代码来源:ListUnivariateImpl.java

示例3: getValues

/** {@inheritDoc} */
@Override
public double[] getValues() {

    int length = list.size();

    // If the window size is not INFINITE_WINDOW AND
    // the current list is larger that the window size, we need to
    // take into account only the last n elements of the list
    // as definied by windowSize

    if (windowSize != DescriptiveStatistics.INFINITE_WINDOW &&
        windowSize < list.size())
    {
        length = list.size() - Math.max(0, list.size() - windowSize);
    }

    // Create an array to hold all values
    double[] copiedArray = new double[length];

    for (int i = 0; i < copiedArray.length; i++) {
        copiedArray[i] = getElement(i);
    }
    return copiedArray;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:25,代码来源:ListUnivariateImpl.java

示例4: getN

/** {@inheritDoc} */
@Override
public long getN() {
    int n = 0;

    if (windowSize != DescriptiveStatistics.INFINITE_WINDOW) {
        if (list.size() > windowSize) {
            n = windowSize;
        } else {
            n = list.size();
        }
    } else {
        n = list.size();
    }
    return n;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:16,代码来源:ListUnivariateImpl.java

示例5: getElement

/** {@inheritDoc} */
@Override
public double getElement(int index) {

    double value = Double.NaN;

    int calcIndex = index;

    if (windowSize != DescriptiveStatistics.INFINITE_WINDOW &&
        windowSize < list.size())
    {
        calcIndex = (list.size() - windowSize) + index;
    }


    try {
        value = transformer.transform(list.get(calcIndex));
    } catch (MathException e) {
        e.printStackTrace();
    }

    return value;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:ListUnivariateImpl.java

示例6: getElement

/** {@inheritDoc} */
@Override
public double getElement(int index) {

    double value = Double.NaN;

    int calcIndex = index;

    if (windowSize != DescriptiveStatistics.INFINITE_WINDOW &&
        windowSize < list.size())
    {
        calcIndex = (list.size() - windowSize) + index;
    }

    
    try {
        value = transformer.transform(list.get(calcIndex));
    } catch (MathException e) {
        e.printStackTrace();
    }
    
    return value;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:ListUnivariateImpl.java

示例7: getN

/**
 * @see org.apache.commons.math.stat.descriptive.DescriptiveStatistics#getN()
 */
public long getN() {
    int n = 0;

    if (windowSize != DescriptiveStatistics.INFINITE_WINDOW) {
        if (list.size() > windowSize) {
            n = windowSize;
        } else {
            n = list.size();
        }
    } else {
        n = list.size();
    }
    return n;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:ListUnivariateImpl.java


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