Re: [eigen] A not so simple product

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


Sure, we do that all the time!

We have 33 large tests (each consisting of dozens of unit tests and
applied to several different types/sizes).

Cheers,
Benoit

2008/12/10 Keir Mierle <mierle@xxxxxxxxx>:
> One small note: Before these bugs are fixed, please put a test case in the
> test directory that fails first! This way the bugs stay fixed, and outside
> contributors can be more confident they don't break existing code. I do test
> driven development at work, and I would never go back. Without extensive
> regression tests for every bug, it's hard to maintain quality.
>
> Making a habit of writing a test case for every bug before even searching
> for the guilty lines of code is a good way to do this.
>
> Cheers,
> Keir
>
> On Wed, Dec 10, 2008 at 6:46 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> wrote:
>>
>> I just discovered yet another bug in diagonal product. This part of
>> Eigen is really very buggy!!
>>
>> To grade my exam I made this program:
>>
>> #define EIGEN_DEFAULT_IO_FORMAT EIGEN_DOCS_IO_FORMAT
>> #include <Eigen/QR>
>>
>> using namespace Eigen;
>> using namespace std;
>>
>> int main()
>> {
>>  Matrix3d A;
>>  A << 0,1,1,
>>       1,0,1,
>>       1,1,0;
>>  SelfAdjointEigenSolver<Matrix3d> s(A);
>>  cout << "Eigenvalues:" << endl << s.eigenvalues() << endl;
>>  cout << "Eigenvectors:" << endl << s.eigenvectors() *
>> (s.eigenvectors().row(2).cwise().inverse().asDiagonal()).eval() <<
>> endl;
>> }
>>
>> This program produces the correct result.
>>
>> But if I remove the .eval() it produces the wrong result.
>>
>> Fixing diagonal product is really my top priority in eigen.... will
>> take me a while though as a first have to grade 400 exams.
>>
>> Cheers,
>> Benoit
>>
>> ---
>>
>
>

---


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