aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-07-16 09:49:01 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-07-16 09:49:01 +0200
commitadeaa657eb54739e0ed2641f8e94b2edb855a586 (patch)
tree00180e7fd3def96807c95ab645b48318be05dd17 /Eigen/src/SparseCore
parentf2aba7a768477aa8128a15093706d39d1b274b78 (diff)
Expose InnerSizeAtCompileTime in SparseMatrixBase (it was already present in DenseBase) and simplify sparse_vector_assign_selector (this also fix a stupid warning in old gcc versions)
Diffstat (limited to 'Eigen/src/SparseCore')
-rw-r--r--Eigen/src/SparseCore/SparseMatrixBase.h3
-rw-r--r--Eigen/src/SparseCore/SparseVector.h5
2 files changed, 5 insertions, 3 deletions
diff --git a/Eigen/src/SparseCore/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h
index 90fee01bc..89ace19e5 100644
--- a/Eigen/src/SparseCore/SparseMatrixBase.h
+++ b/Eigen/src/SparseCore/SparseMatrixBase.h
@@ -89,6 +89,9 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
*/
IsRowMajor = Flags&RowMajorBit ? 1 : 0,
+
+ InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
+ : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
#ifndef EIGEN_PARSED_BY_DOXYGEN
_HasDirectAccess = (int(Flags)&DirectAccessBit) ? 1 : 0 // workaround sunCC
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h
index 6e7235007..7e15c814b 100644
--- a/Eigen/src/SparseCore/SparseVector.h
+++ b/Eigen/src/SparseCore/SparseVector.h
@@ -55,9 +55,8 @@ enum {
template< typename Dest, typename Src,
int AssignmentKind = !bool(Src::IsVectorAtCompileTime) ? SVA_RuntimeSwitch
- : (((Src::Flags&RowMajorBit)==RowMajorBit) && (Src::RowsAtCompileTime==1))
- || ((((Src::Flags&RowMajorBit)==0) && (Src::ColsAtCompileTime==1))) ? SVA_Inner
- : SVA_Outer>
+ : Src::InnerSizeAtCompileTime==1 ? SVA_Outer
+ : SVA_Inner>
struct sparse_vector_assign_selector;
}