Re: [eigen] what to do with old flags like SelfAdjointBit |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] what to do with old flags like SelfAdjointBit
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Sun, 22 Nov 2009 16:52:08 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=mcphBF7RYaHNAq2EHU5kzOtfIgaQlxpB5qr+P3JWjtE=; b=lWUskkOlnRALoh3mu0Af+8eNAVrSf+y7jlbRHnqwu0nWuH/fbD26poGmSBmtzIYo8l oZgst54rCmqYTbrs+1t27x3E4UeYEieCni+MMYW0pdWP4q4A4pS7IDdzyS9dtoTGG8i7 rrFu8YkbwaRIquDkp3NyDfU+1p6gVTE0t+jRg=
- 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=NgHVR034h5i1Xh67BipOh/LqGW/4MsuR2pfJM/hRtxmkeasVFZKZEwoKN6nYjhwH0S 2kKS4MwpjxpFYY70XVOcxr+zmtA3NNaNivFKtjeSg73tjgAtJvQy8VooYgjtRKHbmcXd r1YfXAa52DDp1tbZqGhx6zOdIVbAGEzAf7E+M=
2009/11/22 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>
> I my opinion we can safely remove those bit flags.
>
> In the Eigenvalues module the two methods using SelfAdjointBit have to be
> moved/specialized in SelfAdjointView anyway to make them really usable, and
> so they won't use this bit flag anymore.
>
> About the SparseModule, I've already implemented the same API than for dense
> matrices, and so they are not needed anymore. Well, this is currently in my
> fork, so let's say we keep these bit flags until the merge is done.
ok, thanks for the reply. So i do nothing for now.
I also don't do the renaming UpperTriangular--->Upper to limit
conflicts, until your merge.
Benoit
>
> gael.
>
> On Sun, Nov 22, 2009 at 9:42 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> wrote:
>>
>> Hi,
>>
>> a long time ago, we thought that properties like "upper triangular" or
>> "self-adjoint" should be handled as MatrixBase Flags. We have long
>> changed our minds: they are now handled as special proxy classes like
>> TriangularView and SelfadjointView, and at the moment we dont even try
>> to offer storage classes for that. (Note that even in LAPACK, useful
>> triangular storage is only a recent/future feature.)
>>
>> This leaves the question, what to do with the old bits such as
>> SelfAdjointBit, etc. Initially I just wanted to remove these enum
>> values, but I noticed that quite a bit of code (mainly in Sparse and
>> in Eigenvalues) is still checking for that bit and has special code
>> paths. If I just remove SelfAdjointBit, I have to remove that code
>> too, which is too bad. So instead, let's discuss right now what should
>> be the proper way to check for selfadjointness on generic types. Note
>> that i'm only using SelfAdjoint as an example: there are also all the
>> triangular shapes.
>>
>> Solutions:
>>
>> A. we can just keep SelfAdjointBit, just document well that MatrixBase
>> objects just never have that bit set, but other AnyMatrixBase classes
>> may still have it.
>>
>> B. actually i suspect that it will be much more scalable to introduce
>> structs like this:
>>
>> template<typename T> struct ei_is_selfadjoint
>> {
>> enum { ret = 0 };
>> };
>>
>> which partial specializations like:
>>
>> template< blabla > struct SelfAdjointView< blabla >
>> {
>> enum { ret = 1 };
>> };
>>
>> C. unify all that in a single struct. We can't really put that in
>> ei_traits because we want to define that once and for all to 0 for all
>> MatrixBase objects, we don't want to have to write again and again in
>> all the ei_traits more boilerplate code. So perhaps ei_shape:
>>
>> template<typename T> struct ei_shape
>> {
>> enum { ret = 0 };
>> };
>>
>> which partial specializations like:
>>
>> template< blabla > struct SelfAdjointView< blabla >
>> {
>> enum { ret = SelfAdjointBit };
>> };
>>
>> Here, i think of ret as a bit-field. So SelfAdjointBit would survive
>> but it wouldn't have to have a special value different from MatrixBase
>> Flags bits. It could be just 1, etc...
>>
>> Again, i used SelfAdjointBit as an example, think of all the
>> triangular flags here.
>>
>> Benoit
>>
>>
>
>
>
>
>