Public Member Functions |
vector< Double > | ArrayToVector (Double *p, UInt4 size) |
vector< Float > | ArrayToVector (Float *p, UInt4 size) |
vector< Int4 > | ArrayToVector (Int4 *p, UInt4 size) |
vector< UInt4 > | ArrayToVector (UInt4 *p, UInt4 size) |
vector< Int2 > | ArrayToVector (Int2 *p, UInt4 size) |
vector< UInt2 > | ArrayToVector (UInt2 *p, UInt4 size) |
vector< string > | ArrayToVector (string *p, UInt4 size) |
vector< bool > | ArrayToVector (bool *p, UInt4 size) |
vector< Double > | MakeVectorDouble (UInt4 size=0) |
vector< Float > | MakeVectorFloat (UInt4 size=0) |
vector< Int4 > | MakeVectorInt4 (Int4 size=0) |
vector< UInt4 > | MakeVectorUInt4 (UInt4 size=0) |
vector< Int2 > | MakeVectorInt2 (Int2 size=0) |
vector< UInt2 > | MakeVectorUInt2 (UInt2 size=0) |
vector< string > | MakeVectorString (UInt4 size=0) |
vector< bool > | MakeVectorBool (UInt4 size=0) |
vector< string > | ReadVectorString (string FileName) |
vector< Double > * | MakeVectorDoubleP (UInt4 size=0) |
vector< Float > * | MakeVectorFloatP (UInt4 size=0) |
vector< Int4 > * | MakeVectorInt4P (Int4 size=0) |
vector< UInt4 > * | MakeVectorUInt4P (UInt4 size=0) |
vector< Int2 > * | MakeVectorInt2P (Int2 size=0) |
vector< UInt2 > * | MakeVectorUInt2P (UInt2 size=0) |
vector< string > * | MakeVectorStringP (UInt4 size=0) |
vector< bool > * | MakeVectorBoolP (UInt4 size=0) |
Double * | VectorToArray (vector< Double > v) |
Float * | VectorToArray (vector< Float > v) |
Int4 * | VectorToArray (vector< Int4 > v) |
UInt4 * | VectorToArray (vector< UInt4 > v) |
Int2 * | VectorToArray (vector< Int2 > v) |
UInt2 * | VectorToArray (vector< UInt2 > v) |
string * | VectorToArray (vector< string > v) |
bool * | VectorToArray (vector< bool > v) |
pair< Double, Double > | MakeDoubleDoublePair (Double First, Double Second) |
Exchange tools of an Array and a Vector.
This class is a exchange tool of an Array and a Vector, can be applied to various types of vectors and arrays. Since the execution speed of Python is slower than C++, you should only use the Python environment for reading and writing Python List. "C++ vector"s can be recognized in the Python environment like "Python List", on the other hand, "C++ array" can only manipulate in the Python environment with special functions.
(a) If you want to change a "Python List" to a "C++ vector", (1) Make a "C++ vector" by using the MakeVectorInt4() of this class, (2) Copy values from the List to the Vector in Python environment with a for-loop.
(b) If you want to change a "Python List" to a "C++ array", (1) Run (a), then, (2) Copy the vector to an array with "VectorToArray( vector )" in this class.
(c) If you want to change a "C++ vector" to a "Python List", (1) Python is able to handle C++ vector like Python List.
(d) If you want to change a "C++ array" to a "Python List", (1) change an array to a vector by "ArrayToVector()", and then, (2) see (c).