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


Java DoubleArrayList.add方法代码示例

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


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

示例1: learnStateFromRegions

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
public void learnStateFromRegions(int state,
                                  Collection<Region> regions) throws NotFoundException {
    DoubleArrayList values = new DoubleArrayList();
    for (Region r : regions) {
        data.window(r.getChrom(), r.getStart(), r.getEnd());
        for (int i = 0; i < data.getCount(); i++) {
            for (int j = 0; j < data.getReplicates(i); j++) {
                double d = Math.log(data.getRatio(i,j));
                if (!(Double.isInfinite(d) || Double.isNaN(d))) {
                    values.add(d);
                }
            }
        }
    }
    double mean = Descriptive.mean(values);
    double std = Descriptive.standardDeviation(Descriptive.variance(values.size(),
                                                                    Descriptive.sum(values),
                                                                    Descriptive.sumOfSquares(values)));
    /* TODO : verify that OpdfGaussian wants the variance rather than the stddev */
    pdfs.set(state, new OpdfGaussian(mean, std * std));
}
 
开发者ID:shaunmahony,项目名称:multigps-archive,代码行数:22,代码来源:CGHCallExpander.java

示例2: for

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
Fills the coordinates and values of cells having non-zero values into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists all have a new size, the number of non-zero values.
<p>
In general, fill order is <i>unspecified</i>.
This implementation fill like: <tt>for (slice = 0..slices-1) for (row = 0..rows-1) for (column = 0..colums-1) do ... </tt>.
However, subclasses are free to us any other order, even an order that may change over time as cell values are changed.
(Of course, result lists indexes are guaranteed to correspond to the same cell).
For an example, see {@link DoubleMatrix2D#getNonZeros(IntArrayList,IntArrayList,DoubleArrayList)}.

@param sliceList the list to be filled with slice indexes, can have any size.
@param rowList the list to be filled with row indexes, can have any size.
@param columnList the list to be filled with column indexes, can have any size.
@param valueList the list to be filled with values, can have any size.
*/
public void getNonZeros(IntArrayList sliceList, IntArrayList rowList, IntArrayList columnList, DoubleArrayList valueList) {
	sliceList.clear(); 
	rowList.clear(); 
	columnList.clear(); 
	valueList.clear();
	int s = slices;
	int r = rows;
	int c = columns;
	for (int slice=0; slice < s; slice++) {
		for (int row=0; row < r; row++) {
			for (int column=0; column < c; column++) {
				double value = getQuick(slice,row,column);
				if (value != 0) {
					sliceList.add(slice);
					rowList.add(row);
					columnList.add(column);
					valueList.add(value);
				}
			}
		}
	}
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:39,代码来源:DoubleMatrix3D.java

示例3: moment

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
 * Returns the moment of <tt>k</tt>-th order with value <tt>c</tt>,
 * which is <tt>Sum( (x[i]-c)<sup>k</sup> ) / size()</tt>.
 *
 * @param k the order; must be greater than or equal to zero.
 * @param c any number.
 * @throws IllegalArgumentException if <tt>k < 0</tt>.
 * @return <tt>Double.NaN</tt> if <tt>!hasSumOfPower(k)</tt>.
 */
public synchronized double moment(int k, double c) {
	if (k<0) throw new IllegalArgumentException("k must be >= 0");
	//checkOrder(k);
	if (!hasSumOfPowers(k)) return Double.NaN;

	int maxOrder = Math.min(k,getMaxOrderForSumOfPowers());
	DoubleArrayList sumOfPows = new DoubleArrayList(maxOrder+1);
	sumOfPows.add(size());
	sumOfPows.add(sum());
	sumOfPows.add(sumOfSquares());
	for (int i=3; i<=maxOrder; i++) sumOfPows.add(sumOfPowers(i));
	
	return Descriptive.moment(k, c, size(), sumOfPows.elements());
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:24,代码来源:MightyStaticBin1D.java

示例4: testPrognoseBerechnen

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
@Ignore @Test
public void testPrognoseBerechnen(){
	DoubleArrayList dal = new DoubleArrayList();
	dal.add(1);
	dal.add(2);
	
	DoubleMatrix2D matrixPhi = null;;
	//at.prognoseBerechnen(dal, matrixPhi, 1.5, 2, 2, 2, 1.5, true);
	assertTrue(true);
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:11,代码来源:TestAnalysisTimeSeriesRemaining.java

示例5: testErwarteteWerteBerechnen

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
@Ignore @Test
public void testErwarteteWerteBerechnen(){
	DoubleArrayList dal = new DoubleArrayList();
	dal.add(1);
	dal.add(2);
	
	DoubleMatrix2D matrixPhi = null;
	//at.erwarteteWerteBerechnen(dal, matrixPhi, 2, 2, 1.5, true);
	assertTrue(true);
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:11,代码来源:TestAnalysisTimeSeriesRemaining.java

示例6: testValidierung

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
@Ignore @Test
public void testValidierung(){
	DoubleArrayList dal = new DoubleArrayList();
	dal.add(1);
	dal.add(2);
	
	DoubleMatrix2D matrixPhi = null;
	
	//at.validierung(dal, matrixPhi, 2);
	assertTrue(true);
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:12,代码来源:TestAnalysisTimeSeriesRemaining.java

示例7: Divides

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
Divides (rebins) a copy of the receiver at the given <i>interval boundaries</i> into bins and returns these bins, such that each bin <i>approximately</i> reflects the data elements of its range.

For each interval boundary of the axis (including -infinity and +infinity), computes the percentage (quantile inverse) of elements less than the boundary.
Then lets {@link #splitApproximately(DoubleArrayList,int)} do the real work.

@param axis an axis defining interval boundaries.
@param resolution a measure of accuracy; the desired number of subintervals per interval. 
*/
public synchronized MightyStaticBin1D[] splitApproximately(hep.aida.IAxis axis, int k) {
	DoubleArrayList percentages = new DoubleArrayList(new hep.aida.ref.Converter().edges(axis));
	percentages.beforeInsert(0,Double.NEGATIVE_INFINITY);
	percentages.add(Double.POSITIVE_INFINITY);
	for (int i=percentages.size(); --i >= 0; ) {
		percentages.set(i, quantileInverse(percentages.get(i)));
	}
	
	return splitApproximately(percentages,k); 
}
 
开发者ID:ContentWise,项目名称:aida,代码行数:20,代码来源:QuantileBin1D.java

示例8: bandwidthNRD

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
public double bandwidthNRD(double[] in) {

        DoubleArrayList inList = new DoubleArrayList(in.length);
        for (double d : in)
            inList.add(d);
        inList.sort();

        final double h = (Descriptive.quantile(inList, 0.75) - Descriptive.quantile(inList, 0.25)) / 1.34;

        return 4 * 1.06 *
                Math.min(Math.sqrt(DiscreteStatistics.variance(in)), h) *
                Math.pow(in.length, -0.2);
    }
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:14,代码来源:KernelDensityEstimator2D.java

示例9: bandwidthNRD

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
public double bandwidthNRD(double[] in) {

		DoubleArrayList inList = new DoubleArrayList(in.length);
		for (double d : in)
			inList.add(d);
		inList.sort();

		final double h = (Descriptive.quantile(inList, 0.75) - Descriptive
				.quantile(inList, 0.25)) / 1.34;

		return 4 * 1.06
				* Math.min(Math.sqrt(DiscreteStatistics.variance(in)), h)
				* Math.pow(in.length, -0.2);
	}
 
开发者ID:phylogeography,项目名称:SpreaD3,代码行数:15,代码来源:KernelDensityEstimator2D.java

示例10: from

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
static DoubleArrayList from(final IScope scope, final IContainer values) {
	final DoubleArrayList d = new DoubleArrayList(values.length(scope));
	for (final Object o : values.iterable(scope)) {
		if (o instanceof Number) {
			d.add(((Number) o).doubleValue());
		}
	}

	return d;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:11,代码来源:Stats2.java

示例11: observedEpsilonsAtPhis

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
 * This method was created in VisualAge.
 * @return double[]
 * @param values cern.it.hepodbms.primitivearray.DoubleArrayList
 * @param phis double[]
 */
public static DoubleArrayList observedEpsilonsAtPhis(DoubleArrayList phis, ExactDoubleQuantileFinder exactFinder, DoubleQuantileFinder approxFinder, double desiredEpsilon) {
	DoubleArrayList epsilons = new DoubleArrayList(phis.size());
	
	for (int i=phis.size(); --i >=0;) {
		double epsilon = observedEpsilonAtPhi(phis.get(i), exactFinder, approxFinder);
		epsilons.add(epsilon);
		if (epsilon>desiredEpsilon) System.out.println("Real epsilon = "+epsilon+" is larger than desired by "+(epsilon-desiredEpsilon));
	}
	return epsilons;
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:17,代码来源:QuantileFinderTest.java

示例12: get

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
Fills the coordinates and values of cells having non-zero values into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists all have a new size, the number of non-zero values.
<p>
In general, fill order is <i>unspecified</i>.
This implementation fills like: <tt>for (index = 0..size()-1)  do ... </tt>.
However, subclasses are free to us any other order, even an order that may change over time as cell values are changed.
(Of course, result lists indexes are guaranteed to correspond to the same cell).
<p>
<b>Example:</b>
<br>
<pre>
0, 0, 8, 0, 7
-->
indexList  = (2,4)
valueList  = (8,7)
</pre>
In other words, <tt>get(2)==8, get(4)==7</tt>.

@param indexList the list to be filled with indexes, can have any size.
@param valueList the list to be filled with values, can have any size.
*/
public void getNonZeros(IntArrayList indexList, DoubleArrayList valueList, int maxCardinality) {
	boolean fillIndexList = indexList != null;
	boolean fillValueList = valueList != null;
	int card = cardinality(maxCardinality);
	if (fillIndexList) indexList.setSize(card);
	if (fillValueList) valueList.setSize(card);
	if (!(card<maxCardinality)) return;

	if (fillIndexList) indexList.setSize(0);
	if (fillValueList) valueList.setSize(0);
	int s = size;
	for (int i=0; i < s; i++) {
		double value = getQuick(i);
		if (value != 0) {
			if (fillIndexList) indexList.add(i);
			if (fillValueList) valueList.add(value);
		}
	}
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:43,代码来源:DoubleMatrix1D.java

示例13: for

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
Fills the coordinates and values of cells having non-zero values into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists all have a new size, the number of non-zero values.
<p>
In general, fill order is <i>unspecified</i>.
This implementation fills like <tt>for (row = 0..rows-1) for (column = 0..columns-1) do ... </tt>.
However, subclasses are free to us any other order, even an order that may change over time as cell values are changed.
(Of course, result lists indexes are guaranteed to correspond to the same cell).
<p>
<b>Example:</b>
<br>
<pre>
2 x 3 matrix:
0, 0, 8
0, 7, 0
-->
rowList    = (0,1)
columnList = (2,1)
valueList  = (8,7)
</pre>
In other words, <tt>get(0,2)==8, get(1,1)==7</tt>.

@param rowList the list to be filled with row indexes, can have any size.
@param columnList the list to be filled with column indexes, can have any size.
@param valueList the list to be filled with values, can have any size.
*/
public void getNonZeros(IntArrayList rowList, IntArrayList columnList, DoubleArrayList valueList) {
	rowList.clear(); 
	columnList.clear(); 
	valueList.clear();
	int r = rows;
	int c = columns;
	for (int row=0; row < r; row++) {
		for (int column=0; column < c; column++) {
			double value = getQuick(row,column);
			if (value != 0) {
				rowList.add(row);
				columnList.add(column);
				valueList.add(value);
			}
		}
	}
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:45,代码来源:DoubleMatrix2D.java

示例14: IntDoubleProcedure

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
Fills all pairs satisfying a given condition into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size, the number of pairs satisfying the condition.
Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(IntProcedure)}.
<p>
<b>Example:</b>
<br>
<pre>
IntDoubleProcedure condition = new IntDoubleProcedure() { // match even keys only
	public boolean apply(int key, double value) { return key%2==0; }
}
keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
</pre>

@param condition    the condition to be matched. Takes the current key as first and the current value as second argument.
@param keyList the list to be filled with keys, can have any size.
@param valueList the list to be filled with values, can have any size.
*/
public void pairsMatching(final IntDoubleProcedure condition, final IntArrayList keyList, final DoubleArrayList valueList) {
	keyList.clear();
	valueList.clear();
	
	for (int i = table.length ; i-- > 0 ;) {
		if (state[i]==FULL && condition.apply(table[i],values[i])) {
			keyList.add(table[i]);
			valueList.add(values[i]);
		}
	}
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:31,代码来源:OpenIntDoubleHashMap.java

示例15: DoubleIntProcedure

import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
Fills all pairs satisfying a given condition into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size, the number of pairs satisfying the condition.
Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(DoubleProcedure)}.
<p>
<b>Example:</b>
<br>
<pre>
DoubleIntProcedure condition = new DoubleIntProcedure() { // match even values only
	public boolean apply(double key, int value) { return value%2==0; }
}
keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
</pre>

@param condition    the condition to be matched. Takes the current key as first and the current value as second argument.
@param keyList the list to be filled with keys, can have any size.
@param valueList the list to be filled with values, can have any size.
*/
public void pairsMatching(final DoubleIntProcedure condition, final DoubleArrayList keyList, final IntArrayList valueList) {
	keyList.clear();
	valueList.clear();
	
	for (int i = table.length ; i-- > 0 ;) {
		if (state[i]==FULL && condition.apply(table[i],values[i])) {
			keyList.add(table[i]);
			valueList.add(values[i]);
		}
	}
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:31,代码来源:OpenDoubleIntHashMap.java


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