compute rank of tensor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | dimension(:) | :: | A |
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