Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
gtsam
3rdparty
Eigen
doc
examples
Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.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
(4);
9
10
mat << 1, 2, 6, 9,
11
3, 1, 7, 2;
12
13
v << 0,1,2,3;
14
15
//add v to each row of m
16
mat.rowwise() += v.transpose();
17
18
std::cout <<
"Broadcasting result: "
<< std::endl;
19
std::cout << mat << std::endl;
20
}
v
ArrayXcf v
Definition:
Cwise_arg.cpp:1
std
Definition:
Half.h:150
mat
MatrixXf mat
Definition:
Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
main
int main()
Definition:
Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp:5
gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:19