bobjervis / parasol

The Parasol Language and related core development tools
Apache License 2.0
2 stars 2 forks source link

Implement vectorization for operators #3

Open bobjervis opened 9 years ago

bobjervis commented 9 years ago

Allow all relevant scalar operators to extend to vector operands yielding vector results.

For example:

int[] a, b, c;

a = b + c;

This should do an element-by-element equivalent:

a[i] = b[i] + c[i]; // for all i in the arrays.

The b and c arrays must be conformant. Since the only supported arrays are single-dimensional this means effectively that b and c must have the same length.

bobjervis commented 9 years ago

The issue of shape conformance is a non-trivial one. As long as elements can be put into correspondence between shaped collections, then there could be rules to auto re-shape vectors that are not the exact same length. IN effect, by allowing scalar values to confront vectors around operators, the conversion from scalar to vector is a form on conformance.