Package xal.extension.fit.lsm
Class DataStore
java.lang.Object
xal.extension.fit.lsm.DataStore
The data container to use inside the solver
- Author:
- shishlo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRecord
(double y, double x) Adds a record to the DataStore objectvoid
addRecord
(double y, double[] x) Adds a record to the DataStore objectvoid
addRecord
(double y, double yErr, double x) Adds a record to the DataStore objectvoid
addRecord
(double y, double yErr, double[] x) Adds a record to the DataStore objectvoid
clear()
Removes all recordsint
Returns number of independent variables for this storagedouble[]
getArrX
(int i) Returns the array with x-values for the record with index idouble
getErrY
(int i) Returns y error value for the record with index idouble
getY
(int i) Returns y value for the record with index iint
size()
Returns the numbers of records with (y,x_arr) pairs
-
Constructor Details
-
DataStore
public DataStore()Constructor for the DataStore object -
DataStore
public DataStore(double[] y, double[][] x) Constructor for the DataStore object with initial data- Parameters:
y
- The y-values arrayx
- The x-variables two-dimensional array
-
DataStore
public DataStore(double[] y, double[] yErr, double[][] x) Constructor for the DataStore object with initial data- Parameters:
y
- The y-values arrayyErr
- The y-errors values arrayx
- The x-variables two-dimensional array
-
-
Method Details
-
size
public int size()Returns the numbers of records with (y,x_arr) pairs- Returns:
- The numbers of records with (y,x_arr) pairs
-
detVarsNumber
public int detVarsNumber()Returns number of independent variables for this storage- Returns:
- The size of x_arr array
-
getY
public double getY(int i) Returns y value for the record with index i- Parameters:
i
- The index of the record- Returns:
- The y value
-
getErrY
public double getErrY(int i) Returns y error value for the record with index i- Parameters:
i
- The index of the record- Returns:
- The y error value
-
getArrX
public double[] getArrX(int i) Returns the array with x-values for the record with index i- Parameters:
i
- The index of the record- Returns:
- The array with x-values
-
clear
public void clear()Removes all records -
addRecord
public void addRecord(double y, double[] x) Adds a record to the DataStore object- Parameters:
y
- The y-valuex
- The independent values array
-
addRecord
public void addRecord(double y, double x) Adds a record to the DataStore object- Parameters:
y
- The y-valuex
- The independent x value
-
addRecord
public void addRecord(double y, double yErr, double[] x) Adds a record to the DataStore object- Parameters:
y
- The y-valueyErr
- The y_value errorx
- The independent values array
-
addRecord
public void addRecord(double y, double yErr, double x) Adds a record to the DataStore object- Parameters:
y
- The y-valueyErr
- The y_value errorx
- The independent x value
-