In order to keep my matrices A
in sync with my vectors v
I want to create
var vdom: domain(1) = {1...10},
mdom: domain(2) = {odom, odom};
However, this gives me a compiler error.
In order to keep my matrices A
in sync with my vectors v
I want to create
var vdom: domain(1) = {1...10},
mdom: domain(2) = {odom, odom};
However, this gives me a compiler error.
Domains are initialized with ranges. So you need to build
mdom
fromvdom
's ranges, by calling thedim(i)
method:It is also a common pattern to define the problem space as a range, and then re-use that variable elsewhere: