Skip to main content

LinSpace

Returns a linearly spaced vector.

avec = linspace(a=1.0, b=10.0, N=11)

Interface

INTERFACE LinSpace
MODULE PURE FUNCTION Linspace(a, b, N) RESULT(Ans)
REAL(Real32 | Real64) , INTENT(IN) :: a
!! left end of 1D domain
REAL(Real32 | Real64) , INTENT(IN) :: b
!! right end of 1D domain
INTEGER(I4B), OPTIONAL, INTENT(IN) :: N
!! Number of points including a and b
REAL(Real32 | Real64) , ALLOCATABLE :: ans(:)
!! Number of nodes in mesh
END FUNCTION Linspace
END INTERFACE LinSpace