Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Finding the vertices of a hypercube

$
0
0

I defined a data structure to represent a hypercube. It is defined by the min and max bounds on each dimension.

struct HyperCube 
    min_bounds::Array{Float32}
    max_bounds::Array{Float32}
end

Now, I want to define a function that returns all the vertices.
In Python, I would have done:
return list(product(*zip(self.min_bounds, self.max_bounds)))

I am wondering what would be the most elegant way to do this in Julia.

6 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles