7 template<
typename Scalar>
struct MakeComplexOp {
8 typedef std::complex<Scalar> result_type;
9 result_type
operator()(
const Scalar&
a,
const Scalar&
b)
const {
return result_type(
a,
b); }
14 Matrix4d m1 = Matrix4d::Random(),
m2 = Matrix4d::Random();
15 std::cout <<
m1.binaryExpr(
m2, MakeComplexOp<double>()) << std::endl;
IndexedView_or_Block operator()(const RowIndices &rowIndices, const ColIndices &colIndices)
Matrix< double, 4, 4 > Matrix4d
4×4 matrix of type double.