diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-10-08 18:36:39 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-10-08 18:36:39 +0200 |
commit | d866279364414235b531ab9c03eda6a14d9da1c5 (patch) | |
tree | 89a659e059bb2fd4aaea88afaa2c0fab5565950d /Eigen/src/SparseCore/SparsePermutation.h | |
parent | 8d00a953af6d84413abd0c8941db6666f4e0bf4e (diff) |
Clean a bit the implementation of inverse permutations
Diffstat (limited to 'Eigen/src/SparseCore/SparsePermutation.h')
-rw-r--r-- | Eigen/src/SparseCore/SparsePermutation.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Eigen/src/SparseCore/SparsePermutation.h b/Eigen/src/SparseCore/SparsePermutation.h index d63607b6c..3c58e3b4f 100644 --- a/Eigen/src/SparseCore/SparsePermutation.h +++ b/Eigen/src/SparseCore/SparsePermutation.h @@ -144,23 +144,22 @@ operator*( const PermutationBase<PermDerived>& perm, const SparseMatrixBase<Spar { return Product<PermDerived, SparseDerived>(perm.derived(), matrix.derived()); } -// TODO, the following specializations should not be needed as Transpose<Permutation*> should be a PermutationBase. /** \returns the matrix with the inverse permutation applied to the columns. */ -template<typename SparseDerived, typename PermDerived> -inline const Product<SparseDerived, Transpose<PermutationBase<PermDerived> > > -operator*(const SparseMatrixBase<SparseDerived>& matrix, const Transpose<PermutationBase<PermDerived> >& tperm) +template<typename SparseDerived, typename PermutationType> +inline const Product<SparseDerived, Inverse<PermutationType > > +operator*(const SparseMatrixBase<SparseDerived>& matrix, const InverseImpl<PermutationType, PermutationStorage>& tperm) { - return Product<SparseDerived, Transpose<PermutationBase<PermDerived> > >(matrix.derived(), tperm); + return Product<SparseDerived, Inverse<PermutationType> >(matrix.derived(), tperm.derived()); } /** \returns the matrix with the inverse permutation applied to the rows. */ -template<typename SparseDerived, typename PermDerived> -inline const Product<Transpose<PermutationBase<PermDerived> >, SparseDerived> -operator*(const Transpose<PermutationBase<PermDerived> >& tperm, const SparseMatrixBase<SparseDerived>& matrix) +template<typename SparseDerived, typename PermutationType> +inline const Product<Inverse<PermutationType>, SparseDerived> +operator*(const InverseImpl<PermutationType,PermutationStorage>& tperm, const SparseMatrixBase<SparseDerived>& matrix) { - return Product<Transpose<PermutationBase<PermDerived> >, SparseDerived>(tperm, matrix.derived()); + return Product<Inverse<PermutationType>, SparseDerived>(tperm.derived(), matrix.derived()); } } // end namespace Eigen |