Code

Imported upstream SVN snapshot 1.4~rc2+20090928.
[pkg-rrdtool.git] / doc / rrdgraph_rpn.txt
index 327dc0d6629813faf8ab0f71d0e026160f6f20a6..5de743f3c342214abe3b05a2aa178ea175239fa8 100644 (file)
@@ -11,17 +11,17 @@ S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        If you have ever used a traditional HP calculator you already know R\bRP\bPN\bN
        (Reverse Polish Notation).  The idea behind R\bRP\bPN\bN is that you have a
-       stack and push your data onto this stack. Whenever you execute an oper-
-       ation, it takes as many elements from the stack as needed. Pushing is
-       done implicitly, so whenever you specify a number or a variable, it
+       stack and push your data onto this stack. Whenever you execute an
+       operation, it takes as many elements from the stack as needed. Pushing
+       is done implicitly, so whenever you specify a number or a variable, it
        gets pushed onto the stack automatically.
 
        At the end of the calculation there should be one and only one value
        left on the stack.  This is the outcome of the function and this is
-       what is put into the _\bv_\bn_\ba_\bm_\be.  For C\bCD\bDE\bEF\bF instructions, the stack is pro-
-       cessed for each data point on the graph. V\bVD\bDE\bEF\bF instructions work on an
-       entire data set in one run. Note, that currently V\bVD\bDE\bEF\bF instructions only
-       support a limited list of functions.
+       what is put into the _\bv_\bn_\ba_\bm_\be.  For C\bCD\bDE\bEF\bF instructions, the stack is
+       processed for each data point on the graph. V\bVD\bDE\bEF\bF instructions work on
+       an entire data set in one run. Note, that currently V\bVD\bDE\bEF\bF instructions
+       only support a limited list of functions.
 
        Example: "VDEF:maximum=mydata,MAXIMUM"
 
@@ -30,9 +30,9 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
 
        Example: "CDEF:mydatabits=mydata,8,*"
 
-       This means:  push variable _\bm_\by_\bd_\ba_\bt_\ba, push the number 8, execute the oper-
-       ator _\b*. The operator needs two elements and uses those to return one
-       value.  This value is then stored in _\bm_\by_\bd_\ba_\bt_\ba_\bb_\bi_\bt_\bs.  As you may have
+       This means:  push variable _\bm_\by_\bd_\ba_\bt_\ba, push the number 8, execute the
+       operator _\b*. The operator needs two elements and uses those to return
+       one value.  This value is then stored in _\bm_\by_\bd_\ba_\bt_\ba_\bb_\bi_\bt_\bs.  As you may have
        guessed, this instruction means nothing more than _\bm_\by_\bd_\ba_\bt_\ba_\bb_\bi_\bt_\bs _\b= _\bm_\by_\bd_\ba_\bt_\ba _\b*
        _\b8.  The real power of R\bRP\bPN\bN lies in the fact that it is always clear in
        which order to process the input.  For expressions like "a = b + 3 * 5"
@@ -44,15 +44,15 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
        Boolean operators
            L\bLT\bT,\b, L\bLE\bE,\b, G\bGT\bT,\b, G\bGE\bE,\b, E\bEQ\bQ,\b, N\bNE\bE
 
-           Pop two elements from the stack, compare them for the selected con-
-           dition and return 1 for true or 0 for false. Comparing an _\bu_\bn_\bk_\bn_\bo_\bw_\bn
-           or an _\bi_\bn_\bf_\bi_\bn_\bi_\bt_\be value will always result in 0 (false).
+           Pop two elements from the stack, compare them for the selected
+           condition and return 1 for true or 0 for false. Comparing an
+           _\bu_\bn_\bk_\bn_\bo_\bw_\bor an _\bi_\bn_\bf_\bi_\bn_\bi_\bt_\be value will always result in 0 (false).
 
            U\bUN\bN,\b, I\bIS\bSI\bIN\bNF\bF
 
-           Pop one element from the stack, compare this to _\bu_\bn_\bk_\bn_\bo_\bw_\bn respec-
-           tively to _\bp_\bo_\bs_\bi_\bt_\bi_\bv_\be _\bo_\br _\bn_\be_\bg_\ba_\bt_\bi_\bv_\be _\bi_\bn_\bf_\bi_\bn_\bi_\bt_\by. Returns 1 for true or 0
-           for false.
+           Pop one element from the stack, compare this to _\bu_\bn_\bk_\bn_\bo_\bw_\bn
+           respectively to _\bp_\bo_\bs_\bi_\bt_\bi_\bv_\be _\bo_\br _\bn_\be_\bg_\ba_\bt_\bi_\bv_\be _\bi_\bn_\bf_\bi_\bn_\bi_\bt_\by. Returns 1 for true
+           or 0 for false.
 
            I\bIF\bF
 
@@ -70,8 +70,8 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
 
            Pops two elements from the stack and returns the smaller or larger,
            respectively.  Note that _\bi_\bn_\bf_\bi_\bn_\bi_\bt_\be is larger than anything else.  If
-           one of the input numbers is _\bu_\bn_\bk_\bn_\bo_\bw_\bn then the result of the opera-
-           tion will be _\bu_\bn_\bk_\bn_\bo_\bw_\bn too.
+           one of the input numbers is _\bu_\bn_\bk_\bn_\bo_\bw_\bn then the result of the
+           operation will be _\bu_\bn_\bk_\bn_\bo_\bw_\bn too.
 
            L\bLI\bIM\bMI\bIT\bT
 
@@ -102,8 +102,8 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
 
            S\bSI\bIN\bN,\b, C\bCO\bOS\bS,\b, L\bLO\bOG\bG,\b, E\bEX\bXP\bP,\b, S\bSQ\bQR\bRT\bT
 
-           Sine and cosine (input in radians), log and exp (natural loga-
-           rithm), square root.
+           Sine and cosine (input in radians), log and exp (natural
+           logarithm), square root.
 
            A\bAT\bTA\bAN\bN
 
@@ -112,12 +112,13 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
            A\bAT\bTA\bAN\bN2\b2
 
            Arctangent of y,x components (output in radians).  This pops one
-           element from the stack, the x (cosine) component, and then a sec-
-           ond, which is the y (sine) component.  It then pushes the arctan-
-           gent of their ratio, resolving the ambiguity between quadrants.
+           element from the stack, the x (cosine) component, and then a
+           second, which is the y (sine) component.  It then pushes the
+           arctangent of their ratio, resolving the ambiguity between
+           quadrants.
 
-           Example: "CDEF:angle=Y,X,ATAN2,RAD2DEG" will convert "X,Y" compo-
-           nents into an angle in degrees.
+           Example: "CDEF:angle=Y,X,ATAN2,RAD2DEG" will convert "X,Y"
+           components into an angle in degrees.
 
            F\bFL\bLO\bOO\bOR\bR,\b, C\bCE\bEI\bIL\bL
 
@@ -167,6 +168,7 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
                                          delay      t2
                                     <--------------->
 
+
                 Value at sample (t0) will be the average between (t0-delay) and (t0)
                 Value at sample (t1) will be the average between (t1-delay) and (t1)
                 Value at sample (t2) will be the average between (t2-delay) and (t2)
@@ -183,8 +185,8 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
            well
 
            Usage - explicit stating shifts: CDEF:predict=<shift n>,...,<shift
-           1>,n,<window>,x,PREDICT CDEF:sigma=<shift n>,...,<shift 1>,n,<win-
-           dow>,x,PREDICTSIGMA
+           1>,n,<window>,x,PREDICT CDEF:sigma=<shift n>,...,<shift
+           1>,n,<window>,x,PREDICTSIGMA
 
            Usage - shifts defined as a base shift and a number of time this is
            applied CDEF:predict=<shift multiplier>,-n,<window>,x,PREDICT
@@ -192,8 +194,9 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
 
            Example: CDEF:predict=172800,86400,2,1800,x,PREDICT
 
-           This will create a half-hour (1800 second) sliding window aver-
-           age/sigma of x, that average is essentially computed as shown here:
+           This will create a half-hour (1800 second) sliding window
+           average/sigma of x, that average is essentially computed as shown
+           here:
 
             +---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!--->
                                                                                 now
@@ -219,11 +222,11 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
             Value at sample (t1) will be the average between (t1-shift1-window) and (t1-shift1)
                                                  and between (t1-shift2-window) and (t1-shift2)
 
-           The function is by design NAN-safe.  This also allows for extrapo-
-           lation into the future (say a few days) - you may need to define
-           the data series whit the optional start= parameter, so that the
-           source data series has enough data to provide prediction also at
-           the beginning of a graph...
+           The function is by design NAN-safe.  This also allows for
+           extrapolation into the future (say a few days) - you may need to
+           define the data series whit the optional start= parameter, so that
+           the source data series has enough data to provide prediction also
+           at the beginning of a graph...
 
            Here an example, that will create a 10 day graph that also shows
            the prediction 3 days into the future with its uncertainty value
@@ -268,8 +271,8 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
 
            Pushes an _\bu_\bn_\bk_\bn_\bo_\bw_\bn value if this is the first value of a data set or
            otherwise the result of this C\bCD\bDE\bEF\bF at the previous time step. This
-           allows you to do calculations across the data.  This function can-
-           not be used in V\bVD\bDE\bEF\bF instructions.
+           allows you to do calculations across the data.  This function
+           cannot be used in V\bVD\bDE\bEF\bF instructions.
 
            P\bPR\bRE\bEV\bV(\b(v\bvn\bna\bam\bme\be)\b)
 
@@ -287,7 +290,7 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
 
        Time
            Time inside RRDtool is measured in seconds since the epoch. The
-           epoch is defined to be "Thu Jan 1 00:00:00 UTC 1970".
+           epoch is defined to be "Thu Jan  1 00:00:00 UTC 1970".
 
            N\bNO\bOW\bW
 
@@ -301,9 +304,9 @@ O\bOP\bPE\bER\bRA\bAT\bTO\bOR\bRS\bS
            L\bLT\bTI\bIM\bME\bE
 
            Takes the time as defined by T\bTI\bIM\bME\bE, applies the time zone offset
-           valid at that time including daylight saving time if your OS sup-
-           ports it, and pushes the result on the stack.  There is an elabo-
-           rate example in the examples section below on how to use this.
+           valid at that time including daylight saving time if your OS
+           supports it, and pushes the result on the stack.  There is an
+           elaborate example in the examples section below on how to use this.
 
        Processing the stack directly
            D\bDU\bUP\bP,\b, P\bPO\bOP\bP,\b, E\bEX\bXC\bC
@@ -365,8 +368,8 @@ V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bES\bS
            y-intercept _\b(_\bb_\b), which happens also to be the first data point on
            the graph. LSLCORREL is the Correlation Coefficient (also know as
            Pearson's Product Moment Correlation Coefficient).  It will range
-           from 0 to +/-1 and represents the quality of fit for the approxima-
-           tion.
+           from 0 to +/-1 and represents the quality of fit for the
+           approximation.
 
            Example: "VDEF:slope=mydata,LSLSLOPE"
 
@@ -386,4 +389,4 @@ A\bAU\bUT\bTH\bHO\bOR\bR
 
 
 
-1.3.99909060808                   2009-02-21                   RRDGRAPH_RPN(1)
+1.3.999                           2009-06-09                   RRDGRAPH_RPN(1)