aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h
diff options
context:
space:
mode:
Diffstat (limited to 'unsupported/Eigen/src/AutoDiff/AutoDiffVector.h')
-rw-r--r--unsupported/Eigen/src/AutoDiff/AutoDiffVector.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h b/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h
index c0765d494..9b9dbcc88 100644
--- a/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h
+++ b/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h
@@ -53,6 +53,7 @@ class AutoDiffVector
typedef AutoDiffScalar<Matrix<BaseScalar,JacobianType::RowsAtCompileTime,1> > ActiveScalar;
typedef ActiveScalar Scalar;
typedef AutoDiffScalar<typename JacobianType::ColXpr> CoeffType;
+ typedef typename JacobianType::Index Index;
inline AutoDiffVector() {}
@@ -63,16 +64,16 @@ class AutoDiffVector
}
- CoeffType operator[] (int i) { return CoeffType(m_values[i], m_jacobian.col(i)); }
- const CoeffType operator[] (int i) const { return CoeffType(m_values[i], m_jacobian.col(i)); }
+ CoeffType operator[] (Index i) { return CoeffType(m_values[i], m_jacobian.col(i)); }
+ const CoeffType operator[] (Index i) const { return CoeffType(m_values[i], m_jacobian.col(i)); }
- CoeffType operator() (int i) { return CoeffType(m_values[i], m_jacobian.col(i)); }
- const CoeffType operator() (int i) const { return CoeffType(m_values[i], m_jacobian.col(i)); }
+ CoeffType operator() (Index i) { return CoeffType(m_values[i], m_jacobian.col(i)); }
+ const CoeffType operator() (Index i) const { return CoeffType(m_values[i], m_jacobian.col(i)); }
- CoeffType coeffRef(int i) { return CoeffType(m_values[i], m_jacobian.col(i)); }
- const CoeffType coeffRef(int i) const { return CoeffType(m_values[i], m_jacobian.col(i)); }
+ CoeffType coeffRef(Index i) { return CoeffType(m_values[i], m_jacobian.col(i)); }
+ const CoeffType coeffRef(Index i) const { return CoeffType(m_values[i], m_jacobian.col(i)); }
- int size() const { return m_values.size(); }
+ Index size() const { return m_values.size(); }
// FIXME here we could return an expression of the sum
Scalar sum() const { /*std::cerr << "sum \n\n";*/ /*std::cerr << m_jacobian.rowwise().sum() << "\n\n";*/ return Scalar(m_values.sum(), m_jacobian.rowwise().sum()); }