⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m2_op_transpose.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 31mar2005}{...}
{cmd:help m2 op_transpose}
{hline}
{* index operators}{...}
{* index transposition}{...}
{* index transpose}{...}
{* index conjugate transpose}{...}
{* index adjoint matrix}{...}
{* index adjugate matrix}{...}
{* index Hermitian adjoin}{...}
{* index Hermitian transpose}{...}

{title:Title}

{p 4 4 2}
{hi:[M-2] op_transpose -- Conjugate transpose operator}


{title:Syntax}

	{it:A}{cmd:'}


{title:Description}

{p 4 4 2}
{it:A}{cmd:'} returns the transpose of {it:A} or, if {it:A} is complex, 
the conjugate transpose.


{title:Remarks}

{p 4 4 2}
The {cmd:'} postfix operator may be used on any type of matrix 
or vector:  real, complex, string, or pointer:

	: {cmd:a}
	{res}       {txt}1   2   3
	    {c TLC}{hline 13}{c TRC}
	  1 {c |}  {res}1   2   3{txt}  {c |}
	  2 {c |}  {res}4   5   6{txt}  {c |}
	    {c BLC}{hline 13}{c BRC}

	: {cmd:a'}
	{res}       {txt}1   2
	    {c TLC}{hline 9}{c TRC}
	  1 {c |}  {res}1   4{txt}  {c |}
	  2 {c |}  {res}2   5{txt}  {c |}
	  3 {c |}  {res}3   6{txt}  {c |}
	    {c BLC}{hline 9}{c BRC}


	: {cmd:s}
	{res}       {txt}    1       2
	    {c TLC}{hline 17}{c TRC}
	  1 {c |}  {res}alpha    beta{txt}  {c |}
	    {c BLC}{hline 17}{c BRC}

	: {cmd:s'}
	{res}       {txt}    1
	    {c TLC}{hline 9}{c TRC}
	  1 {c |}  {res}alpha{txt}  {c |}
	  2 {c |}  {res} beta{txt}  {c |}
	    {c BLC}{hline 9}{c BRC}


	: {cmd:p}
	{res}       {txt}        1
	    {c TLC}{hline 13}{c TRC}
	  1 {c |}  {res}0x84104b0{txt}  {c |}
	  2 {c |}  {res}0x840fe20{txt}  {c |}
	    {c BLC}{hline 13}{c BRC}

	: {cmd:p'}
	{res}       {txt}        1           2
	    {c TLC}{hline 25}{c TRC}
	  1 {c |}  {res}0x84104b0   0x840fe20{txt}  {c |}
	    {c BLC}{hline 25}{c BRC}


	: {cmd:z}
	{res}       {txt}     1        2
	    {c TLC}{hline 19}{c TRC}
	  1 {c |}  {res}1 + 2i   3 + 4i{txt}  {c |}
	  2 {c |}  {res}5 + 6i   7 + 8i{txt}  {c |}
	    {c BLC}{hline 19}{c BRC}

	: {cmd:z'}
	{res}       {txt}     1        2
	    {c TLC}{hline 19}{c TRC}
	  1 {c |}  {res}1 - 2i   5 - 6i{txt}  {c |}
	  2 {c |}  {res}3 - 4i   7 - 8i{txt}  {c |}
	    {c BLC}{hline 19}{c BRC}

{p 4 4 2}
Note that when {cmd:'} is applied to a complex, returned is the 
conjugate transpose.  If you do not want this, code 
{cmd:conj(}{it:z}{cmd:')} or 
{cmd:conj(}{it:z}{cmd:)'} -- it makes no difference; see 
{bf:{help mf_conj:[M-5] conj()}}, 

	: {cmd:conj(z')}
	{res}       {txt}     1        2
	    {c TLC}{hline 19}{c TRC}
	  1 {c |}  {res}1 + 2i   5 + 6i{txt}  {c |}
	  2 {c |}  {res}3 + 4i   7 + 8i{txt}  {c |}
	    {c BLC}{hline 19}{c BRC}

{p 4 4 2}
Or use the 
{bf:{help mf_transposeonly:[M-5] transposeonly()}} function:

	: {cmd:transposeonly(z)}
	{res}       {txt}     1        2
	    {c TLC}{hline 19}{c TRC}
	  1 {c |}  {res}1 + 2i   5 + 6i{txt}  {c |}
	  2 {c |}  {res}3 + 4i   7 + 8i{txt}  {c |}
	    {c BLC}{hline 19}{c BRC}

{p 4 4 2}
{cmd:transposeonly()} executes slightly faster than {cmd:conj(}{it:z}{cmd:')}.

{p 4 4 2}
For real and complex {it:A}, also see
{bf:{help mf__transpose:[M-5] _transpose()}}, which provides a way to 
transpose a matrix in place and so saves memory.


{title:Conformability}

	{it:A}{cmd:'}:
		{it:A}:  {it:r x c}
	   {it:result}:  {it:c x r}


{title:Diagnostics}

{p 4 4 2}
The transpose operator cannot fail, but it is easy to use it incorrectly
when working with complex quantities.

{p 4 4 2}
A user wanted to form {it:A}{cmd:*}{it:x} but when he tried, got a
conformability error.  He thought {it:x} was a column vector, but it turned
out to be a row vector, or perhaps it was the other way around.  Anyway, he
then coded {it:A}{cmd:*}{it:x}{cmd:'}, and the program worked and, even
better, produced the correct answers.  In his test, {it:x} was real.

{p 4 4 2}
Later, the user ran the program with complex {it:x}, and the program generated
incorrect results, although it took him a while to notice.  Study and
study his code he did, before he thought about the innocuous
{it:A}{cmd:*}{it:x}{cmd:'}.  The transpose operator had not only changed
{it:x} from being a row into being a column, but it had taken the conjugate of
each of the elements of {it:x}!  He changed the code to read
{it:A}{cmd:*}{cmd:transposeonly(}{it:x}{cmd:)}.

{p 4 4 2}
The user no doubt wondered why the {cmd:'} transpose operator was not 
defined at the outset to be equivalent to {cmd:transposeonly()}. 
If it had been, then rather than telling the story of the man
who was bitten by conjugate transpose when he only wanted the transpose, 
we would have told the story of the woman who was bitten by the transpose when
she needed the conjugate transpose.  There are, in fact, more of the latter
stories than there are of the former.


{title:Also see}

{p 4 13 2}
Manual:  {hi:[M-2] op_transpose}

{p 4 13 2}
Online:  help for 
{bf:{help mf_conj:[M-5] conj()}}, 
{bf:{help mf_transposeonly:[M-5] transposeonly()}}, 
{bf:{help mf__transpose:[M-5] _transpose()}}, 
{bf:{help m2_exp:[M-2] exp}};
{bf:{help m2_intro:[M-2] intro}}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -