[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] triangular solve
- From: M A <markoilcan@xxxxxxxxx>
- Date: Thu, 20 Dec 2012 15:53:00 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=pgiik0ize3MrKtvGJab8yJvpBZb3xALqNN0gCo7eiMk=; b=g1MIwM2MRuuuKt1yDrKnNVycaCKbUjg/2oXDRmoS66SPzVPuqrA1ncvTF0g/biXgyY hUWOt8VfUbaX4timJdWU4Q3fLEn/eDWUXr+286LYKZyaSgwft9xdwFgYMvTN5BurfC2T ls5fGNieRxnHzhrNyVGrq1/oVaPPeLyGG7bh+Si9Xv7T+miT1r/tAdrZ5Y8PrOsckgNu QXXNTsR0PZFZLrafYRN/2T8SpDAPfqFR6AL9idNuBFhoNK/5BzWGtVt6cGbmiGAV9OwL VqSWY7SPGHO0KE3BOnnyTbheN2XZmi8JeqhEhBjp+8IBKK5pHoIiybxccffy2YmqeFKl vDEw==
I'm having trouble compiling eigen code to do a solve with two lower
triangular matrices. That is I want L1^{-1} * L2 where L1 and L2 both
come from LLT objects by way of matrixL(). Here is my class and
function,
class Covariance_comp : public LLT<MatrixXf> {
public:
float variance;
Covariance_comp( const MatrixXf &pdmat, float var) : LLT<MatrixXf>
(pdmat), variance( var ) {}
float update_fixedpt( const Covariance_comp &total_cov, VectorXf resids ) {
float numer = (this->matrixU() *
total_cov.solve(resids)).array().square().sum();
cout << "numer = " << numer << endl;
// This next line is the problem:
float denom = total_cov.matrixL().solve(this->matrixL()).array().square().sum();
cout << "denom = " << denom << endl;
variance *= numer / denom;
return variance;
}
};
The problem comes in the line float denom = .... with g++ complaining
about the solve:
error: no matching function for call to ‘Eigen::TriangularView<const
Eigen::Matrix<float, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 1u>::solve(const
Eigen::TriangularView<const Eigen::Matrix<float, -0x00000000000000001,
-0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>,
1u>) const’
I don't understand the problem. Both total_cov and this are
essentially LLT objects. Is the problem using this->matrixL() as the
argument to solve? What is the best way to do this that takes
advantage of the triangular nature of the matrices? This is using
eigen 3.1.2.
Thanks!
Mark A