FMUTIL
0.1
Fortran Miscellaneous UTILities
|
Vector type. More...
Public Member Functions | |
procedure | assignvector |
generic, public | assignment => assignvector |
Assignment operator for the Vector type, this enables copying of RHS vector contents to LHS vector. Note that after this operation, LHS Vector will be an exact copy of the RHS vector including data and internal state. More... | |
procedure | create_newbkts |
procedure | index2bkt |
procedure, public | init => initialize |
Initialize the vector with different options and allocates memory. More... | |
procedure, public | size => vec_size |
Returns size of the vector or number of elements stored. More... | |
procedure, public | capacity |
Returns the current capacity of the vector. More... | |
procedure, public | nusedbkts |
Returns number of non-empty internal buckets. More... | |
procedure, public | reserve |
Reserve the requested storage minimum capacity by allocating new buckets if needed. More... | |
procedure, public | shrinktofit |
Shrink the capacity by deallocating unused buckets if needed. It tries to make Capacity as close to Size as possible. More... | |
procedure, public | pushback => push_back |
Push one element at the back of the vector. More... | |
procedure, public | popback => pop_back |
Pop one element from the back of the vector. More... | |
procedure, public | elemat => elem_at |
Returns a pointer to the element with the given index (1-based) More... | |
procedure, public | front => elem_front |
Returns the element with the index-1. More... | |
procedure, public | back => elem_back |
Returns the element with the last index. More... | |
procedure, public | slice => vec_slice |
Returns an array containing vector elements within the requested lower and upper bounds. This is inefficient as it copies the requested contents in a new array and returns it. More... | |
procedure, public | bktslice => bkt_slice |
Returns the pointer to the element array starting from the user-specified lower bound. If the upper bound is beyond the extent of the current data bucket, then the array is truncated at the the current bucket boundary. This is an efficient method as no copying of data is performed. More... | |
procedure, public | insert => elem_insert |
Inserts the element/elements at the given index and relocate elements at the later indices. More... | |
procedure, public | erase => elem_erase |
Delete the element/elements at the given index and relocate the elements at the later indices. More... | |
procedure, public | clear |
Clear the contents of the Vector but memory is not deallocated. More... | |
final | destroy |
Frees up all the memory allocated. More... | |
Public Attributes | |
integer, public | status = 0 |
Status: 0-success, any negative value-exception condition. More... | |
logical | storageallocated = .FALSE. |
Flag to indicate Vector storage has been allocated. More... | |
integer | newbktstoallocate = DEFAULT_NEWBKTSALLOCATED |
Number of new buckets to create on Vector capacity increase. More... | |
integer | bktcap = DEFAULT_BKTCAP |
Each bucket capacity. More... | |
integer | usedbkts = 0 |
Number of buckets that currently contain data. More... | |
integer | allocatedbkts = 0 |
Number of buckets that are currently allocated. More... | |
class(vecelem), allocatable | moldelem |
Mold element to be used for memory allocation. More... | |
type(bktptr), dimension(:), allocatable | vecdata |
Array of bucket pointers. More... | |
Vector type.
Definition at line 111 of file vector.f90.
generic, public vectors::vector::assignment |
Assignment operator for the Vector type, this enables copying of RHS vector contents to LHS vector. Note that after this operation, LHS Vector will be an exact copy of the RHS vector including data and internal state.
Definition at line 149 of file vector.f90.
References vectors::assignvector().
procedure vectors::vector::assignvector |
Definition at line 143 of file vector.f90.
procedure, public vectors::vector::back |
Returns the element with the last index.
Definition at line 188 of file vector.f90.
procedure, public vectors::vector::bktslice |
Returns the pointer to the element array starting from the user-specified lower bound. If the upper bound is beyond the extent of the current data bucket, then the array is truncated at the the current bucket boundary. This is an efficient method as no copying of data is performed.
Definition at line 200 of file vector.f90.
procedure, public vectors::vector::capacity |
Returns the current capacity of the vector.
Definition at line 162 of file vector.f90.
procedure, public vectors::vector::clear |
Clear the contents of the Vector but memory is not deallocated.
Definition at line 211 of file vector.f90.
procedure vectors::vector::create_newbkts |
Definition at line 152 of file vector.f90.
|
final |
Frees up all the memory allocated.
Definition at line 214 of file vector.f90.
References vectors::destroy().
procedure, public vectors::vector::elemat |
Returns a pointer to the element with the given index (1-based)
Definition at line 182 of file vector.f90.
procedure, public vectors::vector::erase |
Delete the element/elements at the given index and relocate the elements at the later indices.
Definition at line 208 of file vector.f90.
procedure, public vectors::vector::front |
Returns the element with the index-1.
Definition at line 185 of file vector.f90.
procedure vectors::vector::index2bkt |
Definition at line 153 of file vector.f90.
procedure, public vectors::vector::init |
Initialize the vector with different options and allocates memory.
Definition at line 156 of file vector.f90.
procedure, public vectors::vector::insert |
Inserts the element/elements at the given index and relocate elements at the later indices.
Definition at line 204 of file vector.f90.
procedure, public vectors::vector::nusedbkts |
Returns number of non-empty internal buckets.
Definition at line 165 of file vector.f90.
procedure, public vectors::vector::popback |
Pop one element from the back of the vector.
Definition at line 179 of file vector.f90.
procedure, public vectors::vector::pushback |
Push one element at the back of the vector.
Definition at line 176 of file vector.f90.
procedure, public vectors::vector::reserve |
Reserve the requested storage minimum capacity by allocating new buckets if needed.
Definition at line 169 of file vector.f90.
procedure, public vectors::vector::shrinktofit |
Shrink the capacity by deallocating unused buckets if needed. It tries to make Capacity as close to Size as possible.
Definition at line 173 of file vector.f90.
procedure, public vectors::vector::size |
Returns size of the vector or number of elements stored.
Definition at line 159 of file vector.f90.
procedure, public vectors::vector::slice |
Returns an array containing vector elements within the requested lower and upper bounds. This is inefficient as it copies the requested contents in a new array and returns it.
Definition at line 193 of file vector.f90.
integer vectors::vector::allocatedbkts = 0 |
Number of buckets that are currently allocated.
Definition at line 131 of file vector.f90.
integer vectors::vector::bktcap = DEFAULT_BKTCAP |
Each bucket capacity.
Definition at line 125 of file vector.f90.
class(vecelem), allocatable vectors::vector::moldelem |
Mold element to be used for memory allocation.
Definition at line 134 of file vector.f90.
integer vectors::vector::newbktstoallocate = DEFAULT_NEWBKTSALLOCATED |
Number of new buckets to create on Vector capacity increase.
Definition at line 122 of file vector.f90.
integer, public vectors::vector::status = 0 |
Status: 0-success, any negative value-exception condition.
Definition at line 116 of file vector.f90.
logical vectors::vector::storageallocated = .FALSE. |
Flag to indicate Vector storage has been allocated.
Definition at line 119 of file vector.f90.
integer vectors::vector::usedbkts = 0 |
Number of buckets that currently contain data.
Definition at line 128 of file vector.f90.
type(bktptr), dimension(:), allocatable vectors::vector::vecdata |
Array of bucket pointers.
Definition at line 137 of file vector.f90.