|
CP2K 2.4 (Revision 12889)
|
describes a generic linked list template. Linked list are supposed to always use pointers to the nodes for basically everything: a pointer to the node is a list, an element of the list, an iterator between the elment of the list. An empty list is represented by an unassociated pointer. More...
Classes | |
| interface | cp_create |
| interface | cp_dealloc |
| interface | cp_dealloc_node |
| interface | cp_set |
| interface | cp_get |
| interface | cp_next |
| interface | cp_get_first_el |
| interface | cp_get_rest |
| interface | cp_get_empty |
| interface | cp_get_length |
| interface | cp_get_element_at |
| interface | cp_set_element_at |
| interface | cp_insert |
| interface | cp_insert_at |
| interface | cp_remove_el |
| interface | cp_remove_first_el |
| interface | cp_remove_all |
| interface | cp_to_array |
| struct | cp_sll_val_type |
| represent a single linked list that stores pointers to the elements More... | |
| struct | cp_sll_val_p_type |
| pointer to a linked list (to make arrays of pointers) More... | |
Functions | |
| subroutine, public | cp_sll_val_create (sll, first_el, rest, error) |
| allocates and initializes a single linked list | |
| subroutine, public | cp_sll_val_dealloc (sll, error) |
| deallocates the singly linked list starting at sll. Does not work if loops are present! | |
| subroutine, public | cp_sll_val_dealloc_node (sll, error) |
| deallocates a node of a singly linked list (low level) | |
| subroutine, public | cp_sll_val_set (sll, first_el, rest, error) |
| sets tha various attributes of a single linked list It is an error to set the rest of an empty list without setting the first_el (change and make it simply a sll=>rest ?) | |
| subroutine, public | cp_sll_val_get (sll, first_el, rest, empty, length, error) |
| returns various attributes from the linked list | |
| TYPE(val_type), pointer, public | cp_sll_val_get_first_el (sll, error) |
| returns the first element stored in the list | |
| TYPE(cp_sll_val_type), pointer, public | cp_sll_val_get_rest (sll, iter, error) |
| returns the rest of the list | |
| LOGICAL, public | cp_sll_val_get_empty (sll, error) |
| INTEGER, public | cp_sll_val_get_length (sll, error) |
| returns the length of the list | |
| TYPE(val_type), pointer, public | cp_sll_val_get_el_at (sll, index, error) |
| returns the element at the given index | |
| subroutine, public | cp_sll_val_set_el_at (sll, index, value, error) |
| sets the element at the given index | |
| LOGICAL, public | cp_sll_val_next (iterator, el_att, error) |
| returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next element | |
| subroutine, public | cp_sll_val_insert_el (sll, el, error) |
| insert an element at the beginning of the list | |
| subroutine, public | cp_sll_val_rm_first_el (sll, error) |
| remove the first element of the linked list | |
| subroutine, public | cp_sll_val_insert_el_at (sll, el, index, error) |
| inserts the element at the given index | |
| subroutine, public | cp_sll_val_rm_el_at (sll, index, error) |
| removes the element at the given index | |
| subroutine, public | cp_sll_val_rm_all_el (sll, error) |
| removes all the elements from the list | |
| TYPE(val_p_type), dimension(:), pointer, public | cp_sll_val_to_array (sll, error) |
| returns a newly allocated array with the same contents as the linked list | |
| TYPE(cp_sll_val_type), pointer, public | cp_sll_val_from_array (array, error) |
| returns a linked list with the same contents as the given array | |
| subroutine, public | cp_sll_val_insert_ordered (sll, el, insert_equals, did_insert, pos, error) |
| insert an element mantaining the order | |
| subroutine, public | cp_sll_val_insert_ordered2 (sll, el, compare_function, insert_equals, did_insert, pos, error) |
| insert an element mantaining the order defined by a user given function | |
| LOGICAL | cp_sll_val_contains (sll, el, ordered, error) |
| returns true if the list contains the given element | |
| function | cp_sll_val_contains2 (sll, el, compare_function, ordered, error) |
| returns true if the list contains the given element | |
Variables | |
| LOGICAL, parameter, private | debug_this_module = .TRUE. |
| CHARACTER(len=*), parameter, private | moduleN = 'cp_linked_list_val' |
describes a generic linked list template. Linked list are supposed to always use pointers to the nodes for basically everything: a pointer to the node is a list, an element of the list, an iterator between the elment of the list. An empty list is represented by an unassociated pointer.
This is a template
**** DO NOT MODIFY THE .F FILES **** modify the .template and .instantition instead
| LOGICAL cp_linked_list_val::cp_sll_val_contains | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),pointer | el, | ||
| LOGICAL,intent(in),optional | ordered, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns true if the list contains the given element
| sll | the linked list you want to control |
| el | the element to control |
| ordered | if true assumes that the list is ordered in growing order. (defaults to false) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 1071 of file cp_linked_list_val.f90.
References cp_sll_val_next().
Here is the call graph for this function:| function cp_linked_list_val::cp_sll_val_contains2 | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),pointer | el, | ||
| compare_function | compare_function, | ||
| LOGICAL,intent(in),optional | ordered, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
returns true if the list contains the given element
| sll | the linked list you want to control |
| el | the element to control |
| compare_function | a function used to compare two elements, it should return a negative number if the first argument is less than the second, 0 if they are equal, otherwise a positive number |
| ordered | if true assumes that the list is ordered in growing order. (defaults to false) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 1126 of file cp_linked_list_val.f90.
| subroutine,public cp_linked_list_val::cp_sll_val_create | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),optional,pointer | first_el, | ||
| TYPE(cp_sll_val_type),optional,pointer | rest, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
allocates and initializes a single linked list
| sll | the single linked list to initialize |
| first_el | the first element of this list |
| rest | the following elements (if not given: empty) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 217 of file cp_linked_list_val.f90.
References CPPostcondition.
Referenced by compare_function::compare_function(), cp_sll_val_from_array(), cp_sll_val_insert_el(), cp_sll_val_insert_ordered(), cp_sll_val_set(), input_cp2k_restarts::dump_csvr_energy_info(), input_cp2k_restarts::meta_hills_val_set_ds(), input_cp2k_restarts::meta_hills_val_set_dt(), input_cp2k_restarts::meta_hills_val_set_ss(), input_cp2k_restarts::meta_hills_val_set_ww(), input_cp2k_restarts::section_coord_val_set(), input_cp2k_restarts::section_neb_coord_val_set(), input_cp2k_restarts::section_rng_val_set(), input_section_types::section_vals_copy(), input_parsing::section_vals_parse(), input_cp2k_restarts::section_velocity_val_set(), input_cp2k_restarts::update_dipoles_section(), and input_cp2k_restarts::update_quadrupoles_section().
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_dealloc | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
deallocates the singly linked list starting at sll. Does not work if loops are present!
| sll | the list to be deallocated |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 259 of file cp_linked_list_val.f90.
References cp_sll_val_rm_all_el().
Referenced by input_section_types::section_vals_release(), and input_section_types::section_vals_remove_values().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_dealloc_node | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
deallocates a node of a singly linked list (low level)
| sll | the node to be deallocated |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 280 of file cp_linked_list_val.f90.
References CPPostcondition.
Referenced by cp_sll_val_rm_all_el(), and cp_sll_val_rm_first_el().
Here is the caller graph for this function:| TYPE(cp_sll_val_type),pointer,public cp_linked_list_val::cp_sll_val_from_array | ( | TYPE(val_p_type),dimension(:),intent(in) | array, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns a linked list with the same contents as the given array
| array | the array you want to copy |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 873 of file cp_linked_list_val.f90.
References cp_sll_val_create().
Here is the call graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_get | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),optional,pointer | first_el, | ||
| TYPE(cp_sll_val_type),optional,pointer | rest, | ||
| LOGICAL,intent(out),optional | empty, | ||
| INTEGER,intent(out),optional | length, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns various attributes from the linked list
| sll | the single linked list to change |
| first_el | the first element of this list (can be unassociated) |
| rest | the rest of the list (can be unassociated) |
| length | the length of the list |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 348 of file cp_linked_list_val.f90.
References cp_sll_val_get_length().
Here is the call graph for this function:| TYPE(val_type),pointer,public cp_linked_list_val::cp_sll_val_get_el_at | ( | TYPE(cp_sll_val_type),pointer | sll, |
| INTEGER,intent(in) | index, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns the element at the given index
| sll | the list you get the element from |
| index | the position of the element (stating at 1) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 535 of file cp_linked_list_val.f90.
References cp_sll_val_get_rest().
Referenced by input_section_types::section_vals_val_get(), input_section_types::section_vals_val_set(), and input_section_types::section_vals_val_unset().
Here is the call graph for this function:
Here is the caller graph for this function:| LOGICAL,public cp_linked_list_val::cp_sll_val_get_empty | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
| sll | the single linked list to get the rest from |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 472 of file cp_linked_list_val.f90.
| TYPE(val_type),pointer,public cp_linked_list_val::cp_sll_val_get_first_el | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns the first element stored in the list
| sll | the single linked list to get the element from |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 386 of file cp_linked_list_val.f90.
| INTEGER,public cp_linked_list_val::cp_sll_val_get_length | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns the length of the list
| sll | the list you want to know the length of |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 498 of file cp_linked_list_val.f90.
Referenced by cp_sll_val_get(), cp_sll_val_to_array(), input_section_types::section_vals_val_get(), and input_section_types::section_vals_val_set().
Here is the caller graph for this function:| TYPE(cp_sll_val_type),pointer,public cp_linked_list_val::cp_sll_val_get_rest | ( | TYPE(cp_sll_val_type),pointer | sll, |
| INTEGER,optional | iter, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns the rest of the list
| sll | the single linked list to get the rest from |
| iter | how many times the call to rest should be iterated, defaults to 1; -1 means till end of the list. |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 419 of file cp_linked_list_val.f90.
Referenced by cp_sll_val_get_el_at(), cp_sll_val_insert_el_at(), cp_sll_val_rm_el_at(), cp_sll_val_set_el_at(), and input_section_types::section_vals_val_unset().
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_insert_el | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),pointer | el, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
insert an element at the beginning of the list
| sll | the single linked list point at the beginning of which you want to add the element |
| el | the element to add |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 652 of file cp_linked_list_val.f90.
References cp_sll_val_create().
Referenced by compare_function::compare_function(), cp_sll_val_insert_el_at(), and cp_sll_val_insert_ordered().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_insert_el_at | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),pointer | el, | ||
| INTEGER,intent(in) | index, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
inserts the element at the given index
| sll | the list you get the element from |
| index | the position of the element (stating at 1). If it is -1, it means at end |
| el | the new element |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 720 of file cp_linked_list_val.f90.
References cp_sll_val_get_rest(), and cp_sll_val_insert_el().
Referenced by input_section_types::section_vals_val_set().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_insert_ordered | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),pointer | el, | ||
| LOGICAL,intent(in),optional | insert_equals, | ||
| LOGICAL,intent(out),optional | did_insert, | ||
| TYPE(cp_sll_val_type),optional,pointer | pos, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
insert an element mantaining the order
| sll | the list you want to insert in |
| el | the element that you want to insert |
| insert_equals | if equal elements should be inserted (defaults to false) |
| did_insert | true if it did insert the element |
| pos | node where the element has been inserted (or of the same element that was already in the list) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 918 of file cp_linked_list_val.f90.
References cp_sll_val_create(), cp_sll_val_insert_el(), cp_sll_val_next(), CPAssert, CPInvariant, and error.
Here is the call graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_insert_ordered2 | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),pointer | el, | ||
| compare_function | compare_function, | ||
| LOGICAL,intent(in),optional | insert_equals, | ||
| LOGICAL,intent(out),optional | did_insert, | ||
| TYPE(cp_sll_val_type),optional,pointer | pos, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
insert an element mantaining the order defined by a user given function
| sll | the list you want to insert in |
| el | the element that you want to insert |
| compare_function | a function used to compare two elements, it should return a negative number if the first argument is less than the second, 0 if they are equal, otherwise a positive number |
| insert_equals | if equal elements should be inserted (defaults to false) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 989 of file cp_linked_list_val.f90.
References error.
| LOGICAL,public cp_linked_list_val::cp_sll_val_next | ( | TYPE(cp_sll_val_type),pointer | iterator, |
| TYPE(val_type),optional,pointer | el_att, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next element
| iterator | iterator that moves along the list |
| error | variable to control error logging, stopping,... see module cp_error_handling |
| el_att | the actual element (valid only if the function returns true) |
Definition at line 615 of file cp_linked_list_val.f90.
Referenced by compare_function::compare_function(), cp_sll_val_contains(), cp_sll_val_insert_ordered(), cp_sll_val_to_array(), force_fields_all::force_field_pack_charges(), md_vel_utils::initialize_cascade(), md_vel_utils::initialize_velocities(), external_potential_types::read_all_potential(), atoms_input::read_atoms_input(), atom_types::read_basis_set(), basis_set_types::read_geminal_basis_set(), external_potential_types::read_gth_potential(), atom_types::read_gth_potential(), basis_set_types::read_gto_basis_set(), atoms_input::read_shell_coord_input(), input_section_types::section_vals_release(), and input_section_types::section_vals_remove_values().
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_rm_all_el | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
removes all the elements from the list
| sll | the list that should be removed |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 804 of file cp_linked_list_val.f90.
References cp_sll_val_dealloc_node().
Referenced by cp_sll_val_dealloc().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_rm_el_at | ( | TYPE(cp_sll_val_type),pointer | sll, |
| INTEGER,intent(in) | index, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
removes the element at the given index
| sll | the list you get the element from |
| index | the position of the element (stating at 1) |
| el | the new element |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 762 of file cp_linked_list_val.f90.
References cp_sll_val_get_rest(), and cp_sll_val_rm_first_el().
Referenced by input_section_types::section_vals_val_unset().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_rm_first_el | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
remove the first element of the linked list
| sll | the list whose first element has to be removed |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 682 of file cp_linked_list_val.f90.
References cp_sll_val_dealloc_node().
Referenced by cp_sll_val_rm_el_at().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_set | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(val_type),optional,pointer | first_el, | ||
| TYPE(cp_sll_val_type),optional,pointer | rest, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
sets tha various attributes of a single linked list It is an error to set the rest of an empty list without setting the first_el (change and make it simply a sll=>rest ?)
| sll | the single linked list to change |
| first_el | the element to replace the first element of this list |
| rest | the rest of the list (can be unassociated) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 311 of file cp_linked_list_val.f90.
References cp_sll_val_create(), and CPAssert.
Here is the call graph for this function:| subroutine,public cp_linked_list_val::cp_sll_val_set_el_at | ( | TYPE(cp_sll_val_type),pointer | sll, |
| INTEGER,intent(in) | index, | ||
| TYPE(val_type),pointer | value, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
sets the element at the given index
| sll | the list you get the element from |
| index | the position of the element (stating at 1) -1 means at the end |
| value | the new element |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 577 of file cp_linked_list_val.f90.
References cp_sll_val_get_rest().
Referenced by input_section_types::section_vals_val_set().
Here is the call graph for this function:
Here is the caller graph for this function:| TYPE(val_p_type),dimension(:),pointer,public cp_linked_list_val::cp_sll_val_to_array | ( | TYPE(cp_sll_val_type),pointer | sll, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
returns a newly allocated array with the same contents as the linked list
| sll | the list to trasform in array |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 836 of file cp_linked_list_val.f90.
References cp_sll_val_get_length(), cp_sll_val_next(), CPAssert, and CPPostcondition.
Here is the call graph for this function:| LOGICAL,parameter,private cp_linked_list_val::debug_this_module = .TRUE. |
Definition at line 55 of file cp_linked_list_val.f90.
| CHARACTER(len=*),parameter,private cp_linked_list_val::moduleN = 'cp_linked_list_val' |
Definition at line 56 of file cp_linked_list_val.f90.
1.7.3