This module provides generic growing arrays of other (dynamic) arrays.
initialize the dynamic array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type), | intent(out) | :: | me | |||
integer, | intent(in), | optional | :: | length |
truncate the array, meaning cut off the trailing empty entries
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me |
empty the entries without changing arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me |
destroy the dynamic array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type), | intent(inout) | :: | me |
insert an element at a given position
adds the value to a given position inside the growing array.
if the requested position is outside the current array bounds, the array will be resized accordingly. if it is inside the current array bounds, the element at the requested position will be replaced.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
type(dyn_intarray_type), | intent(in) | :: | val | |||
integer, | intent(in) | :: | pos | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
adds the values starting from a given position inside the growing array.
if the requested position is outside the current array bounds, the array
will be resized accordingly. if it is inside the current array bounds, the
elements starting from the requested position will be replaced up to
the element at position pos + size(val) - 1
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
type(dyn_intarray_type), | intent(in) | :: | val(:) | |||
integer, | intent(in) | :: | pos | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
append a value to the dynamic array and return its position.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
type(dyn_intarray_type), | intent(in) | :: | val | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
type(dyn_intarray_type), | intent(in) | :: | val(:) | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
increase the size of the container for the array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
integer, | intent(in), | optional | :: | pos | ||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
initialize the dynamic array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type), | intent(out) | :: | me | |||
integer, | intent(in), | optional | :: | length |
truncate the array, meaning cut off the trailing empty entries
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me |
empty the entries without changing arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me |
destroy the dynamic array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type), | intent(inout) | :: | me |
insert an element at a given position
adds the value to a given position inside the growing array.
if the requested position is outside the current array bounds, the array will be resized accordingly. if it is inside the current array bounds, the element at the requested position will be replaced.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
type(dyn_longarray_type), | intent(in) | :: | val | |||
integer, | intent(in) | :: | pos | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
adds the values starting from a given position inside the growing array.
if the requested position is outside the current array bounds, the array
will be resized accordingly. if it is inside the current array bounds, the
elements starting from the requested position will be replaced up to
the element at position pos + size(val) - 1
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
type(dyn_longarray_type), | intent(in) | :: | val(:) | |||
integer, | intent(in) | :: | pos | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
append a value to the dynamic array and return its position.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
type(dyn_longarray_type), | intent(in) | :: | val | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
type(dyn_longarray_type), | intent(in) | :: | val(:) | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
increase the size of the container for the array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
integer, | intent(in), | optional | :: | pos | ||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
growing array type for type(dyn_intarray_type)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nvals | = | 0 | ||
integer, | public | :: | containersize | = | 0 | ||
type(dyn_intarray_type), | public, | allocatable | :: | val(:) |
growing array type for type(dyn_longarray_type)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nvals | = | 0 | ||
integer, | public | :: | containersize | = | 0 | ||
type(dyn_longarray_type), | public, | allocatable | :: | val(:) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type), | intent(out) | :: | me | |||
integer, | intent(in), | optional | :: | length |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type), | intent(inout) | :: | me |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me |
adds the value to a given position inside the growing array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
type(dyn_intarray_type), | intent(in) | :: | val | |||
integer, | intent(in) | :: | pos | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
adds the values starting from a given position inside the growing array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
type(dyn_intarray_type), | intent(in) | :: | val(:) | |||
integer, | intent(in) | :: | pos | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
type(dyn_intarray_type), | intent(in) | :: | val | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
type(dyn_intarray_type), | intent(in) | :: | val(:) | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynintarray_type) | :: | me | ||||
integer, | intent(in), | optional | :: | pos | ||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type), | intent(out) | :: | me | |||
integer, | intent(in), | optional | :: | length |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type), | intent(inout) | :: | me |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me |
adds the value to a given position inside the growing array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
type(dyn_longarray_type), | intent(in) | :: | val | |||
integer, | intent(in) | :: | pos | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
adds the values starting from a given position inside the growing array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
type(dyn_longarray_type), | intent(in) | :: | val(:) | |||
integer, | intent(in) | :: | pos | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
type(dyn_longarray_type), | intent(in) | :: | val | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
type(dyn_longarray_type), | intent(in) | :: | val(:) | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_dynlongarray_type) | :: | me | ||||
integer, | intent(in), | optional | :: | pos | ||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |