Chemical Data Processing Library Python API - Version 1.2.0
Public Member Functions | Properties | List of all members
CDPL.Math.Vector3ULArray Class Reference

An array of Math.Vector3UL objects. More...

+ Inheritance diagram for CDPL.Math.Vector3ULArray:

Public Member Functions

None __init__ ()
 Creates an empty array.
 
None __init__ (Vector3ULArray array)
 Initializes a copy of the Vector3ULArray instance array. More...
 
None __init__ (object a)
 Initializes the Vector3ULArray instance. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
int getSize ()
 Returns the number of elements stored in the array. More...
 
bool isEmpty ()
 Tells whether the array is empty (getSize() == 0). More...
 
None resize (int num_elem, Vector3UL value)
 Inserts or erases elements at the end so that the size becomes num_elem. More...
 
None reserve (int num_elem)
 Preallocates memory for (at least) num_elem elements. More...
 
int getCapacity ()
 Returns the number of elements for which memory has been allocated. More...
 
None clear ()
 Erases all elements.
 
Vector3ULArray assign (Vector3ULArray array)
 Replaces the current state of self with a copy of the state of the Vector3ULArray instance array. More...
 
None assign (int num_elem, Vector3UL value)
 This function fills the array with num_elem copies of the given value. More...
 
None assign (object a)
 Replaces the current state of self with a copy of the state of the object instance a. More...
 
None addElement (Vector3UL value)
 Inserts a new element at the end of the array. More...
 
None addElements (Vector3ULArray values)
 
None insertElement (int idx, Vector3UL value)
 Inserts a new element before the location specified by the index idx. More...
 
None insertElements (int idx, int num_elem, Vector3UL value)
 Inserts num_elem copies of value before the location specified by the index idx. More...
 
None insertElements (int index, Vector3ULArray values)
 
None popLastElement ()
 Removes the last element of the array. More...
 
None removeElement (int idx)
 Removes the element at the position specified by the index idx. More...
 
None removeElements (int begin_idx, int end_idx)
 
Vector3UL getFirstElement ()
 Returns a reference to the first element of the array. More...
 
Vector3UL getLastElement ()
 Returns a reference to the last element of the array. More...
 
Vector3UL getElement (int idx)
 Returns a reference to the element at index idx. More...
 
None setElement (int idx, Vector3UL value)
 Assigns a new value to the element specified by the index idx. More...
 
object toArray (bool as_vec)
 
None __delitem__ (int idx)
 
Vector3UL __getitem__ (int idx)
 
int __len__ ()
 
None __setitem__ (int index, Vector3UL value)
 
bool __eq__ (object array)
 Returns the result of the comparison operation self == array. More...
 
bool __ne__ (object array)
 Returns the result of the comparison operation self != array. More...
 

Properties

 objectID = property(getObjectID)
 
 size = property(getSize)
 

Detailed Description

An array of Math.Vector3UL objects.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Math.Vector3ULArray.__init__ ( Vector3ULArray  array)

Initializes a copy of the Vector3ULArray instance array.

Parameters
arrayThe Vector3ULArray instance to copy.

◆ __init__() [2/2]

None CDPL.Math.Vector3ULArray.__init__ ( object  a)

Initializes the Vector3ULArray instance.

Parameters
a

Member Function Documentation

◆ getObjectID()

int CDPL.Math.Vector3ULArray.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python Vector3ULArray instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two Vector3ULArray instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ getSize()

int CDPL.Math.Vector3ULArray.getSize ( )

Returns the number of elements stored in the array.

Returns
The size of the array.

◆ isEmpty()

bool CDPL.Math.Vector3ULArray.isEmpty ( )

Tells whether the array is empty (getSize() == 0).

Returns
True if the array is empty, False otherwise.

◆ resize()

None CDPL.Math.Vector3ULArray.resize ( int  num_elem,
Vector3UL  value 
)

Inserts or erases elements at the end so that the size becomes num_elem.

Parameters
num_elemThe new size.
valueThe value for newly inserted elements.

◆ reserve()

None CDPL.Math.Vector3ULArray.reserve ( int  num_elem)

Preallocates memory for (at least) num_elem elements.

If num_elem is less than or equal to the current capacity, this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then the capacity is greater than or equal to num_elem. Otherwise, the capacity is unchanged. In either case, the number of elements will not change.

Parameters
num_elemThe number of elements to reserve memory for.
See also
getCapacity()

◆ getCapacity()

int CDPL.Math.Vector3ULArray.getCapacity ( )

Returns the number of elements for which memory has been allocated.

The capacity is always greater than or equal to the number of currently stored elements.

Returns
The current capacity.

◆ assign() [1/3]

Vector3ULArray CDPL.Math.Vector3ULArray.assign ( Vector3ULArray  array)

Replaces the current state of self with a copy of the state of the Vector3ULArray instance array.

Parameters
arrayThe Vector3ULArray instance to copy.
Returns
self

◆ assign() [2/3]

None CDPL.Math.Vector3ULArray.assign ( int  num_elem,
Vector3UL  value 
)

This function fills the array with num_elem copies of the given value.

Note that the assignment completely changes the array and the new size is the same as the number of elements assigned. Old data will be lost.

Parameters
num_elemThe number of elements to be assigned.
valueThe value to be assigned.

◆ assign() [3/3]

None CDPL.Math.Vector3ULArray.assign ( object  a)

Replaces the current state of self with a copy of the state of the object instance a.

Parameters
aThe object instance to copy.
Returns
self

◆ addElement()

None CDPL.Math.Vector3ULArray.addElement ( Vector3UL  value)

Inserts a new element at the end of the array.

Parameters
valueThe value of the new element.

◆ addElements()

None CDPL.Math.Vector3ULArray.addElements ( Vector3ULArray  values)
Parameters
values

◆ insertElement()

None CDPL.Math.Vector3ULArray.insertElement ( int  idx,
Vector3UL  value 
)

Inserts a new element before the location specified by the index idx.

Parameters
idxThe location where to insert the new element.
valueThe value of the element to insert.
Exceptions
Base.IndexErrorif the array is empty or idx is not in the range [0, getSize()].

◆ insertElements() [1/2]

None CDPL.Math.Vector3ULArray.insertElements ( int  idx,
int  num_elem,
Vector3UL  value 
)

Inserts num_elem copies of value before the location specified by the index idx.

Parameters
idxThe location where to insert the new elements.
num_elemThe number of elements to insert.
valueThe value of the elements to insert.
Exceptions
Base.IndexErrorif idx is not in the range [0, getSize()].

◆ insertElements() [2/2]

None CDPL.Math.Vector3ULArray.insertElements ( int  index,
Vector3ULArray  values 
)
Parameters
index
values

◆ popLastElement()

None CDPL.Math.Vector3ULArray.popLastElement ( )

Removes the last element of the array.

Exceptions
Base.OperationFailedif the array is empty.

◆ removeElement()

None CDPL.Math.Vector3ULArray.removeElement ( int  idx)

Removes the element at the position specified by the index idx.

Parameters
idxThe zero-based index of the element to remove.
Exceptions
Base.IndexErrorif the array is empty or idx is not in the range [0, getSize() - 1].

◆ removeElements()

None CDPL.Math.Vector3ULArray.removeElements ( int  begin_idx,
int  end_idx 
)
Parameters
begin_idx
end_idx

◆ getFirstElement()

Vector3UL CDPL.Math.Vector3ULArray.getFirstElement ( )

Returns a reference to the first element of the array.

Returns
A reference to the first element.
Exceptions
Base.OperationFailedif the array is empty.

◆ getLastElement()

Vector3UL CDPL.Math.Vector3ULArray.getLastElement ( )

Returns a reference to the last element of the array.

Returns
A reference to the last element.
Exceptions
Base.OperationFailedif the array is empty.

◆ getElement()

Vector3UL CDPL.Math.Vector3ULArray.getElement ( int  idx)

Returns a reference to the element at index idx.

The method is equivalent to operator[](std::size_t).

Parameters
idxThe zero-based index of the element.
Returns
A reference to the element.
Exceptions
Base.IndexErrorif the array is empty or idx is not in the range [0, getSize() - 1].

◆ setElement()

None CDPL.Math.Vector3ULArray.setElement ( int  idx,
Vector3UL  value 
)

Assigns a new value to the element specified by the index idx.

Parameters
idxThe zero-based index of the element for which to assign a new value.
valueThe new value of the element after assignment.
Exceptions
Base.IndexErrorif the array is empty or idx is not in the range [0, getSize() - 1].

◆ toArray()

object CDPL.Math.Vector3ULArray.toArray ( bool  as_vec)
Parameters
as_vec
Returns

◆ __delitem__()

None CDPL.Math.Vector3ULArray.__delitem__ ( int  idx)
Parameters
idx

◆ __getitem__()

Vector3UL CDPL.Math.Vector3ULArray.__getitem__ ( int  idx)
Parameters
idx
Returns

◆ __len__()

int CDPL.Math.Vector3ULArray.__len__ ( )
Returns

◆ __setitem__()

None CDPL.Math.Vector3ULArray.__setitem__ ( int  index,
Vector3UL  value 
)
Parameters
index
value

◆ __eq__()

bool CDPL.Math.Vector3ULArray.__eq__ ( object  array)

Returns the result of the comparison operation self == array.

Parameters
arrayThe object instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__()

bool CDPL.Math.Vector3ULArray.__ne__ ( object  array)

Returns the result of the comparison operation self != array.

Parameters
arrayThe object instance to be compared with.
Returns
The result of the comparison operation.