[Carpet] type-cast warnings
Erik Schnetter
schnetter at cct.lsu.edu
Tue Oct 17 21:22:08 CEST 2006
On Oct 17, 2006, at 11:35:58, Steve White wrote:
> This is impressive.
>
> I just sent Erik an e-mail saying I had fixed all these things.
>
> However, I picked out the line 4 above the one Bela mentions as being
> particularly scary:
>
> myinval += (static_cast<const T*>(inarrays.at(tl))[index]
> * tfacs.at(tl));
I don't perceive this line as scary. inarrays.at(tl) is a void*
which points to an array of T, where T is most of the time double.
This is the standard way of accessing such data.
> It isn't clear to me what "mycnt" is supposed to be doing,...
mycnt counts the number of points that have been reduced. It sums
the weights rather than counting points, corresponding e.g. to the
second integral in the formula
avg = int rho(x) W(x) dx / int W(x) dx
-erik
--
Erik Schnetter <schnetter at cct.lsu.edu>
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : /archives/developers/attachments/20061017/81c877ad/attachment.pgp
More information about the developers
mailing list