|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjhplot.PND
public class PND
/** A container to hold data points in many dimensions. All numbers are expected to be in double precision. It extends ArrayList and adds many new features for data manipulation. The class does not have graphical option (use H1D to show the data or methods of this class which transform P0D to a H1D histogram).
Constructor Summary | |
---|---|
PND()
Construct an empty container with no title |
|
PND(java.lang.String title)
Construct an empty container with a title |
|
PND(java.lang.String title,
boolean shallow,
PND pnd)
Construct a copy from a PND. |
|
PND(java.lang.String title,
java.lang.String file)
Construct a container with a title from external file (see the method toFile() how to write such ASCII file) |
Method Summary | |
---|---|
void |
add(double[] values)
Adds (appends) the specified element to the end of this list. |
void |
add(P0D values)
Adds (appends) P0D to the end of this list. |
void |
clear()
Clear the container |
PND |
copy(java.lang.String newtitle)
Create an exact copy of the current P0D. |
double[] |
get(int row)
Return a specific row as array |
double |
get(int row,
int column)
Return a specific value. |
double[][] |
getArray()
Get a double array with values. |
java.util.ArrayList<double[]> |
getArrayList()
Get data in form of ArrayList |
P0D |
getColumn(int column)
Return a specific column as array |
int |
getDimension()
Get last dimension of the data. |
hep.aida.IDataPointSet |
getIDataPointSet()
Get the data point set for JAIDA |
P0D |
getRow(int row)
Return a specific row as array |
PND |
getRows(java.lang.String newtitle,
int indexMin,
int indexMax)
Get rows : min is inxluded, max is not; |
java.lang.String |
getTitle()
Get a new title |
static void |
main(java.lang.String[] args)
Test |
PND |
oper(PND pnd,
java.lang.String what)
Operations on PND containers: add, subtract, multiply, divide. |
PND |
oper(PND pnd,
java.lang.String title,
java.lang.String what)
Operations on PND containers: add, subtract, multiply, divide. |
void |
operScale(double scale)
Scale each element of data |
void |
print()
Print PND to System.out. |
int |
read(java.lang.String sfile)
Read the data from external file. |
int |
readGZip(java.lang.String sfile)
Read the data from external GZipped file. |
PND |
readSerialized(java.lang.String name)
Read a PND object from a serialized file |
int |
readZip(java.lang.String sfile)
Read the data from ZIPed external file. |
PND |
remove(int index)
Remove a row |
PND |
rescale(double[][] v)
This is an inverse operation to rescale(type) function. |
double[][] |
rescale(int type)
Rescale the column vectors. |
void |
set(int index,
double[] values)
Sets (replace) the specified row. |
void |
set(int index,
P0D values)
Sets (replace) the specified element with P0D. |
PND |
setArray(double[][] values)
Set values from double array Old content will be lost. |
void |
setArrayList(java.util.ArrayList<double[]> array)
Set the data in form of ArrayList |
void |
setTitle(java.lang.String title)
Set a new title |
int |
size()
Data size (number of rows) |
PND |
standardize()
Standardize each column. |
void |
toFile(java.lang.String name)
Write a PND to an external file. |
java.lang.String |
toString()
Get a string representing PND |
void |
write(java.lang.String name)
Write a PND to an external file. |
int |
writeSerialized(java.lang.String name)
Write a P0D object to a serialized file |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PND(java.lang.String title)
title
- A titlepublic PND(java.lang.String title, boolean shallow, PND pnd)
title
- new titleshallow
- if true, a shallow copy of a collection.pnd
- inpit datapublic PND(java.lang.String title, java.lang.String file)
title
- A titlefile
- input file namepublic PND()
Method Detail |
---|
public void setTitle(java.lang.String title)
title
- New Titlepublic java.lang.String getTitle()
public void clear()
public double[] get(int row)
row
- index of the row
public double get(int row, int column)
row
- row indexcolumn
- column index
public java.lang.String toString()
toString
in class java.lang.Object
public void print()
public P0D getColumn(int column)
column
- index of the column
public int getDimension()
public P0D getRow(int row)
row
- index of the row
public java.util.ArrayList<double[]> getArrayList()
public hep.aida.IDataPointSet getIDataPointSet()
public void add(double[] values)
values
- array of values to be added.public void add(P0D values)
values
- array of values to be added.public void set(int index, double[] values)
index
- position indexvalues
- array of values to be added.public void set(int index, P0D values)
index
- position indexvalues
- array of values to be added.public int read(java.lang.String sfile)
sfile
- File name with input
public int readGZip(java.lang.String sfile)
sfile
- File name with input (.gz extension)
public int readZip(java.lang.String sfile)
sfile
- File name with the input (extension .zip)
public void write(java.lang.String name)
name
- File name with outputpublic int writeSerialized(java.lang.String name)
name
- serialized file name for output.
public PND readSerialized(java.lang.String name)
name
- serialized file name for input.
public void toFile(java.lang.String name)
name
- File name with outputpublic PND remove(int index)
index
- row index to be removedpublic PND oper(PND pnd, java.lang.String what)
pnd
- Input PND container for operationwhat
- String representing the operation: "+" add a P0D container to
the original; "-" subtract a P0D from the original; "*"
multiply; "/" divide by P0D
public PND oper(PND pnd, java.lang.String title, java.lang.String what)
pnd
- Input PND container for operationtitle
- New titlewhat
- String representing the operation: "+" add a P0D container to
the original; "-" subtract a P0D from the original; "*"
multiply; "/" divide by P0D
public void operScale(double scale)
scale
- Scale factorpublic int size()
public PND copy(java.lang.String newtitle)
newtitle
- new titlepublic PND getRows(java.lang.String newtitle, int indexMin, int indexMax)
title
- New titleindexMin
- min index of rowindexMax
- max index of row
public void setArrayList(java.util.ArrayList<double[]> array)
array
- ArrayList to be set.public double[][] getArray()
public PND setArray(double[][] values)
values
- array to be set: [ROWS][dimension];
public PND standardize()
public double[][] rescale(int type)
type
- 0: is ths standard rescaling, i.e.
all columns are rescaled to the range [0,1] This is done
as: v[0] is the min value of X(i), v[1] is the range
(max-min).
type 1: midrange rescaling, i.e. all values are in the range [-1,1]. v[0] is 0.5*(min+max), while [1] is (max-min) /2
public PND rescale(double[][] v)
v
- array used to rescale the data. applied as X(i)=S(i)*v[1]+v[0]
public static void main(java.lang.String[] args)
args
-
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |