TemplateKeyword_simple.cpp
Go to the documentation of this file.
1 #include <Eigen/Dense>
2 #include <iostream>
3 
4 using namespace Eigen;
5 
6 void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src)
7 {
8  dst.triangularView<Upper>() = src.triangularView<Upper>();
9 }
10 
11 int main()
12 {
13  MatrixXf m1 = MatrixXf::Ones(4,4);
14  MatrixXf m2 = MatrixXf::Random(4,4);
15  std::cout << "m2 before copy:" << std::endl;
16  std::cout << m2 << std::endl << std::endl;
18  std::cout << "m2 after copy:" << std::endl;
19  std::cout << m2 << std::endl << std::endl;
20 }
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::Upper
@ Upper
Definition: Constants.h:211
m1
Matrix3d m1
Definition: IOFormat.cpp:2
m2
MatrixType m2(n_dims)
copyUpperTriangularPart
void copyUpperTriangularPart(MatrixXf &dst, const MatrixXf &src)
Definition: TemplateKeyword_simple.cpp:6
main
int main()
Definition: TemplateKeyword_simple.cpp:11


gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:03:49