class_CwiseUnaryOp_ptrfun.cpp
Go to the documentation of this file.
1 #include <Eigen/Core>
2 #include <iostream>
3 using namespace Eigen;
4 using namespace std;
5 
6 // define function to be applied coefficient-wise
7 double ramp(double x)
8 {
9  if (x > 0)
10  return x;
11  else
12  return 0;
13 }
14 
15 int main(int, char**)
16 {
17  Matrix4d m1 = Matrix4d::Random();
18  cout << m1 << endl << "becomes: " << endl << m1.unaryExpr(ptr_fun(ramp)) << endl;
19  return 0;
20 }
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
main
int main(int, char **)
Definition: class_CwiseUnaryOp_ptrfun.cpp:15
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
m1
Matrix3d m1
Definition: IOFormat.cpp:2
std
Definition: BFloat16.h:88
ramp
double ramp(double x)
Definition: class_CwiseUnaryOp_ptrfun.cpp:7


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:15