Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::CommaInitializer< XprType > Class Template Reference

Helper class used by the comma initializer operator. More...

#include <src/eigen/Eigen/src/Core/CommaInitializer.h>

Public Types

typedef XprType::Scalar Scalar
 

Public Member Functions

EIGEN_DEVICE_FUNC CommaInitializer (XprType &xpr, const Scalar &s)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC CommaInitializer (XprType &xpr, const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC CommaInitializer (const CommaInitializer &o)
 
EIGEN_DEVICE_FUNC CommaInitializeroperator, (const Scalar &s)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC CommaInitializeroperator, (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC ~CommaInitializer ()
 
EIGEN_DEVICE_FUNC XprType & finished ()
 

Public Attributes

XprType & m_xpr
 
Index m_row
 
Index m_col
 
Index m_currentBlockRows
 

Detailed Description

template<typename XprType>
class Eigen::CommaInitializer< XprType >

Helper class used by the comma initializer operator.

This class is internally used to implement the comma initializer feature. It is the return type of MatrixBase::operator<<, and most of the time this is the only way it is used.

See also
\blank MatrixBase::operator<<, CommaInitializer::finished()

Member Typedef Documentation

◆ Scalar

template<typename XprType >
typedef XprType::Scalar Eigen::CommaInitializer< XprType >::Scalar

Constructor & Destructor Documentation

◆ CommaInitializer() [1/3]

template<typename XprType >
EIGEN_DEVICE_FUNC Eigen::CommaInitializer< XprType >::CommaInitializer ( XprType &  xpr,
const Scalar s 
)
inline
34 : m_xpr(xpr), m_row(0), m_col(1), m_currentBlockRows(1)
35 {
36 m_xpr.coeffRef(0,0) = s;
37 }
XprType & m_xpr
Definition CommaInitializer.h:124
Index m_currentBlockRows
Definition CommaInitializer.h:127
Index m_col
Definition CommaInitializer.h:126
Index m_row
Definition CommaInitializer.h:125

References Eigen::CommaInitializer< XprType >::m_xpr.

◆ CommaInitializer() [2/3]

template<typename XprType >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::CommaInitializer< XprType >::CommaInitializer ( XprType &  xpr,
const DenseBase< OtherDerived > &  other 
)
inline
42 : m_xpr(xpr), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows())
43 {
44 m_xpr.block(0, 0, other.rows(), other.cols()) = other;
45 }

References Eigen::CommaInitializer< XprType >::m_xpr.

◆ CommaInitializer() [3/3]

template<typename XprType >
EIGEN_DEVICE_FUNC Eigen::CommaInitializer< XprType >::CommaInitializer ( const CommaInitializer< XprType > &  o)
inline
52 : m_xpr(o.m_xpr), m_row(o.m_row), m_col(o.m_col), m_currentBlockRows(o.m_currentBlockRows) {
53 // Mark original object as finished. In absence of R-value references we need to const_cast:
54 const_cast<CommaInitializer&>(o).m_row = m_xpr.rows();
55 const_cast<CommaInitializer&>(o).m_col = m_xpr.cols();
56 const_cast<CommaInitializer&>(o).m_currentBlockRows = 0;
57 }
EIGEN_DEVICE_FUNC CommaInitializer(XprType &xpr, const Scalar &s)
Definition CommaInitializer.h:33

References Eigen::CommaInitializer< XprType >::m_col, Eigen::CommaInitializer< XprType >::m_currentBlockRows, Eigen::CommaInitializer< XprType >::m_row, and Eigen::CommaInitializer< XprType >::m_xpr.

◆ ~CommaInitializer()

template<typename XprType >
EIGEN_DEVICE_FUNC Eigen::CommaInitializer< XprType >::~CommaInitializer ( )
inline
105 {
106 finished();
107 }
EIGEN_DEVICE_FUNC XprType & finished()
Definition CommaInitializer.h:117

References Eigen::CommaInitializer< XprType >::finished().

+ Here is the call graph for this function:

Member Function Documentation

◆ finished()

template<typename XprType >
EIGEN_DEVICE_FUNC XprType & Eigen::CommaInitializer< XprType >::finished ( )
inline
Returns
the built matrix once all its coefficients have been set. Calling finished is 100% optional. Its purpose is to write expressions like this:
quaternion.fromRotationMatrix((Matrix3f() << axis0, axis1, axis2).finished());
117 {
118 eigen_assert(((m_row+m_currentBlockRows) == m_xpr.rows() || m_xpr.cols() == 0)
119 && m_col == m_xpr.cols()
120 && "Too few coefficients passed to comma initializer (operator<<)");
121 return m_xpr;
122 }
#define eigen_assert(x)
Definition Macros.h:579

References eigen_assert, Eigen::CommaInitializer< XprType >::m_col, Eigen::CommaInitializer< XprType >::m_currentBlockRows, Eigen::CommaInitializer< XprType >::m_row, and Eigen::CommaInitializer< XprType >::m_xpr.

Referenced by Eigen::CommaInitializer< XprType >::~CommaInitializer().

+ Here is the caller graph for this function:

◆ operator,() [1/2]

template<typename XprType >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC CommaInitializer & Eigen::CommaInitializer< XprType >::operator, ( const DenseBase< OtherDerived > &  other)
inline
82 {
83 if (m_col==m_xpr.cols() && (other.cols()!=0 || other.rows()!=m_currentBlockRows))
84 {
86 m_col = 0;
87 m_currentBlockRows = other.rows();
89 && "Too many rows passed to comma initializer (operator<<)");
90 }
91 eigen_assert((m_col + other.cols() <= m_xpr.cols())
92 && "Too many coefficients passed to comma initializer (operator<<)");
93 eigen_assert(m_currentBlockRows==other.rows());
94 m_xpr.template block<OtherDerived::RowsAtCompileTime, OtherDerived::ColsAtCompileTime>
95 (m_row, m_col, other.rows(), other.cols()) = other;
96 m_col += other.cols();
97 return *this;
98 }

References eigen_assert, Eigen::CommaInitializer< XprType >::m_col, Eigen::CommaInitializer< XprType >::m_currentBlockRows, Eigen::CommaInitializer< XprType >::m_row, and Eigen::CommaInitializer< XprType >::m_xpr.

◆ operator,() [2/2]

template<typename XprType >
EIGEN_DEVICE_FUNC CommaInitializer & Eigen::CommaInitializer< XprType >::operator, ( const Scalar s)
inline
62 {
63 if (m_col==m_xpr.cols())
64 {
66 m_col = 0;
69 && "Too many rows passed to comma initializer (operator<<)");
70 }
72 && "Too many coefficients passed to comma initializer (operator<<)");
74 m_xpr.coeffRef(m_row, m_col++) = s;
75 return *this;
76 }

References eigen_assert, Eigen::CommaInitializer< XprType >::m_col, Eigen::CommaInitializer< XprType >::m_currentBlockRows, Eigen::CommaInitializer< XprType >::m_row, and Eigen::CommaInitializer< XprType >::m_xpr.

Member Data Documentation

◆ m_col

◆ m_currentBlockRows

◆ m_row

◆ m_xpr


The documentation for this class was generated from the following file: