11#include "../base/base_uses.f90"
30 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
93 INTERFACE cp_insert_at
166 res =
size(el1%split_desc) <
size(el2%split_desc)
167 if (
size(el1%split_desc) ==
size(el2%split_desc))
then
168 do i = 1,
size(el1%split_desc)
169 if (el1%split_desc(i) /= el2%split_desc(i))
then
170 res = el1%split_desc(i) < el2%split_desc(i)
192 IF (.NOT.
PRESENT(first_el))
THEN
194 IF (
PRESENT(rest)) sll => rest
197 sll%first_el =>first_el
199 IF (
PRESENT(rest)) sll%rest => rest
229 SUBROUTINE cp_sll_xc_deriv_dealloc_node(sll)
233 END SUBROUTINE cp_sll_xc_deriv_dealloc_node
266 INTEGER,
OPTIONAL :: iter
272 IF (.NOT.
ASSOCIATED(sll))
THEN
275 IF (
PRESENT(iter))
THEN
278 IF (
ASSOCIATED(res%rest))
THEN
281 cpabort(
"tried to go past end")
286 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
315 IF (
ASSOCIATED(iterator))
THEN
317 iterator => iterator%rest
338 INTEGER,
INTENT(in) :: index
342 IF (index == -1)
THEN
347 cpassert(
ASSOCIATED(pos))
367 INTEGER,
INTENT(in) :: index
371 IF (index == -1)
THEN
376 cpassert(
ASSOCIATED(pos))
398 IF (
ASSOCIATED(iterator))
THEN
400 if (
present(el_att)) el_att =>iterator%first_el
401 iterator => iterator%rest
448 IF (
ASSOCIATED(sll))
THEN
450 CALL cp_sll_xc_deriv_dealloc_node(node_to_rm)
452 cpabort(
"tried to remove first el of an empty list")
470 INTEGER,
INTENT(in) :: index
478 IF (index == -1)
THEN
483 cpassert(
ASSOCIATED(pos))
500 INTEGER,
INTENT(in)::index
507 IF (index == -1)
THEN
512 cpassert(
ASSOCIATED(pos))
533 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
534 next_node => actual_node%rest
535 CALL cp_sll_xc_deriv_dealloc_node(actual_node)
536 actual_node => next_node
562 res(i) %deriv=>iter%first_el
564 cpassert(ok .OR. i == len)
integer function, public cp_sll_xc_deriv_get_length(sll)
returns the length of the list
subroutine, public cp_sll_xc_deriv_insert_el_at(sll, el, index)
inserts the element at the given index
logical function, public cp_sll_xc_deriv_next(iterator, el_att)
returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next...
type(xc_derivative_type) function, pointer, public cp_sll_xc_deriv_get_el_at(sll, index)
returns the element at the given index
logical function cp_sll_deriv_less_q(el1, el2)
private compare function
subroutine, public cp_sll_xc_deriv_dealloc(sll)
deallocates the singly linked list starting at sll. Does not work if loops are present!
subroutine, public cp_sll_xc_deriv_rm_all_el(sll)
removes all the elements from the list
type(xc_derivative_p_type) function, dimension(:), pointer, public cp_sll_xc_deriv_to_array(sll)
returns a newly allocated array with the same contents as the linked list
type(xc_derivative_type) function, pointer, public cp_sll_xc_deriv_get_first_el(sll)
returns the first element stored in the list
subroutine, public cp_sll_xc_deriv_set_el_at(sll, index, value)
sets the element at the given index
subroutine, public cp_sll_xc_deriv_rm_el_at(sll, index)
removes the element at the given index
subroutine, public cp_sll_xc_deriv_insert_el(sll, el)
insert an element at the beginning of the list
type(cp_sll_xc_deriv_type) function, pointer, public cp_sll_xc_deriv_get_rest(sll, iter)
returns the rest of the list
subroutine, public cp_sll_xc_deriv_rm_first_el(sll)
remove the first element of the linked list
subroutine, public cp_sll_xc_deriv_create(sll, first_el, rest)
allocates and initializes a single linked list
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Provides types for the management of the xc-functionals and their derivatives.
pointer to a linked list (to make arrays of pointers)
represent a single linked list that stores pointers to the elements
represent a pointer to a derivative (to have arrays of derivatives)
represent a derivative of a functional