From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 24/25]: Macro for moving average
Date: Mon, 02 Apr 2007 08:57:06 +0000 [thread overview]
Message-ID: <200704020957.07122@strip-the-willow> (raw)
In-Reply-To: <200703211846.10823@strip-the-willow>
Quoting Ian McDonald:
| > +/**
| > + * Macro for exponentially weighted moving average
| > + * @weight: Weight to be used as damping factor, in units of 1/10
| > + * Beware that @val is evaluated multiple times.
| > + */
| > +#define TFRC_EWMA(val, newval, weight) \
| > + val = val? ((weight) * val + (10 - (weight)) * (newval)) / 10 : (newval)
| > +
| Just wondering why you pass weight when you only use 9 anyway and it
| just adds a step. Is it used in following patches with a different
| weight?
|
In the following patches it is used one more time, which is for the `Preventing
Oscillations' changeset (this is not in the next patch set but in the one after that);
here again the weight 9/10 is used. I think it is useful to keep the `weight' argument,
since RFC 3448 suggests to use a different weight for the RTT sample when the `Oscillation
Prevention' e.g. is not deployed (a q close to zero).
I think it is better to keep the weight argument, it allows changing the code later, while
still providing the abstraction: for CCID 3 there are 4 uses of this macro alone.
next prev parent reply other threads:[~2007-04-02 8:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-21 18:46 [PATCH 24/25]: Macro for moving average Gerrit Renker
2007-03-26 4:04 ` Ian McDonald
2007-04-02 8:57 ` Gerrit Renker [this message]
2007-04-02 9:06 ` Ian McDonald
2007-04-12 16:10 ` Arnaldo Carvalho de Melo
2007-04-13 8:23 ` Gerrit Renker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200704020957.07122@strip-the-willow \
--to=gerrit@erg.abdn.ac.uk \
--cc=dccp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.