tan_array Function

private function tan_array(a) result(c)

Tangent function for autodiff arrays

Arguments

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

Return Value type(array_type), pointer


Source Code

  function tan_array(a) result(c)
    !! Tangent function for autodiff arrays
    implicit none
    class(array_type), intent(in), target :: a
    type(array_type), pointer :: c

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

    c%get_partial_left => get_partial_tan
    c%get_partial_left_val => get_partial_tan_val
    if(a%requires_grad) then
       c%requires_grad = .true.
       c%is_forward = a%is_forward
       c%operation = 'tan'
       c%left_operand => a
       c%owns_left_operand = a%is_temporary
    end if
  end function tan_array