blob: 972a0ce3de2b29eb3e9c778cbfcab223017cca13 [file]
// SPDX-FileCopyrightText: The Eigen Authors
// SPDX-License-Identifier: MPL-2.0
#include <Eigen/Dense>
#include <iostream>
using Eigen::MatrixXf;
int main() {
MatrixXf m(2, 2);
MatrixXf n(2, 2);
MatrixXf result(2, 2);
m << 1, 2, 3, 4;
n << 5, 6, 7, 8;
result = (m.array() + 4).matrix() * m;
std::cout << "-- Combination 1: --\n" << result << "\n\n";
result = (m.array() * n.array()).matrix() * m;
std::cout << "-- Combination 2: --\n" << result << "\n\n";
}