/[escript]/trunk/doc/user/escript.tex
ViewVC logotype

Diff of /trunk/doc/user/escript.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3292 by caltinay, Thu Oct 21 00:37:42 2010 UTC revision 3293 by caltinay, Thu Oct 21 23:18:32 2010 UTC
# Line 11  Line 11 
11  %  %
12  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13    
14  \chapter{The Module \escript}\label{ESCRIPT CHAP}  \chapter{The \escript Module}\label{ESCRIPT CHAP}
15    
16  \section{Concepts}  \section{Concepts}
17  \escript is a \PYTHON module that allows you to represent the values of  \escript is a \PYTHON module that allows you to represent the values of
# Line 586  for the solution approximation. Line 586  for the solution approximation.
586    
587  The following table shows arithmetic operations that can be performed point-wise on  The following table shows arithmetic operations that can be performed point-wise on
588  \Data objects.  \Data objects.
589  \begin{tableii}{l|l}{textrm}{expression}{Description}  \begin{table}
590  \lineii{+\var{arg0}} {identical to \var{arg} \index{+}}      \centering
591  \lineii{-\var{arg0}} {negation\index{-}}      \begin{tabular}{l|l}
592  \lineii{\var{arg0}+\var{arg1}} {adds \var{arg0} and \var{arg1} \index{+}}          \bfseries expression & Description\\
593  \lineii{\var{arg0}*\var{arg1}} {multiplies \var{arg0} and \var{arg1} \index{*}}          \hline
594  \lineii{\var{arg0}-\var{arg1}} {difference \var{arg1} from\var{arg1} \index{-}}          +\var{arg0} & identical to \var{arg} \index{+}\\
595  \lineii{\var{arg0}/\var{arg1}} {divide \var{arg0} by \var{arg1} \index{/}}          -\var{arg0} & negation\index{-}\\
596  \lineii{\var{arg0}**\var{arg1}} {raises \var{arg0} to the power of \var{arg1} \index{**}}          \var{arg0}+\var{arg1} & adds \var{arg0} and \var{arg1} \index{+}\\
597  \end{tableii}          \var{arg0}*\var{arg1} & multiplies \var{arg0} and \var{arg1} \index{*}\\
598            \var{arg0}-\var{arg1} & difference \var{arg1} from\var{arg1} \index{-}\\
599            \var{arg0}/\var{arg1} & divide \var{arg0} by \var{arg1} \index{/}\\
600            \var{arg0}**\var{arg1} & raises \var{arg0} to the power of \var{arg1} \index{**}\\
601        \end{tabular}
602    \end{table}
603  At least one of the arguments \var{arg0} or \var{arg1} must be a  At least one of the arguments \var{arg0} or \var{arg1} must be a
604  \Data object.  \Data object.
605  Either of the arguments may be a \Data object, a python number or a \numpy object.  Either of the arguments may be a \Data object, a python number or a \numpy object.
# Line 610  the \DataSamplePoints as \var{arg0} or \ Line 615  the \DataSamplePoints as \var{arg0} or \
615    
616  The following table shows the update operations that can be applied to  The following table shows the update operations that can be applied to
617  \Data objects:  \Data objects:
618  \begin{tableii}{l|l}{textrm}{expression}{Description}  \begin{table}
619  \lineii{\var{arg0}+=\var{arg2}} {adds \var{arg0} to \var{arg2} \index{+}}      \centering
620  \lineii{\var{arg0}*=\var{arg2}} {multiplies \var{arg0} with \var{arg2} \index{*}}      \begin{tabular}{l|l}
621  \lineii{\var{arg0}-=\var{arg2}} {subtracts \var{arg2} from\var{arg2} \index{-}}          \bfseries Expression & Description\\
622  \lineii{\var{arg0}/=\var{arg2}} {divides \var{arg0} by \var{arg2} \index{/}}          \hline
623  \lineii{\var{arg0}**=\var{arg2}} {raises \var{arg0} by \var{arg2} \index{**}}          \var{arg0}+=\var{arg2} & adds \var{arg0} to \var{arg2}\index{+}\\
624  \end{tableii}          \var{arg0}*=\var{arg2} & multiplies \var{arg0} with \var{arg2}\index{*}\\
625            \var{arg0}-=\var{arg2} & subtracts \var{arg2} from\var{arg2}\index{-}\\
626            \var{arg0}/=\var{arg2} & divides \var{arg0} by \var{arg2}\index{/}\\
627            \var{arg0}**=\var{arg2} & raises \var{arg0} by \var{arg2}\index{**}\\
628        \end{tabular}
629    \end{table}
630  \var{arg0} must be a \Data object. \var{arg1} must be a  \var{arg0} must be a \Data object. \var{arg1} must be a
631  \Data object or an object that can be converted into a  \Data object or an object that can be converted into a
632  \Data object. \var{arg1} must have the same \Shape as  \Data object. \var{arg1} must have the same \Shape as
# Line 629  components. \var{arg1} must be defined i Line 639  components. \var{arg1} must be defined i
639  The \Data class supports taking slices from a \Data object as well as assigning new values to a slice of an existing  The \Data class supports taking slices from a \Data object as well as assigning new values to a slice of an existing
640  \Data object. \index{slicing}  \Data object. \index{slicing}
641  The following expressions for taking and setting slices are valid:  The following expressions for taking and setting slices are valid:
642  \begin{tableiii}{l|ll}{textrm}{rank of \var{arg}}{slicing expression}{\Shape of returned and assigned object}  \begin{table}
643  \lineiii{0}{ no slicing }                      {-}      \centering
644  \lineiii{1}{\var{arg[l0:u0]}}                   {(\var{u0}-\var{l0},)}      \begin{tabular}{l|ll}
645  \lineiii{2}{\var{arg[l0:u0,l1:u1]}}             {(\var{u0}-\var{l0},\var{u1}-\var{l1})}          \bfseries rank of \var{arg} & slicing expression & \Shape of returned and assigned object\\
646  \lineiii{3}{\var{arg[l0:u0,l1:u1,l2:u2]} }      {(\var{u0}-\var{l0},\var{u1}-\var{l1},\var{u2}-\var{l2})}          \hline
647  \lineiii{4}{\var{arg[l0:u0,l1:u1,l2:u2,l3:u3]}} {(\var{u0}-\var{l0},\var{u1}-\var{l1},\var{u2}-\var{l2},\var{u3}-\var{l3})}          0 & no slicing & -\\
648  \end{tableiii}          1 & \var{arg[l0:u0]} & (\var{u0}-\var{l0},)\\
649            2 & \var{arg[l0:u0,l1:u1]} & (\var{u0}-\var{l0},\var{u1}-\var{l1})\\
650            3 & \var{arg[l0:u0,l1:u1,l2:u2]} & (\var{u0}-\var{l0},\var{u1}-\var{l1},\var{u2}-\var{l2})\\
651            4 & \var{arg[l0:u0,l1:u1,l2:u2,l3:u3]} & (\var{u0}-\var{l0},\var{u1}-\var{l1},\var{u2}-\var{l2},\var{u3}-\var{l3})\\
652        \end{tabular}
653    \end{table}
654  where \var{s} is the \Shape of \var{arg} and  where \var{s} is the \Shape of \var{arg} and
655  \[0 \le \var{l0} \le \var{u0} \le \var{s[0]},\]  \[0 \le \var{l0} \le \var{u0} \le \var{s[0]},\]
656  \[0 \le \var{l1} \le \var{u1} \le \var{s[1]},\]  \[0 \le \var{l1} \le \var{u1} \le \var{s[1]},\]

Legend:
Removed from v.3292  
changed lines
  Added in v.3293

  ViewVC Help
Powered by ViewVC 1.1.26