OUTERPROD

Purpose:

Computes the outer product of two series.

Syntax:

OUTERPROD(a, b , "op")

 

a

-

A single column series.

b

-

A single column series.

"op"

-

A string, the binary outer product operator.

Returns:

An array with as many rows as length(a) and as many columns as length(b).

Example:

a  = {2, 3, 4};

b  = {1, 2, 3, 4};

c1 = outerprod(a, b, "*");

m1 = a *^ b';

 

c1 == {{2, 4,  6,  8},

       {3, 6,  9, 12},

       {4, 8, 12, 16}}

 

m1 == {{2, 4,  6,  8},

       {3, 6,  9, 12},

       {4, 8, 12, 16}}

 

The standard outer product is computed with "*" multiplication operator. In this case, the outer product is equivalent to a *^ b'

Example:

a  = {2, 3, 4};

b  = {1, 2, 3, 4};

c1 = outerprod(a, b, "*");

c2 = outerprod(a, b, "+");

c3 = outerprod(a, b, "^");

 

c1 == {{2,  4,  6,  8},

       {3,  6,  9, 12},

       {4,  8, 12, 16}}

 

c2 == {{3,  4,  5,  6},

       {4,  5,  6,  7},

       {5,  6,  7,  8}}

 

c3 == {{2,  4,  8,  16},

       {3,  9, 27,  81},

       {4, 16, 64, 256}}

 

c1 contains the standard outer product, c2 and c3 contain the generalized outer products of series a and b.

Remarks:

The returned array is computed by interposing the outer product operator between every possible pair from a and b.

 

If Qj represents the jth entry in b, then the jth column of the output array is equivalent to a OP Qj.

 

The standard outer produce of two series is computed with the "*" multiplication operator.

 

Binary operators include the arithmetic and logical operators. The "Exclusive OR" operator is represented by the string "XOR".

See Also:

*^ (Matrix Multiply)

\^ (Matrix Solve)

CROSSPROD

INNERPROD

INTERPOSE

MMULT

REDUCE

TRANSPOSE