February 24, 2005
Norbert Nemec wrote:
> Georg Wrede schrieb:
> 
>>...
> 1) use D just like C
> 2) start using arrays
> 3) start using array expressions (simple to understand, but neither fully flexible nor extendable)
> 4) start using vectorized expressions (more advanced, fully mixable with array expressions.
> 
> To illustrate the last point, it should be clear that array expressions
>     int[] a,b,c;
>     [...]
>     c = a+b;
> can always be replaced by their equivalent vectorized expressions
>     int[] a,b,c;
>     [...]
>     assert(a.length == b.length)
>     c = [i in 0..a.length](a[i]+b[i]);

Are these arrays or matricies?
How does one interpret:

   int[] a,b,c;
   [...]
   c = a*b;

What about:
   c = a/b;

Is there a dot-product as well as a cross-product?
(Here, I guess, I'm assuming that we're talking about matricies.)

Arrays are useful for bunches of things.  Matricies are useful for bunches of things.  They tend to be different bunches of things.  And except at the very lowest level the operations tend to be quite different.

Is there a reasonable way to handle BOTH?

February 24, 2005
Charles Hixson schrieb:
> Are these arrays or matricies?

Good question.

I know, in a numerics language, both should be present. However, they are mostly distinct concepts and should therefore be kept cleanly distinct.

So far, all my comments have revolved around arrays. Array operations are elementwise operations which are relatively easy to handle exhaustively in the language specs.

IMO, matrix semantics should better be encapsulated into a Matrix library. Of course, this class would probably be a wrapper around arrays. It might, though, also feature a selection of storage models that interact transparently.

The simple solution of offering two different kinds of multiplication for the same objects (Like Matlab does it) does not appeal to me too much. Basically, it is a matter of the object how it is multiplied. For an array, matrix multiplication does not make sense. In the same way, matrices are never multiplied elementwise.

It is hard to find clean arguments for this, but when I think about it, it just seems natural to me that way.
1 2 3 4
Next ›   Last »