My Project
|
vector<Double> container with their name tag. More...
#include <ElementContainer.hh>
Public Member Functions | |
ElementContainer () | |
Constructor. | |
ElementContainer (const HeaderBase &Header) | |
Constructor. | |
ElementContainer (const ElementContainer &ob) | |
Override the copy constructor. | |
~ElementContainer () | |
Destructor. Delete all objects stored in this storage. | |
ElementContainer & | operator= (const ElementContainer &ob) |
Override the operator of "=". | |
ElementContainer & | operator+= (const ElementContainer &r) |
ElementContainer & | MaskedPlus (const ElementContainer &r) |
ElementContainer & | MaskedSub (const ElementContainer &r) |
ElementContainer & | MaskedMul (const ElementContainer &r) |
ElementContainer & | MaskedDiv (const ElementContainer &r) |
ElementContainer & | operator+= (const std::pair< Double, Double > &r) |
ElementContainer & | operator+= (const Double r) |
ElementContainer | operator+ (const ElementContainer &r) const |
Override the operator of "+". | |
ElementContainer | operator+ (const std::pair< Double, Double > &r) const |
ElementContainer | operator+ (const Double r) const |
ElementContainer & | operator-= (const ElementContainer &r) |
ElementContainer & | operator-= (const std::pair< Double, Double > &r) |
ElementContainer & | operator-= (const Double r) |
ElementContainer | operator- (ElementContainer &r) const |
See the comment of "operator+". | |
ElementContainer | operator- (const std::pair< Double, Double > &r) const |
ElementContainer | operator- (const Double r) const |
ElementContainer & | operator*= (const ElementContainer &r) |
ElementContainer & | operator*= (const std::pair< Double, Double > &r) |
ElementContainer & | operator*= (const Double r) |
ElementContainer | operator* (ElementContainer &r) const |
See the comment of "operator+". | |
ElementContainer | operator* (const std::pair< Double, Double > &r) const |
ElementContainer | operator* (const Double r) const |
ElementContainer & | operator/= (const ElementContainer &r) |
ElementContainer & | operator/= (const std::pair< Double, Double > &r) |
ElementContainer & | operator/= (const Double r) |
ElementContainer | operator/ (ElementContainer &r) const |
See the comment of "operator+". | |
ElementContainer | operator/ (const std::pair< Double, Double > &r) const |
ElementContainer | operator/ (const Double r) const |
ElementContainer | ReBin (ElementContainer &E, string &Key) |
The number of bin and its width of the histogram are modified. | |
ElementContainer | ReBin (const vector< Double > &v) |
Core of Rebin() method. (averaging mode) See the comment of "ReBin(ElementContainer*, string)". | |
ElementContainer | Binning (const vector< Double > &v) |
Core of Binning() method. (binning mode) | |
ElementContainer | Binning (ElementContainer &E, string &Key) |
ElementContainer | Averaging (const vector< Double > &v) |
Core of Binning() method. (binning mode) | |
ElementContainer | Averaging (ElementContainer &E, string &Key) |
void | SetKeys (const string &X, const string &Y, const string &E) |
Set keys, they are key-names. | |
const string & | PutXKey () const |
Return X-key in string. | |
const string & | PutYKey () const |
Return Y-key in string. | |
const string & | PutEKey () const |
Return Y-Error-key in string. | |
vector< Double > | PutX () |
Return the vector assigned to X-value. | |
vector< Double > | PutY () |
Return the vector assigned to Y-value. | |
vector< Double > | PutE () |
Return the vector assigned to the error of Y-value. | |
PyObject * | PutXList () |
Return the Python-List assigned to X-value. | |
PyObject * | PutYList () |
Return the Python-List assigned to Y-value. | |
PyObject * | PutEList () |
Return the Python-List assigned to E-value. | |
UInt4 | PutTableSize () const |
Returns the number of vectors stored in this storage. | |
UInt4 | PutSize () const |
Arias of UInt4 PutTableSize(). | |
UInt4 | PutSize (UInt4 IndexNumber) const |
Returns the size of vectors assigned to the IndexNumber. | |
UInt4 | PutSize (const string &Key) const |
Returns the size of vectors assigned to the "Key". | |
Int8 | PutIndexNumber (const string &Key) |
Returns the IndexNumber assigned to the "Key". | |
string | PutName (UInt4 IndexNumber) |
vector< string > | PutKeys () |
Returns the "key" assigned to the "IndexNumber". | |
PyObject * | PutKeysList () |
HeaderBase | PutUnitHeader () |
HeaderBase | PutHeader () |
Returns the object of "HeaderBase" stored in this container. | |
HeaderBase * | PutHeaderPointer () |
void | InputUnitHeader (const HeaderBase &uHeader) |
void | InputHeader (const HeaderBase &Header) |
Input header-object. | |
void | ReSetUnit (string key, string unit) |
void | DumpKey () |
Dump Key-name(s) with index-number(s) in table format to the standard-output. | |
void | Add (const string &Key, vector< Double > value, const string &Unit="None") |
Append and install a vector object with "Key". | |
void | Add (const string &Key, vector< Float > value, const string &Unit="None") |
Append and install a vector object with "Key". | |
void | Add (const string &Key, vector< UInt4 > value, const string &Unit="None") |
Append and install a vector object with "Key". | |
void | Add (const string &Key, vector< UInt2 > value, const string &Unit="None") |
Append and install a vector object with "Key". | |
void | Add (const string &Key, PyObject *value, const string &Unit="None") |
Append and install a Python-List object with "Key". | |
void | Add (const string &Key, Double *&Array, UInt4 ArraySize, const string &Unit="None") |
Append and install an array object with "Key". | |
void | Add (const string &Key, Float *&Array, UInt4 ArraySize, const string &Unit="None") |
Append and install an array object with "Key". | |
void | Add (const string &Key, UInt4 *&Array, UInt4 ArraySize, const string &Unit="None") |
Append and install an array object with "Key". | |
void | Add (const string &Key, UInt2 *&Array, UInt4 ArraySize, const string &Unit="None") |
Append and install an array object with "Key". | |
void | AddBlankVector (const string &Key, UInt4 Size=0, const string &Unit="None") |
Append a vector<Double> with its Key. | |
vector< Double > | Find (const string &Key) |
Returns the pointer of the vector-object assigned to "Key". | |
vector< Double > | Find (UInt4 IndexNumber) |
Returns the pointer of the vector-object assigned to "IndexNumber". | |
Double | Find (const string &Key, UInt4 Index) |
Returns Index-th Double value extracted from the vector named as "Key". | |
vector< Double > | Put (UInt4 IndexNumber) |
Alias of Find(IndexNumber), returns a vector object. | |
vector< Double > | Put (const string &Key) |
Alias of Find(Key), returns a vector object. | |
Double | Put (const string &Key, UInt4 Index) |
Alias of Find(string,UInt4). | |
string | PutUnit (const string &Key) const |
void | SetUnit (const string &Key, const string &NewUnit) |
PyObject * | PutList (const string &Key) |
Returns the Python-List object which is converted vector<Double>. | |
vector< Double > | ReduceColumn (const string &Key) |
PyObject * | ReduceColumnList (const string &Key) |
UInt4 | CheckKey (const string &Key) |
This method returns zero, if the vector whose name is "Key" is not contained in the storage. | |
void | Copy (const string &Old, const string &New) |
Copy the vector object. The new vector object is created named as "x". Each value is copied from the "vector-Old" to the "vector-New". | |
void | Remove (const string &Key) |
Remove a vector object whose name is "Key". | |
void | Replace (const string &Key, const vector< Double > &value) |
void | Replace (const string &Key, PyObject *value) |
Replace the vector assigned to Key. | |
void | AppendValue (const string &Key, Double value) |
This method appends "value" to the target vector specified by "Key". | |
void | AppendValue (const string &Key, const vector< Double > &value) |
This method appends "vector<Double> value" to the vector assigned to "Key". | |
void | SetValue (const string &Key, UInt4 Number, Double value) |
This method can change the "Number"-th value of the target vector. The vector is extracted with "Key". | |
template<class T > | |
void | Transform (const std::string &Key, T F, const std::string &newunit="None") |
void | Reverse (void) |
reverse all std::vector | |
void | Dump () |
Dump all information stored in this container to the standard output. | |
PyObject * | PyDump () |
void | dump () |
void | DumpValue () |
void | DumpFromVectorContainer () |
void | DumpFromVectorContainer (UInt4 size) |
void | Dump (UInt4 size) |
The method of "Dump()" will dump whole information stored in this container. | |
void | DumpValue (UInt4 size) |
string | PutXYEKeys () |
string | PutMergedKey () |
vector< UInt4 > | PutSizeVector () |
vector< Double > | PutMergedDataVector () |
void | BuildElementContainer (string XYEKeys, string MergedKey, vector< UInt4 > SizeVector, vector< Double > MergedDataVector, HeaderBase h, HeaderBase uh) |
Build a new ElementContainer instance from long vector Mergedkey and MergedDataVector. | |
vector< Double > * | operator() (const string &Key) |
This operator returns the pointer of vector<Double> whose name is "Key". | |
vector< Double > * | operator() (UInt4 index) |
This operator returns the pointer of vector<Double> whose index-number is "index". | |
void | AddToHeader (const string &Key, Int4 value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (const string &Key, Double value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (const string &Key, string value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (const string &Key, vector< Int4 > value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (const string &Key, vector< Double > value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (const string &Key, vector< string > value) |
Data objects can be installed into the header-object with its name-tag. | |
Double | Sum (const string &key, const UInt4 i0, const UInt4 i1) const |
Returns the sum of each element of the target vector within the specified range [i0, i1). | |
Double | Sum (const string &key) const |
Returns the sum of each element of the target vector. The argument of this method is the key of the target vector. | |
Double | Sum (void) const |
Returns the sum of each element of the target vector. Ykey is selected as a target. | |
std::pair< Double, Double > | Sum (const string &key, const string &err_key, UInt4 i0, UInt4 i1) const |
Returns Sum(key, err_key) within the range [i0, i1) | |
std::pair< Double, Double > | Sum (const string &key, const string &err_key) const |
Returns the sum of each element of the target vector and its error. | |
std::pair< Double, Double > | Sum2 (void) const |
Returns Sum( Ykey, Ekey ) | |
std::pair< Double, Double > | Sum (Double ini, Double fin) const |
Returns the sum of values of "Ykey" in the range between ini and fin of "Xkey" with errors. | |
Double | Ave (const string &key) |
Returns the average value of the target vector. The average value will be obtained without its error. | |
Double | Ave (const string &key, const string &err) |
Returns the average value of the target vector. The average value will be obtained with its error. | |
Double | Min (const string &key) |
Returns the minimal value contained in the target vector. | |
Double | Max (const string &key) |
Returns the maximum value contained in the target vector. | |
std::pair< Double, Double > | Integrate () |
This method obtains the area of the histogram defined with "Xkey", "Ykey" and "Ekey". | |
std::pair< Double, Double > | Integrate (Double ini, Double fin) |
This method obtains the area of the histogram defined with "Xkey", "Ykey" and "Ekey". | |
void | SaveToBinFile (string key, string FileName) |
histogram data whose name is "key" is saved to a binary file named as "FileName". | |
void | ReadBinFile (string FileName, string key) |
A binary file stored by "SaveToBinFile(string,string)" is read by this method. | |
void | SaveTextFile (string FileName) |
void | SaveTextFile (string FileName, Int4 prec) |
void | SaveTextFile (string FileName, Char deli) |
void | SaveTextFile (string FileName, Int4 prec, Char deli) |
This method saves Histogram data defined by "keys" on a TEXT file named "FileName". by Y.I. and modified by T.I. | |
void | LoadTextFile (string FileName) |
This method saves Histogram data defined by "keys" on a TEXT file named "FileName". by Y.I. | |
ElementContainer | Mul (Double d) |
ElementContainer & | MulMySelf (Double d) |
ElementContainer | Mul (Double d, Double e) |
ElementContainer & | MulMySelf (Double d, Double e) |
ElementContainer | Mul (pair< Double, Double > &d) |
ElementContainer & | MulMySelf (pair< Double, Double > &d) |
ElementContainer | Plus (Double d) |
ElementContainer & | PlusMySelf (Double d) |
ElementContainer | Plus (Double d, Double e) |
ElementContainer & | PlusMySelf (Double d, Double e) |
ElementContainer | Plus (pair< Double, Double > &d) |
ElementContainer & | PlusMySelf (pair< Double, Double > &d) |
Public Attributes | |
bool | safesum |
if true, Sum() performs Kahan's Compensated Summation | |
Friends | |
class | boost::serialization::access |
class | WriteNeXusFile |
class | ReadNeXusFile |
vector<Double> container with their name tag.
This class is used as a data container. The STL vectors, "vector<Double>", and each its name tag are stored in this class object.
Comparing with NeutronVectorS, this class has some methods which is convenient to use vector<Double>. Since this class can not store array-objects, this class is more effective than "NeutronVectorS". This class is also designed to use this class from Python environment. Array objects of C++ are not convenient to use, because special functions on the Python are needed to access C++ arrays. But STL-vector of C++ is a little easy to use on the Python environment, because STL-vector can be converted to Python-list object easily, and in some cases, STL-vector can be accessed directly on the Python with SWIG-interface.
"Key" is the name tag assigned to each vector<Double>. Each vector<Double> stored in this class object can be extracted with the "Key" or "IndexNumber". If you want to know their names registered in this storage, use "DumpName()" and you can see their names on the standard-output.
When the destructor of this class is called, all data containers and a header object installed in this class will deleted completely. Copy constructor of this class can also work completely on Python.
Constructor.
If the header object is not required, use this method.
ElementContainer::ElementContainer | ( | const HeaderBase & | Header | ) |
Constructor.
The header object is received and held in this storage.
void ElementContainer::Add | ( | const string & | Key, |
vector< Double > | value, | ||
const string & | Unit = "None" |
||
) |
Append and install a vector object with "Key".
If the type of second argument is not vector<Double>, the data object will be converted into vector<Double> in this method.
void ElementContainer::Add | ( | const string & | Key, |
vector< Float > | value, | ||
const string & | Unit = "None" |
||
) |
Append and install a vector object with "Key".
If the type of second argument is not vector<Double>, the data object will be converted into vector<Double> in this method.
void ElementContainer::Add | ( | const string & | Key, |
vector< UInt4 > | value, | ||
const string & | Unit = "None" |
||
) |
Append and install a vector object with "Key".
If the type of second argument is not vector<Double>, the data object will be converted into vector<Double> in this method.
void ElementContainer::Add | ( | const string & | Key, |
vector< UInt2 > | value, | ||
const string & | Unit = "None" |
||
) |
Append and install a vector object with "Key".
If the type of second argument is not vector<Double>, the data object will be converted into vector<Double> in this method.
void ElementContainer::Add | ( | const string & | Key, |
PyObject * | value, | ||
const string & | Unit = "None" |
||
) |
Append and install a Python-List object with "Key".
If the type of "value" is not "Python-List", the error message will be shown by CppToPython.
void ElementContainer::Add | ( | const string & | Key, |
Double *& | Array, | ||
UInt4 | ArraySize, | ||
const string & | Unit = "None" |
||
) |
Append and install an array object with "Key".
The array object will be converted into a vector<Double> in this method.
void ElementContainer::Add | ( | const string & | Key, |
Float *& | Array, | ||
UInt4 | ArraySize, | ||
const string & | Unit = "None" |
||
) |
Append and install an array object with "Key".
The array object will be converted into a vector<Double> in this method.
void ElementContainer::Add | ( | const string & | Key, |
UInt4 *& | Array, | ||
UInt4 | ArraySize, | ||
const string & | Unit = "None" |
||
) |
Append and install an array object with "Key".
The array object will be converted into a vector<Double> in this method.
void ElementContainer::Add | ( | const string & | Key, |
UInt2 *& | Array, | ||
UInt4 | ArraySize, | ||
const string & | Unit = "None" |
||
) |
Append and install an array object with "Key".
The array object will be converted into a vector<Double> in this method.
void ElementContainer::AddBlankVector | ( | const string & | Key, |
UInt4 | Size = 0 , |
||
const string & | Unit = "None" |
||
) |
Append a vector<Double> with its Key.
The size of the vector is "Size", and its default size is zero. A vector object is created in this method, and appended to the container with "Key". This method is very useful for manipulating this class from the Python environment.
void ElementContainer::AddToHeader | ( | const string & | Key, |
Int4 | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void ElementContainer::AddToHeader | ( | const string & | Key, |
Double | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void ElementContainer::AddToHeader | ( | const string & | Key, |
string | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void ElementContainer::AddToHeader | ( | const string & | Key, |
vector< Int4 > | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void ElementContainer::AddToHeader | ( | const string & | Key, |
vector< Double > | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void ElementContainer::AddToHeader | ( | const string & | Key, |
vector< string > | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void ElementContainer::AppendValue | ( | const string & | Key, |
Double | value | ||
) | [inline] |
This method appends "value" to the target vector specified by "Key".
The class method of STL-vector, append(Double), is used in this method.
void ElementContainer::AppendValue | ( | const string & | Key, |
const vector< Double > & | value | ||
) |
This method appends "vector<Double> value" to the vector assigned to "Key".
The vector "value" is connected to the end of the vector.
ElementContainer ElementContainer::Averaging | ( | const vector< Double > & | v | ) |
Core of Binning() method. (binning mode)
v | reference to a reference vector |
ElementContainer ElementContainer::Binning | ( | const vector< Double > & | v | ) |
Core of Binning() method. (binning mode)
v | reference to a reference vector |
void ElementContainer::BuildElementContainer | ( | string | XYEKeys, |
string | MergedKey, | ||
vector< UInt4 > | SizeVector, | ||
vector< Double > | MergedDataVector, | ||
HeaderBase | h, | ||
HeaderBase | uh | ||
) |
Build a new ElementContainer instance from long vector Mergedkey and MergedDataVector.
The object of HeaderBase, the fifth argument, will be deleted in this function. If the object extracted with "PutHeader()" is installed with this function, you should copy it before use this function.
UInt4 ElementContainer::CheckKey | ( | const string & | Key | ) | [inline] |
This method returns zero, if the vector whose name is "Key" is not contained in the storage.
The integer returned by this method expresses the number of the vectors assigned to "Key". But the value is not 0 or 1, the serious problems may occur in this class.
void ElementContainer::Dump | ( | ) |
Dump all information stored in this container to the standard output.
If you want to convert this output into vector<string>, the vector object can be input into "ReceiveString(vector<string>)".
void ElementContainer::Dump | ( | UInt4 | size | ) |
The method of "Dump()" will dump whole information stored in this container.
If the size of vectors are huge, "Dump()" will completely fill up your console with data. This method will shorten the size of vector shown in your console.
void ElementContainer::InputHeader | ( | const HeaderBase & | Header | ) |
Input header-object.
If the header object has installed already, the object is deleted, and the given header-object will be duplicated and its copy object will be installed.
std::pair< Double, Double > ElementContainer::Integrate | ( | ) |
This method obtains the area of the histogram defined with "Xkey", "Ykey" and "Ekey".
The first element of the return vector is the area integrated in this method, and the second argument is its error value. Before calling this method, you should set "Xkey", "Ykey" and "Ekey" with "SetKeys(string,string,string)". arranged by Y.I.
std::pair< Double, Double > ElementContainer::Integrate | ( | Double | ini, |
Double | fin | ||
) |
This method obtains the area of the histogram defined with "Xkey", "Ykey" and "Ekey".
< The first element of the return vector is the area integrated in this method, and the second argument is its error value. Before calling this method, you should set "Xkey", "Ykey" and "Ekey" with "SetKeys(string,string,string)". The arguments of this methods are the start and end index of the histogram. When the size of Y-vector is S, the indices should be set from zero to (S-1).
vector<Double>* ElementContainer::operator() | ( | const string & | Key | ) | [inline] |
This operator returns the pointer of vector<Double> whose name is "Key".
If you want to obtain vector objects, use "Put(string)". This method should only be used for the accessing methods in the vector-objects.
vector<Double>* ElementContainer::operator() | ( | UInt4 | index | ) | [inline] |
This operator returns the pointer of vector<Double> whose index-number is "index".
If you want to obtain vector objects, use "Put(UInt4)". This method should only be used for the accessing methods in the vector-objects.
ElementContainer ElementContainer::operator* | ( | const std::pair< Double, Double > & | r | ) | const [inline] |
* operation of a ElementContainer and a value (with error)
ElementContainer ElementContainer::operator* | ( | const Double | r | ) | const [inline] |
* operation of a value (without error)
ElementContainer & ElementContainer::operator*= | ( | const ElementContainer & | r | ) |
*= operation of ElementContainers with rebinning and error propagation
ElementContainer & ElementContainer::operator*= | ( | const std::pair< Double, Double > & | r | ) |
*= operation of a value (with error)
ElementContainer& ElementContainer::operator*= | ( | const Double | r | ) | [inline] |
*= operation of a value (without error)
ElementContainer ElementContainer::operator+ | ( | const ElementContainer & | r | ) | const [inline] |
Override the operator of "+".
The returned ElementContainer should delete in your codes.
ElementContainer ElementContainer::operator+ | ( | const std::pair< Double, Double > & | r | ) | const [inline] |
+ operation of a ElementContainer and a value (with error)
ElementContainer ElementContainer::operator+ | ( | const Double | r | ) | const [inline] |
+ operation of a value (without error)
ElementContainer & ElementContainer::operator+= | ( | const ElementContainer & | r | ) |
+= operation of ElementContainers with rebinning and error propagation
ElementContainer & ElementContainer::operator+= | ( | const std::pair< Double, Double > & | r | ) |
+= operation of a value (with error)
ElementContainer& ElementContainer::operator+= | ( | const Double | r | ) | [inline] |
+= operation of a value (without error)
ElementContainer ElementContainer::operator- | ( | const std::pair< Double, Double > & | r | ) | const [inline] |
subtract(-) operation of a ElementContainer and a value (with error)
ElementContainer ElementContainer::operator- | ( | const Double | r | ) | const [inline] |
subtract(-) operation of a value (without error)
ElementContainer & ElementContainer::operator-= | ( | const ElementContainer & | r | ) |
-= operation of ElementContainers with rebinning and error propagation
ElementContainer & ElementContainer::operator-= | ( | const std::pair< Double, Double > & | r | ) |
-= operation of a value (with error)
ElementContainer& ElementContainer::operator-= | ( | const Double | r | ) | [inline] |
-= operation of a value (without error)
ElementContainer ElementContainer::operator/ | ( | ElementContainer & | r | ) | const [inline] |
See the comment of "operator+".
If the denominator is zero, the Y-value and its error in returned object are set as 0.0 and 1.0, respectively.
ElementContainer ElementContainer::operator/ | ( | const std::pair< Double, Double > & | r | ) | const [inline] |
/ operation of a ElementContainer and a value (with error)
ElementContainer ElementContainer::operator/ | ( | const Double | r | ) | const [inline] |
/ operation of a value (without error)
ElementContainer & ElementContainer::operator/= | ( | const ElementContainer & | r | ) |
/= operation of ElementContainers with rebinning and error propagation
ElementContainer & ElementContainer::operator/= | ( | const std::pair< Double, Double > & | r | ) |
/= operation of a value (with error)
ElementContainer& ElementContainer::operator/= | ( | const Double | r | ) | [inline] |
/= operation of a value (without error)
HeaderBase ElementContainer::PutHeader | ( | ) | [inline] |
Returns the object of "HeaderBase" stored in this container.
This method will duplicate the original object, and return it. If you want to access the method of the object installed in this class, use PutHeaderPointer().
Int8 ElementContainer::PutIndexNumber | ( | const string & | Key | ) | [inline] |
Returns the IndexNumber assigned to the "Key".
This method will be return -1, when "Key" has not been registored. The type of the return value is Int8, because negative values should be returned.
vector< string > ElementContainer::PutKeys | ( | ) |
Returns the "key" assigned to the "IndexNumber".
<
PyObject* ElementContainer::PutList | ( | const string & | Key | ) | [inline] |
Returns the Python-List object which is converted vector<Double>.
The each element of the Python-List is equal to the vector returned by Put( Key ). This method is written on C++, the speed of converting from STL-vector object to Python-List object in this method is faster than that in Python environment.
UInt4 ElementContainer::PutSize | ( | const string & | Key | ) | const [inline] |
Returns the size of vectors assigned to the "Key".
This method is left for keeping the compatibility with the old version frameworks.
void ElementContainer::ReadBinFile | ( | string | FileName, |
string | key | ||
) |
A binary file stored by "SaveToBinFile(string,string)" is read by this method.
The format of the target file is a dump file of double type C-language array. The target file data will be stored into ElementContainer with "key".
ElementContainer ElementContainer::ReBin | ( | ElementContainer & | E, |
string & | Key | ||
) | [inline] |
The number of bin and its width of the histogram are modified.
The bin properties are set by the vector extracted from the arguments. The returned container has only three columns which have specified as x, y, and ye. The original data-container, "*this" is not changed, and the returned ElementContainer should delete in your codes.
ElementContainer ElementContainer::ReBin | ( | const vector< Double > & | v | ) |
Core of Rebin() method. (averaging mode) See the comment of "ReBin(ElementContainer*, string)".
You can define the bin propertis of the histogram directory.
v | reference to a reference vector |
void ElementContainer::SetKeys | ( | const string & | X, |
const string & | Y, | ||
const string & | E | ||
) |
Set keys, they are key-names.
"X" is assigned to the x-value column name, and "Y" is assigned to the y-value column name, "E" is assigned to the y-value-error column name. The x, y and error column with their key should be installed by the methods of "Add(...)" before this method is called. The keys, "X", "Y" and "E" were set as "None" in the constructor.
void ElementContainer::SetValue | ( | const string & | Key, |
UInt4 | Number, | ||
Double | value | ||
) |
This method can change the "Number"-th value of the target vector. The vector is extracted with "Key".
If the value of the second argument, "Number", is larger than the size of target vector, a warning message will be shown.
std::pair< Double, Double > ElementContainer::Sum | ( | const string & | key, |
const string & | err_key | ||
) | const |
Returns the sum of each element of the target vector and its error.
The type of the rerurn value is std::pair<Double, Double>. The first element of the vector is the sum, and the second one is the its error. To calculate the sum and its error, this method requires you to input two keys. The first value of the return vector is equal to the return value of Sum(string).
std::pair< Double, Double > ElementContainer::Sum | ( | Double | ini, |
Double | fin | ||
) | const |
Returns the sum of values of "Ykey" in the range between ini and fin of "Xkey" with errors.
The type of the rerurn value is std::pair<Double, Double>. The first element of the vector is the sum, and the second one is the its error. To calculate the sum and its error, this method requires you to input two keys. ... arranged by Y.I.
void ElementContainer::Transform | ( | const std::string & | Key, |
T | F, | ||
const std::string & | newunit = "None" |
||
) |
performs std::transform() to a vector with specified key and function object
Key | a key which specifies the target vector |
F() | a function object |
newunit | new unit |