comparison src/Grids/grid.jl @ 1403:efd992899896 feature/grids/scalar_eval_on

REVIEW: Add a review comment
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Aug 2023 15:39:05 +0200
parents 2d9eb2d07802
children 2ad518182b37
comparison
equal deleted inserted replaced
1402:2d9eb2d07802 1403:efd992899896
94 """ 94 """
95 eval_on(g::Grid, f::Number) 95 eval_on(g::Grid, f::Number)
96 96
97 Lazy evaluation of a scalar `f` on the grid. 97 Lazy evaluation of a scalar `f` on the grid.
98 98
99 For concrete array grid functions `map(f,g)` can be used instead. 99 For concrete array grid functions `map(f,g)` can be used instead. # REVIEW: The suggested code doesn't seem to work and I don't think it needs to. Probably enough to just delete the remark?
100 """ 100 """
101 eval_on(g::Grid, f::Number) = return LazyTensors.LazyConstantArray(f, size(g)) 101 eval_on(g::Grid, f::Number) = return LazyTensors.LazyConstantArray(f, size(g))
102 102
103 _ncomponents(::Type{<:Number}) = 1 103 _ncomponents(::Type{<:Number}) = 1
104 _ncomponents(T::Type{<:SVector}) = length(T) 104 _ncomponents(T::Type{<:SVector}) = length(T)