Prev Next Index-> contents reference index search external Up-> CppAD ADFun abs_normal abs_eval CppAD-> Install Introduction AD ADFun preprocessor multi_thread utility ipopt_solve Example speed Appendix ADFun-> record_adfun drivers Forward Reverse sparsity_pattern sparse_derivative optimize abs_normal FunCheck check_for_nan abs_normal-> abs_normal_fun abs_print_mat abs_eval simplex_method lp_box abs_min_linear min_nso_linear qp_interior qp_box abs_min_quad min_nso_quad abs_eval-> abs_eval.cpp abs_eval.hpp Headings-> Syntax Prototype Source Purpose Vector f n m s g g_hat g_jac delta_x g_tilde Example

abs_normal: Evaluate First Order Approximation

Syntax
g_tilde = abs_eval(n, m, s, g_hat, g_jac, delta_x)

Prototype

template <class Vector>
Vector abs_eval(
size_t        n       ,
size_t        m       ,
size_t        s       ,
const Vector& g_hat   ,
const Vector& g_jac   ,
const Vector& delta_x )

Source
This following is a link to the source code for this example: abs_eval.hpp .

Purpose
Given a current that abs-normal representation at a point $\hat{x} \in \B{R}^n$, and a $\Delta x \in \B{R}^n$, this routine evaluates the abs-normal approximation for f(x) where $x = \hat{x} + \Delta x$.

Vector
The type Vector is a simple vector with elements of type double.

f
We use the notation f for the original function; see f .

n
This is the dimension of the domain space for f ; see n .

m
This is the dimension of the range space for f ; see m .

s
This is the number of absolute value terms in f ; see

g
We use the notation g for the abs-normal representation of f ; see g .

g_hat
This vector has size m + s and is the value of g(x, u) at $x = \hat{x}$ and $u = a( \hat{x} )$.

g_jac
This vector has size (m + s) * (n + s) and is the Jacobian of $g(x, u)$ at $x = \hat{x}$ and $u = a( \hat{x} )$.

delta_x
This vector has size n and is the difference $\Delta x = x - \hat{x}$, where $x$ is the point that we are approximating $f(x)$.

g_tilde
This vector has size m + s and is a the first order approximation for g that corresponds to the point $x = \hat{x} + \Delta x$ and $u = a(x)$.

Example
The file abs_eval.cpp contains an example and test of abs_eval. It returns true if the test passes and false otherwise.
Input File: example/abs_normal/abs_eval.hpp