log10_array Module Function

module function log10_array(a) result(c)

Natural logarithm function for autodiff arrays

Arguments

Type IntentOptional Attributes Name
class(array_type), intent(in), target :: a

Return Value type(array_type), pointer


Source Code

  module function log10_array(a) result(c)
    !! Natural logarithm function for autodiff arrays
    implicit none
    class(array_type), intent(in), target :: a
    type(array_type), pointer :: c

    c => a%create_result()
    c%val = log10(a%val)

    c%get_partial_left => get_partial_log10
    c%get_partial_left_val => get_partial_log10_val
    if(a%requires_grad)then
       c%requires_grad = .true.
       c%is_forward = a%is_forward
       c%operation = 'log10'
       c%left_operand => a
       c%owns_left_operand = a%is_temporary
    end if
  end function log10_array