|Re: [eigen] ideas about the corner types|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] ideas about the corner types
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Fri, 5 Feb 2010 10:42:17 +0100
- 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; bh=/qNYyV+vdU7kqYDaZPbhJusG8QBADt2kQJT0jHyELHU=; b=ebmxqzWkEPNe85xbevOuhNxOlwPu/vVT1LL/musIPGQ9Rq6Ih0sVGbhEYa+fsF5TEt bhv1bKjZZ184FIgLyzxOSUE+6eK2g+M1b0IK5oIy9QEVeU9PfUoqhK3xEN59MlPSCOKj Js3s1fR8bGF2sJZrfdu/ldIDOdXDZSdXFRUXs=
- 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; b=x0Mn7AJTh9zKNc/1CdLu9wNha8nb7+d6egjkJYeJ7Heg6MsKUJII017OTrdEs+uJI7 yp01HnOzxMw23+UOKOPNUQu6RtyqgEMRoOYk6h69uTCCYTic4TM03uEeeiHo6sUtIhu9 DESt/Rmp+BwWFNWF5TTzP7FPaJlgzOb1UxWgk=
On Fri, Feb 5, 2010 at 8:11 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
Currently matrix.corner(TopLeft,3,3) takes TopLeft as a runtime
parameter. This is based around the assumption that the compiler
resolves this at compile time. In practice that seems to work although
I only checked GCC. Here's an idea to resolve this at runtime: let
TopLeft be an object of type CornerType<TopLeft_t>, etc.. taking a
common template CornerType type allows to write the function only
once, yet have a guarantee that that stuff resolves at compile time.
Sounds good, and that does not change the API right ?
Many times we just want the bottom N rows of a matrix. So why not
introducing Bottom, Top, etc... new corner types. Taking only one size
parameter instead of 2. That would make that stuff more elegant to use
in practice, more justified to exist (currently in many cases the
interest of that seems questionable).
indeed, Bottom and Top are very useful too.