org.jlab.groot.data
Class DataVector
- java.lang.Object
-
- org.jlab.groot.data.DataVector
-
public class DataVector extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description DataVector()DataVector(double[] data)DataVector(int size)DataVector(java.util.List<java.lang.Double> data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(double value)Add value to the vector and ensure that the vector is ordered.voidaddDataVector(DataVector vec)voidclear()voidcopy(DataVector vec)voiddivide(double norm)Divides the content of the vector by given number.intfindBin(double value)intfindBin(double value, int start)double[]getArray()intgetBinSuggestion()doublegetBinWidth(int index)DataVectorgetCumulative()Returns cumulative integral of the vector.doublegetHighEdge(int bin)doublegetLowEdge(int bin)Returns the low edge for the bin which is determined by bin width.doublegetMax()calculate maximum value in the datadoublegetMean()Calculates the mean of the vector.doublegetMean(DataVector xvec)Calculates the normalized mean with the given axis.doublegetMin()calculate the minimum value in the data.doublegetRMS()intgetSize()Returns the number of entries in the vectordoublegetValue(int index)booleanisOrdered()voidmult(double norm)Multiplies the whole data with the provided numbervoidset(double[] data)Initialize the array with given values.voidset(int index, double value)voidset(java.util.List<java.lang.Double> data)voidsetValue(int index, double value)intsize()
-
-
-
Constructor Detail
-
DataVector
public DataVector(int size)
-
DataVector
public DataVector()
-
DataVector
public DataVector(double[] data)
-
DataVector
public DataVector(java.util.List<java.lang.Double> data)
-
-
Method Detail
-
set
public final void set(double[] data)
Initialize the array with given values.- Parameters:
data- initial data
-
set
public final void set(java.util.List<java.lang.Double> data)
-
size
public int size()
-
clear
public void clear()
-
addDataVector
public void addDataVector(DataVector vec)
-
add
public void add(double value)
Add value to the vector and ensure that the vector is ordered. If the value does not appear to be in ordered mode, then set the flag ordered to FALSE.- Parameters:
value- next value to the data vector.
-
getMin
public double getMin()
calculate the minimum value in the data.- Returns:
- minimum of all data points
-
getMax
public double getMax()
calculate maximum value in the data- Returns:
- maximum value of the data.
-
getBinSuggestion
public int getBinSuggestion()
-
copy
public void copy(DataVector vec)
-
isOrdered
public boolean isOrdered()
-
findBin
public int findBin(double value)
-
findBin
public int findBin(double value, int start)
-
mult
public void mult(double norm)
Multiplies the whole data with the provided number- Parameters:
norm- multiplication factor
-
divide
public void divide(double norm)
Divides the content of the vector by given number.- Parameters:
norm-
-
getCumulative
public DataVector getCumulative()
Returns cumulative integral of the vector.- Returns:
-
getMean
public double getMean(DataVector xvec)
Calculates the normalized mean with the given axis.- Parameters:
xvec-- Returns:
-
getMean
public double getMean()
Calculates the mean of the vector.- Returns:
- mean value
-
getRMS
public double getRMS()
-
getSize
public int getSize()
Returns the number of entries in the vector- Returns:
- size
-
getValue
public double getValue(int index)
-
getLowEdge
public double getLowEdge(int bin)
Returns the low edge for the bin which is determined by bin width.- Parameters:
bin- bin number- Returns:
- the low edge for the bin.
-
getHighEdge
public double getHighEdge(int bin)
-
getBinWidth
public double getBinWidth(int index)
-
getArray
public double[] getArray()
-
set
public void set(int index, double value)
-
setValue
public void setValue(int index, double value)
-
-
DMelt 3.0 © DataMelt by jWork.ORG