set_elem_sparse Subroutine

private subroutine set_elem_sparse(this, index, element)

Set an element to the sparsely stored 6-index integrals. This requires the hash table to be set up and CANNOT be done once htable%finalize_setup has been called @param[in] index contiguous index of the element (not the one in the sparse array) @param[in] element new value of the element

Type Bound



Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(inout) :: this
integer(kind=int64), intent(in) :: index
real(kind=dp), intent(in) :: element


Source Code

Source Code

    subroutine set_elem_sparse(this, index, element)
        class(sparse_lMat_t), intent(inout) :: this
        integer(int64), intent(in) :: index
        HElement_t(dp), intent(in) :: element

        integer(int64) :: pos
        character(*), parameter :: t_r = "set_elem_sparse"

        ! Add the new entry to the hashtable
        call this%htable%add_index(index, pos)
        ! And the entry to the values
        this%nonzero_vals%ptr(pos) = element
    end subroutine set_elem_sparse