next up previous contents
Next: Section 4: More reading Up: Array operations Previous: Matrix multiplication   Contents

# for Vectors

For A # B, where A and B are vectors, IDL performs A # TRANSPOSE(B). In this case, C = A # B is a matrix with Cij = Ai Bj. Mathematically, this is equivalent to the outer product, usually denoted by A Ä B.
(a, b, c, d) # (e, f, g) = (ae be ce de)
                           (af bf cf df) 
                           (ag bg cg dg)
4 elements # 3 elements = 4 columns 3 rows

For A ## B, where A and B are vectors, IDL performs TRANSPOSE(A) ## B. In this case, C = A ## B is a matrix with Cij = Bi Aj.

(a, b, c, d) ## (e, f, g) =(ae af ag)
                           (be bf bg) 
                           (ce cf cg)
                           (de df dg
4 elements ## 3 elements = 3 columns 4 rows

To compute the dot product, use TRANSPOSE(A) # B.

TRANSPOSE(a, b, c) # (e, f, g) = (ae +bf +cg)

We'll see more uses of # later.



John Marsham 2009-12-07