Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/lazy_array.jl @ 1129:2d231546c091 feature/grids
Merge with default
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 05 Oct 2022 22:00:44 +0200 |
parents | c78c9a95024a |
children | 6fd97b5ed3e5 |
comparison
equal
deleted
inserted
replaced
1128:dfbd62c7eb09 | 1129:2d231546c091 |
---|---|
91 Base.@propagate_inbounds *̃(a::T, b::AbstractArray{T,D}) where {T,D} = LazyElementwiseOperation{T,D,:*}(a,b) | 91 Base.@propagate_inbounds *̃(a::T, b::AbstractArray{T,D}) where {T,D} = LazyElementwiseOperation{T,D,:*}(a,b) |
92 Base.@propagate_inbounds /̃(a::T, b::AbstractArray{T,D}) where {T,D} = LazyElementwiseOperation{T,D,:/}(a,b) | 92 Base.@propagate_inbounds /̃(a::T, b::AbstractArray{T,D}) where {T,D} = LazyElementwiseOperation{T,D,:/}(a,b) |
93 | 93 |
94 | 94 |
95 | 95 |
96 # NOTE: Är det knas att vi har till exempel * istället för .* ?? | 96 # Overload +,-,*,/ for LazyArrays |
97 # Oklart om det ens går att lösa.. | 97 # Element wise operation for `*` and `/` are not overloaded for due to conflicts with the behavior |
98 # of regular `*` and `/` for AbstractArrays. Use tilde versions instead. | |
98 Base.@propagate_inbounds Base.:+(a::LazyArray{T,D}, b::LazyArray{T,D}) where {T,D} = a +̃ b | 99 Base.@propagate_inbounds Base.:+(a::LazyArray{T,D}, b::LazyArray{T,D}) where {T,D} = a +̃ b |
100 Base.@propagate_inbounds Base.:-(a::LazyArray{T,D}, b::LazyArray{T,D}) where {T,D} = a -̃ b | |
101 | |
99 Base.@propagate_inbounds Base.:+(a::LazyArray{T,D}, b::AbstractArray{T,D}) where {T,D} = a +̃ b | 102 Base.@propagate_inbounds Base.:+(a::LazyArray{T,D}, b::AbstractArray{T,D}) where {T,D} = a +̃ b |
103 Base.@propagate_inbounds Base.:-(a::LazyArray{T,D}, b::AbstractArray{T,D}) where {T,D} = a -̃ b | |
104 | |
100 Base.@propagate_inbounds Base.:+(a::AbstractArray{T,D}, b::LazyArray{T,D}) where {T,D} = a +̃ b | 105 Base.@propagate_inbounds Base.:+(a::AbstractArray{T,D}, b::LazyArray{T,D}) where {T,D} = a +̃ b |
101 | |
102 Base.@propagate_inbounds Base.:-(a::LazyArray{T,D}, b::LazyArray{T,D}) where {T,D} = a -̃ b | |
103 Base.@propagate_inbounds Base.:-(a::LazyArray{T,D}, b::AbstractArray{T,D}) where {T,D} = a -̃ b | |
104 Base.@propagate_inbounds Base.:-(a::AbstractArray{T,D}, b::LazyArray{T,D}) where {T,D} = a -̃ b | 106 Base.@propagate_inbounds Base.:-(a::AbstractArray{T,D}, b::LazyArray{T,D}) where {T,D} = a -̃ b |
105 | 107 |
106 # Element wise operation for `*` and `\` are not overloaded due to conflicts with the behavior | 108 Base.@propagate_inbounds Base.:+(a::LazyArray{T,D}, b::T) where {T,D} = a +̃ b |
107 # of regular `*` and `/` for AbstractArrays. Use tilde versions instead. | 109 Base.@propagate_inbounds Base.:-(a::LazyArray{T,D}, b::T) where {T,D} = a -̃ b |
110 | |
111 Base.@propagate_inbounds Base.:+(a::T, b::LazyArray{T,D}) where {T,D} = a +̃ b | |
112 Base.@propagate_inbounds Base.:-(a::T, b::LazyArray{T,D}) where {T,D} = a -̃ b | |
108 | 113 |
109 export +̃, -̃, *̃, /̃ | 114 export +̃, -̃, *̃, /̃ |