[FFmpeg-devel] [PATCH] doc/eval: fix/extend documentation for root() function

Michael Niedermayer michaelni at gmx.at
Wed Jan 30 00:00:53 CET 2013


On Sat, Jan 26, 2013 at 11:16:28AM +0100, Stefano Sabatini wrote:
> On date Thursday 2013-01-24 00:17:38 +0100, Michael Niedermayer encoded:
> > On Wed, Jan 23, 2013 at 07:18:48PM +0100, Stefano Sabatini wrote:
> [...]
> > I wrote the code
> > I dont understand the docs you write
> > 
> > if you want to make it clearer IMHO put less in the sentance and
> > clearer not more
> > 
> > Finds the value x at which f(x)=0 in the interval 0 <= x <= max.
> > ld(0) is used to represent x, that means that your given expression
> > will be evaluated multiple times with various values of x that the
> > expression can access through ld(0).
> > When your expression evaluates to 0 then the value of ld(0) will be
> > returned by root()
> > 
> > f() must be continuous or the result is undefined.
> 
> Edited and somehow readjusted based on your suggestion. What I mostly
> dislike about the current doc is the mention of "f()" out of the blue,
> which is not really clear what it really refers to.
> 
> BTW in case the function has no roots it currently returns max, NaN
> may be a saner choice (currently undocumented so it should be OK to
> change the implementation).
> -- 
> FFmpeg = Frenzy and Fostering Mystic Peaceful Entertaining Geisha

>  eval.texi |   13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 8d97e3ade16c312cd6e86ee2fef44e01fea1dc60  0002-doc-eval-fix-extend-documentation-for-root-function.patch
> From 4c1a8ea714e4bbbb57ef20587a68bcaaa6286ffd Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Wed, 23 Jan 2013 11:45:31 +0100
> Subject: [PATCH] doc/eval: fix/extend documentation for root() function
> 
> ---
>  doc/eval.texi |   13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/eval.texi b/doc/eval.texi
> index 0477882..ceb1c17 100644
> --- a/doc/eval.texi
> +++ b/doc/eval.texi
> @@ -181,8 +181,17 @@ converge the result is undefined.
>  Return the current (wallclock) time in seconds.
>  
>  @item root(expr, max)
> -Finds x where f(x)=0 in the interval 0..max.
> -f() must be continuous or the result is undefined.
> +Find a value where a function represented by @var{expr} with argument
> + at var{ld(0)} is 0 in the interval 0.. at var{max}.
> +
> +The expression in @var{expr} must denote a continuous function or the
> +result is undefined.
> +

> + at var{ld(0)} is used to represent the function value, that means that

this is not correct
you mix value and argument, maybe you should use "input" and "output"
instead


> +the given expression will be evaluated multiple times with various
> +values of x that the expression can access through @code{ld(0)}. When
> +the expression evaluates to 0 then the value of @code{ld(0)} will be
> +returned.
>  @end table
>  
>  The following constants are available:
> -- 
> 1.7.9.5
> 

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130130/c5d7a866/attachment.asc>


More information about the ffmpeg-devel mailing list