[ADOL-C] result seems to differ for double and adouble

Norman Goldstein normvcr at telus.net
Sun Aug 11 11:12:32 EDT 2013


Perhaps running a memory checker, such as valgrind on linux, would be 
insightful?


On 08/11/2013 12:55 AM, Nozomu Tomita wrote:
> Dear all,
>
> I'm writing 3-dimensional geometrical calculation, such as how long a line penetrates a box,
> with templated class.
>
> The problem is that my templated function returns different results for double and adouble,
> and "const adouble" quantities seem to change in the middle of calculation.
>
> I'm sorry for the mess of source code, but I couldn't pick out the exact place that harms...
>
> My code http://pastebin.ca/2430586 is meant to do an identical calculation for both double and adouble,
> checking whether a line that is parallel to z-axis and on (1/2, 1/2, 0), penetrates
> a square (0,0,0)-(1,0,0)-(1,1,0)-(0,1,0).
>
> That returns correctly true for double, but false for adouble.
> Compiling this with -DDEBUG produces this output: http://pastebin.ca/2430588
>
> Line 55 - 67 of this output correspond to line 173 - 216 of source with template argument Real==adouble.
> The Odd thing is that although X and u (and its members) are declared as const,
> they change during calculation, from line 57 (u == vector3(0(a), 0(a), 1(a)))
> and line 59 (u == vector3(0(a), 0(a), 0(a))).
>
>
> I tested this result for ADOL-C 2.4.1 in two environments:
> * Debian 6.0.1,
>   with g++ (Debian 4.4.5-8) 4.4.5
> * MacOS X 10.8.4,
>   with g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
>
>
> Thank you!
>
> Tomita
> _______________________________________________
> ADOL-C mailing list
> ADOL-C at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/adol-c
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4243 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://list.coin-or.org/pipermail/adol-c/attachments/20130811/53521ff9/attachment.p7s>


More information about the ADOL-C mailing list