[eigen] Strange behaviour with part<> in eigen2 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Strange behaviour with part<> in eigen2
- From: Sameer Agarwal <sameeragarwal@xxxxxxxxxx>
- Date: Mon, 13 Jun 2011 13:41:21 -0700
- Cc: Keir Mierle <keir@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1307997684; bh=SmYMUM2dmjPPzW1F4ffKpnDK8BU=; h=MIME-Version:Date:Message-ID:Subject:From:To:Cc:Content-Type; b=vprK3yD4O+kW/+90enW8IDBpmCHKC01W7sLESZYFSoTgCYJ8CIulsIEnk6XWv5ESl nKvuL1s8J9nXCbNP5jMAw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:date:message-id:subject:from:to:cc :content-type; bh=wk6lNLFaR9Kllkv0SECcPDDUU3GoASEtrSZwaXlonhg=; b=EOvLJJhbJH/ryLFL0yckiAyLymnBQPuUE0GNplDqGMiDFTkKzOlvEaf/VjIGTxH5nU FFodIU7OIXJWk9WbWwJw==
- Domainkey-signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=jshn9oI/A9x6ZGfeKdCZ4Uy1EgjvngkHhpCTBI+aFjHhVNFAkpa4gqWJDwj1NvG0DA ti9AFo9zdlOpApyY122w==
Consider the following two programs
#include "Eigen/Core"
#include "Eigen/LU"
void Bar() {
typedef Eigen::Matrix<double, 3,3, Eigen::RowMajor> MType;
MType A = MType::Identity();
MType B;
A.part<Eigen::SelfAdjoint>().computeInverse(&B);
}
int main(int argc, char** argv) {
Bar();
return 0;
}
and this compiles. No problem. Now consider
#include "Eigen/Core"
#include "Eigen/LU"
template <int block_size>
void Bar() {
typedef Eigen::Matrix<double, block_size, block_size, Eigen::RowMajor> MType;
MType A = MType::Identity();
MType B;
A.part<Eigen::SelfAdjoint>().computeInverse(&B);
}
int main(int argc, char** argv) {
Bar<3>();
return 0;
}
with gcc 4.4.3 we get the errors
test_eigen.cc: In function ‘void Bar()’:
test_eigen.cc:11: error: expected primary-_expression_ before ‘)’ token
test_eigen.cc: In function ‘void Bar() [with int block_size = 3]’:
test_eigen.cc:15: instantiated from here
test_eigen.cc:11: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘const unsigned int’ to binary ‘operator<’
Any ideas what is going on here?
Sameer