#include <ResizeArray.h>
Public Methods | |
ResizeArray (ptrdiff_t s=3L) | |
Constructor The first argument is the initial internal size of the array, i.e. the initial number of elements for which to allocate memory (although the initial external size of the array will be zero). More... | |
~ResizeArray () | |
ptrdiff_t | num (void) const |
current size of array. More... | |
T & | operator[] (ptrdiff_t N) |
unchecked accessor, for speed. More... | |
T const & | operator[] (ptrdiff_t N) const |
a const version of above. More... | |
void | set_size (ptrdiff_t N) |
Set "occupied" array size to N elements -- Expert use only. More... | |
void | extend (ptrdiff_t addN) |
resize array to accomodate up to addN new elements -- Expert use only. More... | |
void | append (const T &val) |
add a new element to the end of the array. More... | |
void | append2 (const T &vala, const T &valb) |
add two new elements to the end of the array, e.g. angles. More... | |
void | append3 (const T &vala, const T &valb, const T &valc) |
add three new elements to the end of the array, e.g. angles. More... | |
void | append4 (const T &vala, const T &valb, const T &valc, const T &vald) |
add four new elements to the end of the array, e.g. dihedrals/impropers. More... | |
void | appendN (const T &val, ptrdiff_t addN) |
add N elements to the end of the array. More... | |
void | append3 (const T *vals) |
add three new elements, e.g. vertex/normal/color to the end of the array. More... | |
void | append2x3 (const T *valsa, const T *valsb) |
add two groups of three new elements to the end of the array. More... | |
void | append3x3 (const T *valsa, const T *valsb, const T *valsc) |
add three groups of three new elements to the end of the array. More... | |
void | append9 (const T *vals) |
add nine new elements, e.g. v0+v1+v2, vertex+normal+color, to the end of the array. More... | |
void | appendlist (const T *vals, ptrdiff_t addN) |
add N elements to the end of the array. More... | |
void | remove (ptrdiff_t n) |
remove an item from the array, shifting remaining items down by 1. More... | |
T & | pop () |
remove the last item from the array, unchecked for speed. More... | |
void | clear () |
delete entire array by defining size to be empty. More... | |
void | truncatelastn (ptrdiff_t N) |
truncate the array by defining the size to be N items less. More... | |
ptrdiff_t | find (const T &val) |
scan the array until the first item that matches in the array is found. Return the index if found, (-1) otherwise. More... |
Definition at line 41 of file ResizeArray.h.
|
Constructor The first argument is the initial internal size of the array, i.e. the initial number of elements for which to allocate memory (although the initial external size of the array will be zero).
Definition at line 56 of file ResizeArray.h. |
|
Definition at line 62 of file ResizeArray.h. |
|
|
add two new elements to the end of the array, e.g. angles.
Definition at line 135 of file ResizeArray.h. |
|
add two groups of three new elements to the end of the array.
Definition at line 180 of file ResizeArray.h. Referenced by OSPRayDisplayDevice::text, OSPRay2DisplayDevice::text, and OptiXDisplayDevice::text. |
|
add three new elements, e.g. vertex/normal/color to the end of the array.
Definition at line 171 of file ResizeArray.h. |
|
add three new elements to the end of the array, e.g. angles.
Definition at line 143 of file ResizeArray.h. Referenced by QuickSurf::calc_surf, DisplayDevice::find_pbc_cells, Molecule::get_new_frames, measure_pbc_neighbors, measure_sasa, measure_sasa_perresidue, X3DOMDisplayDevice::text, X3DDisplayDevice::text, OSPRayDisplayDevice::text, OSPRay2DisplayDevice::text, OptiXDisplayDevice::text, and MolFilePlugin::write_structure. |
|
add three groups of three new elements to the end of the array.
Definition at line 193 of file ResizeArray.h. |
|
add four new elements to the end of the array, e.g. dihedrals/impropers.
Definition at line 152 of file ResizeArray.h. Referenced by MolFilePlugin::write_structure. |
|
add nine new elements, e.g. v0+v1+v2, vertex+normal+color, to the end of the array.
Definition at line 211 of file ResizeArray.h. |
|
add N elements to the end of the array.
Definition at line 226 of file ResizeArray.h. |
|
add N elements to the end of the array.
Definition at line 162 of file ResizeArray.h. |
|
|
resize array to accomodate up to addN new elements -- Expert use only.
Definition at line 81 of file ResizeArray.h. Referenced by ResizeArray< ShapeClass >::append, ResizeArray< ShapeClass >::append2, ResizeArray< ShapeClass >::append2x3, ResizeArray< ShapeClass >::append3, ResizeArray< ShapeClass >::append3x3, ResizeArray< ShapeClass >::append4, ResizeArray< ShapeClass >::append9, ResizeArray< ShapeClass >::appendlist, ResizeArray< ShapeClass >::appendN, and ResizeArray< ShapeClass >::set_size. |
|
scan the array until the first item that matches in the array is found. Return the index if found, (-1) otherwise.
Definition at line 262 of file ResizeArray.h. |
|
|
a const version of above.
Definition at line 68 of file ResizeArray.h. |
|
unchecked accessor, for speed.
Definition at line 67 of file ResizeArray.h. |
|
remove the last item from the array, unchecked for speed.
Definition at line 243 of file ResizeArray.h. |
|
remove an item from the array, shifting remaining items down by 1.
Definition at line 235 of file ResizeArray.h. Referenced by GeometryList::del_geometry. |
|
Set "occupied" array size to N elements -- Expert use only.
Definition at line 71 of file ResizeArray.h. |
|
truncate the array by defining the size to be N items less.
Definition at line 254 of file ResizeArray.h. Referenced by SmallRing::remove_last. |