![]() |
Prev | Next |
# include <cppad/example/code_gen_fun.hpp>
code_gen_fun fun_name()
code_gen_fun fun_name(file_name)
code_gen_fun fun_name(file_name, cg_fun)
code_gen_fun fun_name(file_name, cg_fun, eval_jac)
fun_name.swap(other_fun)
y = fun_name(x)
J = fun_name.jacobian(x)
Jrcv = fun_name.sparse_jacobian(x)
code_gen_fun::code_gen_fun(void)
code_gen_fun::code_gen_fun(const std::string& file_name )
code_gen_fun::code_gen_fun( const std::string& file_name , CppAD::ADFun< CppAD::cg::CG<double> >& cg_fun , evaluation_enum eval_jac )Operations
void code_gen_fun::swap(code_gen_fun& other_fun)
CppAD::vector<double> code_gen_fun::operator()(const CppAD::vector<double>& x)
CppAD::vector<double> code_gen_fun::jacobian(const CppAD::vector<double>& x)
CppAD::sparse_rcv< CppAD::vector<size_t>, CppAD::vector<double> > code_gen_fun::sparse_jacobian(const CppAD::vector<double>& x)
CppAD::cg::CG<double>
Base
type for the function
cg_fun
.
It is defined by
CppADCodeGen
.
and used to convert the
cg_fun
function object to source code,
compile the source code, and then link the corresponding function evaluation
y = cg_fun.Forward(0, x)
cppadcg_det_minor.cpp | cppadcg Speed: Gradient of Determinant by Minor Expansion |
cppadcg_sparse_jacobian.cpp | Cppadcg Speed: Sparse Jacobian |
code_gen_fun
object.
code_gen_fun
object.
cg_fun
is not present in the constructor,
it must have been present in a previous constructor with the same
file_name
.
eval_jac
are:
eval_jac
| Available Jacobian |
code_gen_fun::none_enum | none |
code_gen_fun::dense_enum |
fun_name.jacobian
|
eval_jac
is none.
fun_name
with the library in
other_fun
.
n
specifying the argument value
at which the function will be evaluated.
m
and is the value of
f(x)
.
m * n
and is the value of
the Jacobian
f'(x)
where
J[ i \cdot n + j ] = ( \partial f_i / \partial x_j ) (x)
code_gen_fun_function.cpp | Evaluate a Code Gen Function: Example and Test |
code_gen_fun_file.cpp | File Store and Retrieve a Code Gen Function: Example and Test |
code_gen_fun_jacobian.cpp | Evaluate Jacobian of a Code Gen Function: Example and Test |
code_gen_fun_jac_as_fun.cpp | Pass Jacobian as Code Gen Function: Example and Test |
code_gen_fun_sparse_jacobian.cpp | Evaluate Sparse Jacobian of a Code Gen Function: Example and Test |
code_gen_fun_sparse_jac_as_fun.cpp | Pass Sparse Jacobian as Code Gen Function: Example and Test |