11
2- canonicaldomain (d:: ProductDomain ) = ProductDomain (map (canonicaldomain,d. domains)... )
2+ nfactors (d:: ProductDomain ) = length (components (d))
3+ factors (d:: ProductDomain ) = components (d)
4+ factor (d:: ProductDomain ,k:: Integer ) = component (d,k)
5+
6+ canonicaldomain (d:: ProductDomain ) = ProductDomain (map (canonicaldomain,factors (d))... )
37
48
59# product domains are their own canonical domain
610for OP in (:fromcanonical ,:tocanonical )
711 @eval begin
8- $ OP (d:: ProductDomain , x:: Vec ) = Vec (map ($ OP,d . domains ,x)... )
9- $ OP (d:: ProductDomain , x:: Vec{2} ) = Vec ($ OP (first (d . domains) , first (x)), $ OP (last (d . domains ), last (x)))
12+ $ OP (d:: ProductDomain , x:: Vec ) = Vec (map ($ OP,factors (d) ,x)... )
13+ $ OP (d:: ProductDomain , x:: Vec{2} ) = Vec ($ OP (first (factors (d)) , first (x)), $ OP (last (factors (d) ), last (x)))
1014 end
1115end
1216
13- nfactors (d:: ProductDomain ) = length (d. domains)
14- factors (d:: ProductDomain ) = d. domains
15- factor (d:: ProductDomain ,k:: Integer ) = d. domains[k]
17+
1618
1719function pushappendpts! (ret, xx, pts)
1820 if isempty (pts)
@@ -26,23 +28,23 @@ function pushappendpts!(ret, xx, pts)
2628end
2729
2830function checkpoints (d:: ProductDomain )
29- pts = checkpoints .(d . domains )
30- ret= Vector {Vec{sum(dimension.(d.domains)) ,float(promote_type(eltype.(eltype.(d.domains ))...))}} (undef, 0 )
31+ pts = checkpoints .(factors (d) )
32+ ret= Vector {Vec{sum(dimension.(factors(d))) ,float(promote_type(eltype.(eltype.(factors(d) ))...))}} (undef, 0 )
3133
3234 pushappendpts! (ret,(),pts)
3335 ret
3436end
3537
3638function points (d:: ProductDomain ,n:: Tuple )
37- @assert length (d . domains ) == length (n)
38- pts= map (points,d . domains ,n)
39- ret= Vector {Vec{length(d.domains) ,mapreduce(eltype,promote_type,d.domains )}} (undef, 0 )
39+ @assert length (factors (d) ) == length (n)
40+ pts= map (points,factors (d) ,n)
41+ ret= Vector {Vec{length(factors(d)) ,mapreduce(eltype,promote_type,factors(d) )}} (undef, 0 )
4042 pushappendpts! (ret,Vec (x),pts)
4143 ret
4244end
4345
44- reverseorientation (d:: ProductDomain ) = ProductDomain (map (reverseorientation, d . domains ))
46+ reverseorientation (d:: ProductDomain ) = ProductDomain (map (reverseorientation, factors (d) ))
4547
4648domainscompatible (a:: ProductDomain ,b:: ProductDomain ) =
47- length (a . domains) == length (b . domains ) &&
48- all (map (domainscompatible,a . domains,b . domains ))
49+ length (factors (a)) == length (factors (b) ) &&
50+ all (map (domainscompatible,factors (a), factors (b) ))
0 commit comments