Re: [eigen] Fast QR for 2x2, 3x3 |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Fast QR for 2x2, 3x3*From*: Andrea Arteaga <yo.eres@xxxxxxxxx>*Date*: Tue, 24 Feb 2009 23:49:34 +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=RH4RRIpsRa3RzQEEYqmv3y7xiZvINX8VvjyKSIPvSe0=; b=CzRp4Sk5/nO+Ep7yyC5jxEAvGC+vglKXpTGjg1zpYhIb3qCdq7/rYGwnu4mn8Zudhj INC6yhlxY/45se8D8u7TucSE5qSVuxRlHdt3XR6QzEK/4dVknGtVP+nktMI/lCUFTNtL IZe84ErKtcqTqsadL2xVAq1zCu2AKeUGCFXtY=*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=RZUJyVgGFJhty+B1xWr3TuSdS99fSbH3WzF/uWowW8hbgMgYOZx5T/5aPqYM8JrF9C jAxuRfJOI+I+vHGcejo1Jy7L5wnwWOTA+ak4ydq0i9uD2VWrDgnTiXPT662uONdKKm7i 2LR1ctvQfjEZbbtNTMKU7uNH0nEIn/f+IjubU=

I thought about how to include the code in th QR.h header. I think that the fastest way is to specialize the MatrixBase<Derived>::qr() method such that for small matrices it calls one cunstructor of the QR class, for each other matrices it calls another constructor. The two constructors can be differentiated by add an argument enum qr_algorithm with default value Householder in this way:

enum qr_algorithm { Householder, Givens, GramSchmidt };

QR(const MatrixType& matrix, qr_algorithm alg = Householder)

Old code is also compatible thanks to default value. The constructor will also control if alg is Householder (and then execute the normal _compute() method) o Givens (or GramSchmidt) and then execute another method (for example _compute_givens() ), which does the same using Givens - and the Markus' code.

If this run-time control is too inefficient, we can implement a compile-time control (with templates), but that cannot perhaps ensure the backward-compatibility of the code.

Note that all this only works with fixed-size matrices. For dynamically-sized matriced we need a run-time implementation without specialization of the MatrixBase::qr() method.

Andrea

**Follow-Ups**:**Re: [eigen] Fast QR for 2x2, 3x3***From:*Gael Guennebaud

**References**:**[eigen] Fast QR for 2x2, 3x3***From:*Andrea Arteaga

**Re: [eigen] Fast QR for 2x2, 3x3***From:*Benoit Jacob

**Re: [eigen] Fast QR for 2x2, 3x3***From:*Andrea Arteaga

**Re: [eigen] Fast QR for 2x2, 3x3***From:*grey_earl

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Undesired formatting behaviour** - Next by Date:
**Re: [eigen] Fast QR for 2x2, 3x3** - Previous by thread:
**Re: [eigen] Fast QR for 2x2, 3x3** - Next by thread:
**Re: [eigen] Fast QR for 2x2, 3x3**

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