class_CwiseUnaryOp_ptrfun.cpp File Reference

Go to the source code of this file.

Functions

int main (int, char **)
 
double ramp (double x)
 

Function Documentation

◆ main()

int main ( int  ,
char **   
)

Definition at line 13 of file class_CwiseUnaryOp_ptrfun.cpp.

14 {
16  std::cout << m1 << std::endl << "becomes: " << std::endl << m1.unaryExpr(std::ptr_fun(ramp)) << std::endl;
17  return 0;
18 }
Matrix3d m1
Definition: IOFormat.cpp:2
static const RandomReturnType Random()
Definition: Random.h:114
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
double ramp(double x)

◆ ramp()

double ramp ( double  x)

Definition at line 5 of file class_CwiseUnaryOp_ptrfun.cpp.

6 {
7  if (x > 0)
8  return x;
9  else
10  return 0;
11 }