File: outerproduct.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (42 lines) | stat: -rw-r--r-- 1,413 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<HTML>
<HEAD>
<TITLE>OUTER PRODUCT</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">

<P><A NAME="outer product"></A>
<font size="+3" color="green"><B>OUTER PRODUCT</B></font></P>
<P>
<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%"><CODE>
vout = v1 &gt;&lt; v2</CODE>
</TD></TR>
</table></p>
<p>
 The outer product operator, <CODE>&gt;&lt;</CODE>, operates on two
 vectors and produces a matrix composed of all possible combinations of products of elements
 of the vectors.</p>
<p>
 If vector <CODE>X</CODE> has M elements and vector <CODE>Y</CODE> has N elements, then
 <CODE>X&gt;&lt;Y</CODE> is a matrix with M rows and N columns, where
 <code>(X&gt;&lt;Y)[i,j] = X[i]*Y[j]</code> for <code>i = 1,2,...,M</code> and
 <code>j = 1,2,...,N</code>.</P>
<P><font size="+1" color="green">Example:</font></p>
<p>
 Suppose you have two vectors <CODE>X = [1;3;5]</CODE> and <CODE>Y = [2;4]</CODE>, then</p>
<p>
 <pre>
        |  2  4 |
 X&gt;&lt;Y = |  6 12 |
        | 10 20 |
 </pre></p>
<P>
 <a href="../append/append.htm"><img border="0" src="../../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">append vectors or strings</font></a><br />
 <a href="../innerproduct/innerproduct.htm"><img border="0" src="../../shadow_right.gif">&nbsp;
 <font size="+1" color="olive">inner product</font></a>
</P>
</BODY>
</HTML>