On 9/7/12 2:37 PM, Marcus Brubaker wrote:
> So to be clear, the issue is that:
>
> data {
> matrix[4,5] A;
> matrix[4,5] B;
> }
>
> model {
> matrix[4,5] C;
> C <- A - B;
> }
Exactly.
> will parse fine but won't compile? Also, I assume this is specific to
> matrix/vector/array types because I'm sure C[i,j] <- 1.0 would work.
> The underlying issue being that the compiler doesn't know how to
> convert from, e.g., Eigen::Matrix<double> to Eigen::Matrix<var>.
>
> At any rate, I vote for fix 2. Fix 1 would create an annoying corner
> case for people to deal with if we made it illegal.
Right.
Even though it's probably not a good idea to do it,
making it illegal would presumably be very confusing.
> My only concern
> is the performance hit, but it should be basically free when it's not
> necessary.
Presumably the compiler would eliminate the no-op wrapper
converting a variable-based matrix to a variable-based matrix.
- Bob