Re: [eigen] beta1: Nullary tests failing |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] beta1: Nullary tests failing*From*: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>*Date*: Wed, 30 Jun 2010 13:45:39 -0400*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=oaC5EERa0xkIwJQEBlv0z7C+9Wp0HJ8idn2Mq77RCkg=; b=CUGWf+MYqyRLMUOb2Y4MQk4y01WYSJCT6STLxK/swzCtCNHF395QoNSH5gJY+X8Aax pPt7939k3xQvZCW73ULXSLR8aZPiTvn/1blBEeqPUGQrPVm4g/xGa3oj4a+egtGWhLcw vBcHMevoie6dhfoysMqmN2rdzIbDdj6CVkNeY=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UkQzXoLC9VpZzUNK9Rqh0ZFSqI5uUeBTn1zvZIHYAUWRGbfJBEEfWL5t71i5QQ6i0r rSpNGzlS16qrYtAtpHhZhu1z7lICogbxcAC8nFupH5OYP2qJc2eIE2GaWgyj0pBXiZ8k BGWZ9ZFBOdcueovLjgtXI/B2h0TL6Hxmryk5w=

2010/6/30 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>: > 2010/6/30 Carlos Becker <carlosbecker@xxxxxxxxx>: >> Benoit & Gael: tests for nullary are failing, now at >> Test testVectorType(VectorXf(51)) failed in >> "/home/cjb/eigenThings/eigenBetaTest/eigen/test/nullary.cpp" (91) >> (row_vector-col_vector.transpose()).norm() < >> NumTraits<Scalar>::epsilon() >> and also with other tests with float. I just added: >> std::cout << "NumTraits<Scalar>::epsilon() => " << >> NumTraits<Scalar>::epsilon() << std::endl; >> std::cout << "Value => " << (row_vector-col_vector.transpose()).norm() << >> std::endl; >> and got: >> NumTraits<Scalar>::epsilon() => 1.19209e-07 >> Value => 5.33717e-05 >> or >> NumTraits<Scalar>::epsilon() => 1.19209e-07 >> Value => 4.26496e-06 >> So I guess that it is the same we were fixing the other day but in a >> different place. If I change NumTraits<Scalar>::epsilon() >> by std::numeric_limits<Scalar>::epsilon()*10e3 then it runs ok (this would >> be Gael's fix). > > Where would this 1e+3 come from? Let's avoid arbitrary magic numbers. > Also, use NumTraits<Scalar>::epsilon() and not > std::numeric_limits<Scalar>::epsilon(), although they are the same > when both are defined. > > This test looks good, I am not sure why it is failing. One explanation > would be if one path was vectorized and not the other. Pinging Hauke > (you wrote LinSpaced didn't you?) Ah, I know. This test is an absolute fuzzy test, using epsilon() as absolute precision. Which only works for FP values of the order of magnitude of 1. Here, apparently, we are comparing two numbers roughly of the order of magnitude of 1e+2, and so the absolute error is 1e+2 times bigger than expected. Try this: replace this line, VERIFY( (row_vector-col_vector.transpose()).norm() < NumTraits<Scalar>::epsilon() ); by this: VERIFY( row_vector.isApprox(col_vector.transpose(), NumTraits<Scalar>::epsilon())); this does a relative fuzzy check. If that still doesn't work, can you print the value of : (row_vector-col_vector.transpose()).norm() / row_vector.norm() Thanks Benoit > > Benoit >

**Follow-Ups**:**Re: [eigen] beta1: Nullary tests failing***From:*Carlos Becker

**References**:**[eigen] beta1: Nullary tests failing***From:*Carlos Becker

**Re: [eigen] beta1: Nullary tests failing***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] beta1 tagged (NOT RELEASED), first try** - Next by Date:
**Re: [eigen] beta1: Nullary tests failing** - Previous by thread:
**Re: [eigen] beta1: Nullary tests failing** - Next by thread:
**Re: [eigen] beta1: Nullary tests failing**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |