Re: [eigen] Index bounds checking assertion |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Index bounds checking assertion
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 9 Jun 2010 07:16:11 -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=GBDHXrh6AJ0a5K9dC9fCK+2Qp9cpj6V08EX+hlrjKiE=; b=xIH5FrqJV24/gWnQsDJMKrwgFku5mq+txMpj4QPefuQKFfXfIxLmVLGyUPkNE8yTI/ KpuzTd566aM8+EwVCG8n7Ig3T9GAEiMSudKrgGbDZ2B4wZYGBFY14CexxjsfhpaB1WHH qAAElhwUSOJtX9AUH/xzJ1moV449HAJAO9InI=
- 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=S16Lu8fsNtjggUT7PAQ/TQtoOsZGt9FlKfzJyhbaN1CaS1VhC2fPHy2c4SGzk4an3G /o0Pl7SkR9WxixnJvA2rN1lolgva0ihAulg+O52OBJ28qslDLE8fYKY6NoD+8lDR71sF +jMn7LVqZB8MjTf3iRh1Tvu1EEssxHtlNldkE=
2010/6/9 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> I don't know... by entering a debugger, the user can print row and col
> and rows() and cols() and figure it out right away; no need for printf
> debugging here.
>
> Splitting this into more assertions will have the (small) drawback of
> inflating a bit more the code size, since each assertion will have its
> own string, and these are rather long strings. Suppose each string is
> 150 bytes, this would go from 1 to 4 strings, so 450 more bytes. The
> problem is that this is for each separate expression type, and a
> typical can have many of those, e.g. 100 types, leading to a 45 kB
> code size increase. Of course this goes away when you disable asserts,
> but currently leaving asserts often has a negligible speed cost, which
> allows many users to leave them in even in release code.
Actually I checked, and the strings are bigger than 150 bytes, they
are rather like 500 bytes, so multiply the above numbers by 3 :)
Benoit
>
> Benoit
>
> 2010/6/9 Rohit Garg <rpg.314@xxxxxxxxx>:
>> Presently, in the DenseCoeffsBase.h, file, line 305, we have the
>> runtime assertion, row >= 0 && row < rows() && col >= 0 && col <
>> cols()
>>
>> It will be better to split it into 4 assertions so that when the
>> assertion fails, we get a more pointed message. Otherwise, the user
>> needs to do some debugging, (printf or otherwise), just to figure out
>> which index malfunctioned and from what side.
>>
>> --
>> Rohit Garg
>>
>> http://rpg-314.blogspot.com/
>>
>> Senior Undergraduate
>> Department of Physics
>> Indian Institute of Technology
>> Bombay
>>
>>
>>
>