mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-20 16:49:38 +08:00
22 lines
409 B
C++
22 lines
409 B
C++
#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";
|
|
}
|