Eigen 3.4.90
doc
examples
Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include <
Eigen/Dense
>
3
4
using namespace
std
;
5
int
main
()
6
{
7
Eigen::MatrixXf
mat
(2,4);
8
Eigen::VectorXf
v
(2);
9
10
mat
<< 1, 2, 6, 9,
11
3, 1, 7, 2;
12
13
v
<< 0,
14
1;
15
16
//add v to each column of m
17
mat
.colwise() +=
v
;
18
19
std::cout <<
"Broadcasting result: "
<< std::endl;
20
std::cout <<
mat
<< std::endl;
21
}
v
Array< int, Dynamic, 1 > v
Definition:
Array_initializer_list_vector_cxx11.cpp:1
Dense
mat
MatrixXf mat
Definition:
Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
main
int main()
Definition:
Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp:5
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition:
Matrix.h:182
std
Definition:
BFloat16.h:222