Put a value into the cache.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(function_cache), | intent(inout) | :: | me | |||
| integer(kind=ip), | intent(in) | :: | i |
index in the hash table |
||
| integer(kind=ip), | intent(in), | dimension(:) | :: | x |
independant variable vector |
|
| integer(kind=ip), | intent(in), | dimension(:) | :: | f |
function |
subroutine put_in_cache(me,i,x,f) implicit none class(function_cache),intent(inout) :: me integer(ip),intent(in) :: i !! index in the hash table integer(ip),dimension(:),intent(in) :: x !! independant variable vector integer(ip),dimension(:),intent(in) :: f !! function integer(ip),parameter :: null = huge(1) !! an unusual value to initialize arrays if (allocated(me%c)) then if (i<=size(me%c)) then ! add to the cache me%c(i)%x = x me%c(i)%f = f else error stop 'Error: invalid index in hash table.' end if else error stop 'Error: the cache has not been initialized.' end if end subroutine put_in_cache