Everyone (especially Andrew):
I'm now waiting for feedback on how to proceed on the syntax
for matrix/vector dimensions and constraints. There's a list
of options at the bottom of the message, though I'm open to
other suggestions.
Marcus is absolutely right that we want to make a choice now
that we won't have to change later.
On 8/7/12 8:34 PM, Marcus Brubaker wrote:
> This syntactic issue is precisely why I mentioned it now.
> If we're going to have to touch every model lets at least
> make sure that the syntax would allow this feature in the future.
That's exactly why I stopped mid-model-munging!
I'll wait until Andrew has a chance to weigh in at least.
> One option (call it option 5) would be do so something C++-like:
>
> matrix<3,4,real[0,1]> x;
...
I do like the explicitness -- you can pretty much figure
out what it does by looking at it.
A multidim vector of matrices (ie a std::vector of Eigen::Matrix) can be declared as
>
> matrix<3,4,real[0,1]> x[5];
...
That's where we're at now, but with matrix[3,4].
> The one down side of this is it implies a level of flexibility that seems unlikely to be used (e.g., replacing real with
> something else) but I suppose that's not the worst price to pay for clarity.
Agreed. It's also very clunky and I don't like the mixing
of the indices and type. Another possibility would be
matrix<real[0,1]>[3,4] x;
Then the unconstrained form would be:
matrix<real>[3,4] x;
and that could be simplified to be written just as:
matrix[3,4] x;
> Alternatively, a more palatable variation of your Option 3 might be:
>
> matrix<3,4>[0,1] x;
Right -- our messages crossed on that one.
Another option would be to have a different syntax, such as
bounded_matrix[0,1][3,4];
We need to decide so I can carry on refactoring the
models!. Let me renumber the standing proposals:
1. a. matrix<3,4,real[0,1]> x;
b. matrix<real[0,1]>[3,4] x;
2. a. matrix<3,4>[0,1] x;
b. matrix(3,4)[0,1] x;
c. matrix[3,4][0,1] x;
3. a. matrix_bounded[0,1]<3,4>;
b. matrix_bounded[0,1](3,4);
c. matrix_bounded[0,1][3,4];
Now that I finished the message, I'm leaning toward 1.b. myself
as a first choice, and 3c. as a second.
- Bob