10 C++ tutorial

10.0.1 I know R but not C++

Summary of how syntax differs between R and C++:

It is important to note the following difference compared to R:

Vectors, matrices and arrays are not zero-initialized in C++.

A zero initialized object is created using Eigens setZero():

matrix<Type> m(4,5);
m.setZero();

10.0.2 I know C++

TMB specific C++ include: - You should not use if(x) statements where x is a PARAMETER, or is derived from a variable of type PARAMETER. (It is OK to use if on DATA types, however.) TMB will remove the if(x) statement, so the code will produce unexpected results.