tensor_rank Function

public pure function tensor_rank(A)

compute rank of tensor

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in), dimension(:):: A

Return Value integer


Contents

Source Code


Source Code

integer pure function tensor_rank(A)

    real(dp), dimension(:), intent(in) :: A

    tensor_rank = int(0.5_dp * (sqrt(8.0_dp * real(size(A), dp) + 1.0_dp) - 3.0_dp))

end function tensor_rank