TMB Documentation  v1.9.1
TMBad/interpol.cpp
// Demonstrate 2D interpolation operator
#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
// Data for interpolation
DATA_VECTOR(x_range);
DATA_VECTOR(y_range);
// Test evaluation for theese values
interpol2D_config<Type> cfg(R);
interpol2D<Type> op(A, x_range, y_range, cfg);
vector<Type> f = op(x, y);
REPORT(f);
return f.sum();
}
License: GPL v2