From 504a31f643468d05a10e3474b76a61e80022df59 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 18 Apr 2010 22:14:55 -0400 Subject: renaming (MatrixType ---> whatever appropriate) and documentation improvements --- Eigen/src/Core/CommaInitializer.h | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'Eigen/src/Core/CommaInitializer.h') diff --git a/Eigen/src/Core/CommaInitializer.h b/Eigen/src/Core/CommaInitializer.h index a312b40f5..adfca4f9a 100644 --- a/Eigen/src/Core/CommaInitializer.h +++ b/Eigen/src/Core/CommaInitializer.h @@ -36,38 +36,38 @@ * * \sa \ref MatrixBaseCommaInitRef "MatrixBase::operator<<", CommaInitializer::finished() */ -template +template struct CommaInitializer { - typedef typename ei_traits::Scalar Scalar; - inline CommaInitializer(MatrixType& mat, const Scalar& s) - : m_matrix(mat), m_row(0), m_col(1), m_currentBlockRows(1) + typedef typename ei_traits::Scalar Scalar; + inline CommaInitializer(XprType& xpr, const Scalar& s) + : m_xpr(xpr), m_row(0), m_col(1), m_currentBlockRows(1) { - m_matrix.coeffRef(0,0) = s; + m_xpr.coeffRef(0,0) = s; } template - inline CommaInitializer(MatrixType& mat, const DenseBase& other) - : m_matrix(mat), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows()) + inline CommaInitializer(XprType& xpr, const DenseBase& other) + : m_xpr(xpr), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows()) { - m_matrix.block(0, 0, other.rows(), other.cols()) = other; + m_xpr.block(0, 0, other.rows(), other.cols()) = other; } /* inserts a scalar value in the target matrix */ CommaInitializer& operator,(const Scalar& s) { - if (m_col==m_matrix.cols()) + if (m_col==m_xpr.cols()) { m_row+=m_currentBlockRows; m_col = 0; m_currentBlockRows = 1; - ei_assert(m_row CommaInitializer& operator,(const DenseBase& other) { - if (m_col==m_matrix.cols()) + if (m_col==m_xpr.cols()) { m_row+=m_currentBlockRows; m_col = 0; m_currentBlockRows = other.rows(); - ei_assert(m_row+m_currentBlockRows<=m_matrix.rows() + ei_assert(m_row+m_currentBlockRows<=m_xpr.rows() && "Too many rows passed to comma initializer (operator<<)"); } - ei_assert(m_col (m_row, m_col) = other; else - m_matrix.block(m_row, m_col, other.rows(), other.cols()) = other; + m_xpr.block(m_row, m_col, other.rows(), other.cols()) = other; m_col += other.cols(); return *this; } inline ~CommaInitializer() { - ei_assert((m_row+m_currentBlockRows) == m_matrix.rows() - && m_col == m_matrix.cols() + ei_assert((m_row+m_currentBlockRows) == m_xpr.rows() + && m_col == m_xpr.cols() && "Too few coefficients passed to comma initializer (operator<<)"); } @@ -110,9 +110,9 @@ struct CommaInitializer * quaternion.fromRotationMatrix((Matrix3f() << axis0, axis1, axis2).finished()); * \endcode */ - inline MatrixType& finished() { return m_matrix; } + inline XprType& finished() { return m_xpr; } - MatrixType& m_matrix; // target matrix + XprType& m_xpr; // target expression int m_row; // current row id int m_col; // current col id int m_currentBlockRows; // current block height -- cgit v1.2.3