linbox
linbox copied to clipboard
BlasPermutation.resize() does not work
See #90 for the clean-up discussion about permutations.
This code shows the problem:
#include <iostream>
#include <givaro/modular.h>
#include <linbox/matrix/dense-matrix.h>
#include <linbox/matrix/permutation-matrix.h>
int main(void) {
using Field = Givaro::Modular<double>;
using Matrix = LinBox::DenseMatrix<Field>;
Field F(11);
Matrix M(F, 2, 1);
M.setEntry(0, 0, 0.0);
M.setEntry(1, 0, 1.0);
#if 0
LinBox::BlasPermutation<size_t> P(2);
LinBox::BlasPermutation<size_t> Q(1);
#else
LinBox::BlasPermutation<size_t> P;
LinBox::BlasPermutation<size_t> Q;
P.resize(2);
Q.resize(1);
#endif
LinBox::PLUQMatrix<Field>(M, P, Q);
std::cout << P << std::endl;
std::cout << Q << std::endl;
}
When the first (right) version is used:
[1,1](2)
[0](1)
When the second (failing) version is used:
[](2)
[](1)