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


Java LinearInterpolator.interpolate方法代码示例

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


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

示例1: smooth

import org.apache.commons.math3.analysis.interpolation.LinearInterpolator; //导入方法依赖的package包/类
@Override
public double[] smooth(double[] sourceX, double[] noisyY, double[] estimateX, double parameter) {

	if(sourceX.length < 2)
	{
		return new double[sourceX.length];
	}
	
	LinearInterpolator interpolator = new LinearInterpolator();		
	PolynomialSplineFunction estimateFunc = interpolator.interpolate(sourceX, noisyY);
	double[] result = new double[estimateX.length];
	for(int i =0; i < estimateX.length;i++)
	{
		if(estimateFunc.isValidPoint(estimateX[i]))
		{
			result[i] = estimateFunc.value(estimateX[i]);
		}
		else
		{
			result[i] = Double.NaN;
		}
	}
	return result ;
}
 
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:25,代码来源:LinearSmoothingProvider.java

示例2: linearInterpFunc

import org.apache.commons.math3.analysis.interpolation.LinearInterpolator; //导入方法依赖的package包/类
/**
 * Make linear interpolation function - PolynomialSplineFunction
 * @param x X data
 * @param y Y data
 * @return Linear interpolation function
 */
public static PolynomialSplineFunction linearInterpFunc(Array x, Array y) {
    double[] xd = (double[]) ArrayUtil.copyToNDJavaArray(x);
    double[] yd = (double[]) ArrayUtil.copyToNDJavaArray(y);
    LinearInterpolator li = new LinearInterpolator(); 
    PolynomialSplineFunction psf = li.interpolate(xd, yd);

    return psf;
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:15,代码来源:InterpUtil.java

示例3: UpdateDialogListener

import org.apache.commons.math3.analysis.interpolation.LinearInterpolator; //导入方法依赖的package包/类
UpdateDialogListener(double[] cx, double[] cy, double maxY, int centre, double scale, PlotWindow pw,
		Label label)
{
	offset = (int) cx[0];
	this.cy = cy;

	// Interpolate missing values
	int upper = cx.length - 1;
	if (cx[upper] - cx[0] != upper)
	{
		LinearInterpolator in = new LinearInterpolator();
		PolynomialSplineFunction f = in.interpolate(cx, cy);
		cx = SimpleArrayUtils.newArray(upper + 1, cx[0], 1.0);
		cy = new double[cx.length];
		for (int i = 0; i < cx.length; i++)
			cy[i] = f.value(cx[i]);
	}

	this.maxY = maxY;
	this.centre = centre;
	this.scale = scale;
	this.pw = pw;
	this.label = label;
	drawing = Utils.isShowGenericDialog();
	if (drawing)
		update();
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:28,代码来源:PSFDrift.java


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