diff options
author | 2009-07-04 11:16:27 +0200 | |
---|---|---|
committer | 2009-07-04 11:16:27 +0200 | |
commit | 08e419dcb151da41f169304f751e5467cf0c7b4a (patch) | |
tree | a034ebfc0ee08790f5c7b52919733ba7b2ea9840 /Eigen/src/Sparse/SparseProduct.h | |
parent | 2de9b7f537057101f9684370004156425a24032e (diff) |
* update sparse module wrt new diagonal matrix impl
* fix a bug is SparseMatrix
Diffstat (limited to 'Eigen/src/Sparse/SparseProduct.h')
-rw-r--r-- | Eigen/src/Sparse/SparseProduct.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/Eigen/src/Sparse/SparseProduct.h b/Eigen/src/Sparse/SparseProduct.h index 5222439d8..a9ad8aad4 100644 --- a/Eigen/src/Sparse/SparseProduct.h +++ b/Eigen/src/Sparse/SparseProduct.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // -// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr> +// Copyright (C) 2008-2009 Gael Guennebaud <g.gael@free.fr> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -29,9 +29,7 @@ template<typename Lhs, typename Rhs> struct ei_sparse_product_mode { enum { - value = ei_is_diagonal<Lhs>::ret || ei_is_diagonal<Rhs>::ret - ? DiagonalProduct - : (Rhs::Flags&Lhs::Flags&SparseBit)==SparseBit + value = (Rhs::Flags&Lhs::Flags&SparseBit)==SparseBit ? SparseTimeSparseProduct : (Lhs::Flags&SparseBit)==SparseBit ? SparseTimeDenseProduct @@ -47,15 +45,6 @@ struct SparseProductReturnType typedef SparseProduct<LhsNested, RhsNested, ProductMode> Type; }; -template<typename Lhs, typename Rhs> -struct SparseProductReturnType<Lhs,Rhs,DiagonalProduct> -{ - typedef const typename ei_nested<Lhs,Rhs::RowsAtCompileTime>::type LhsNested; - typedef const typename ei_nested<Rhs,Lhs::RowsAtCompileTime>::type RhsNested; - - typedef SparseDiagonalProduct<LhsNested, RhsNested> Type; -}; - // sparse product return type specialization template<typename Lhs, typename Rhs> struct SparseProductReturnType<Lhs,Rhs,SparseTimeSparseProduct> @@ -106,7 +95,7 @@ struct ei_traits<SparseProduct<LhsNested, RhsNested, ProductMode> > // RhsIsRowMajor = (RhsFlags & RowMajorBit)==RowMajorBit, EvalToRowMajor = (RhsFlags & LhsFlags & RowMajorBit), - ResultIsSparse = ProductMode==SparseTimeSparseProduct || ProductMode==DiagonalProduct, + ResultIsSparse = ProductMode==SparseTimeSparseProduct, RemovedBits = ~( (EvalToRowMajor ? 0 : RowMajorBit) | (ResultIsSparse ? 0 : SparseBit) ), |