Vectorize Errors in Nested Arrays in SS 7251 - Сообщения
Vectorize Errors in Nested Arrays.sm (45 КиБ) скачан 45 раз(а).
WroteObserved errors with nested arrays as shown in SS 7251.
There is no error, as well SS 6179.
Smath native vectorize is superior to MCD, then more instructions.
Cheers ... Jean
Vectorize Errors in Nested Arrays Doctored.sm (9 КиБ) скачан 35 раз(а).
Thank you Jean.
WroteObserved errors with nested arrays as shown in SS 7251.
I think the observed behaviour matches the following hypothesis on how vectorize() operates:
- search for array-valued operators in the expression (before executing any part of the vectorized expression). in your case it is Z.
- Determine length of these operators. In your case length(Z)=4.
- If all non-scalar operators share the same length, then generate a loop for index = 1..length. Otherwise complain about length mismatch. In your case this iterates over the four sub-matrices.
- within the loop, apply the original expression, with the non-scalar expression replaced by the indexed one. In your case extraction of first element and subsequent rounding is applied to each of the four subvectors.
- return a vector with the stacked results of each iteration.
In the second case, the error results from failing to extract element number four from the last two vectors (having less than 4 elements).
The hypothesis doesn't, however, explain the last error "Result is above...".
For this case short answer will be that we have to use both/all indexes for the nested arrays.
As Martin explained, we have to be careful about how the things are going on with vectorize operator.
Regarding the famous uninformative "Results is above max. allowed positive number." here is another example whit this error.
Regards,
Radovan
WroteHello,
For this case short answer will be that we have to use both/all indexes for the nested arrays.
As Martin explained, we have to be careful about how the things are going on with vectorize operator.
Radovan, unfortunately your example isn't consistent with my hypothesis

Single and double index el(Z,1) and el(Z,1,1) both return exactly the same result (first submatrix) if applied on the canvas.
So there is no hint why to expect different results when applying vectorize().
Can the developers please shed some light on this?
WroteMay be I have not properly understood the vectorize operator.
Thank you Jean.
Thank you as well NDTMA, very educative example.
You can have more otherwise ... Ah !
Cheers ... Jean
Vectorize Nest_Sub.sm (18 КиБ) скачан 38 раз(а).
WroteCan the developers please shed some light on this?
If you have red or not as demanded, IMHO: the bug is SS 7251.
Revisit the last attached Vectorize Nest_Sub.sm
WroteOriginally Posted by: Jean Giraud [url=/forum/yaf_postsm60333_Vectorize-Errors-in-Nested-Arrays-in-SS-7251.aspx#post60333][/url]If you have red or not as demanded, IMHO: the bug is SS 7251.
Revisit the last attached Vectorize Nest_Sub.sm
Thank you Jean. No errors in 7251.
Also many thanks to Martin and Omorr for your comments.
WroteThank you Jean. No errors in 7251
Hello Collab from so far away,
maybe, that's what you were after ?
Cheers ... Jean
Vectorize Nest_Sub.sm (23 КиБ) скачан 33 раз(а).
WroteHello Collab from so far away,
maybe, that's what you were after ?
Cheers ... Jean
Yes. I also did it using a traditional loop method.
But yours is more elegant.
Thanks.
-
Новые сообщения
-
Нет новых сообщений