The doubleList class provides a list of double precision floating point numbers. More...
| doubleList( ) | |
| doubleList( doubleList list ) | |
| void | append(double d) |
| double | at(int i) |
| void | clear() |
| bool | contains(double d) |
| int | indexOf(double d, int index=0) |
| void | insert(int pos, double value) |
| void | prepend(double value) |
| int | removeAll(double value) |
| void | removeAt(int pos) |
| int | size() |
| void | set(int i, double d) |
| void | swap(int pos1, int pos2) |
A doubleList is a dynamic list of double-precision numbers. cell getDensityLayer (the tiled overload) returns one density per window; plotData itemData returns one simulation row. In C++ macros a double array is the same type: you can index it as an array and still call at, contains, or append. Index 0 is the first entry; size is the count; set has no effect if i is past the end. clear empties the list; insert and prepend grow it; removeAll returns how many values were dropped. In Python this maps to a native list of floats rather than this class name.
Example:
doubleList dens;
dens.append(0.25);
dens.append(0.80);
if (dens.contains(0.25)) {
double v = dens.at(0);
dens.set(1, v + 0.1);
}
Creates an empty list of doubles.
Creates a list of doubles with copied data from list.
Inserts d at the end of the list.
Returns: the double at index i. The first entry is 0.
Removes all items from the list. (introduced with release 20230121)
Returns: true if the list contains d, otherwise false.
Returns: the index of the first occurrence of d, searching forward from index. Returns -1 if d is not found.
Inserts value at pos. Later entries move one position.
Inserts value at the beginning of the list. (introduced with release 20260714)
Removes every occurrence of value.
Returns: the number of entries removed.
Removes the entry at pos. The list shrinks by one.
Returns: the number of doubles in the list.
Sets entry i to d. The first entry is 0. Has no effect if the list is shorter than i.
Swaps the values at pos1 and pos2.