Classes | Functions

OpenTissue::math::optimization::detail Namespace Reference

Classes

class  Bound2ConstraintFunctor
class  ConstantVectorBoundFunctor
class  ConstantValueBoundFunctor
class  MultibodyDynamicsBoundFunctor
class  ThetaFunctor
class  NablaThetaFunctor

Functions

template<typename T >
void compute_inverse_D (ublas::compressed_matrix< T > &D)
template<typename T , typename bound_function_type >
void compute_jacobian (ublas::compressed_matrix< T > const &A, bound_function_type const &l, bound_function_type const &u, ublas::vector< size_t > const &bitmask, ublas::compressed_matrix< T > &J)
template<typename T , typename bound_function_type >
void compute_partitioned_jacobian (ublas::compressed_matrix< T > const &A, bound_function_type const &l, bound_function_type const &u, ublas::vector< size_t > const &bitmask, ublas::vector< size_t > const &old2new, size_t const &cnt_active, size_t const &cnt_inactive, ublas::compressed_matrix< T > &A_aa, ublas::compressed_matrix< T > &A_ab, ublas::compressed_matrix< T > &C, ublas::compressed_matrix< T > &D)
template<typename vector_type , typename matrix_type >
void bfgs_update_inverse_hessian (vector_type const &y, vector_type const &s, matrix_type &H)

Function Documentation

template<typename vector_type , typename matrix_type >
void OpenTissue::math::optimization::detail::bfgs_update_inverse_hessian ( vector_type const &  y,
vector_type const &  s,
matrix_type H 
) [inline]

Inverse Hessian Update Formula.

H_k = B_k^{-1}, where B_k is the Hessian approximation in the k'th step.

The incremental update formula for the inverse Hessian is

\[H_{k+1} = (I - \rho s y^T) H_k (I - \rho y s^T) + \rho s s^T\]

template<typename T >
void OpenTissue::math::optimization::detail::compute_inverse_D ( ublas::compressed_matrix< T > &  D  )  [inline]

Compute D^{-1}.

Parameters:
D This argument holds a matrix with ones along the diagonal and non-zero values in the strict lower triangular part. The non-zero pattern is such that the inverse matrix is given by negating the strictly lower part of the matrix. Upon return the argument will hold the inverted matrix. Each row must only contain exactly one non-zero value besides the one stored in the diagonal.
template<typename T , typename bound_function_type >
void OpenTissue::math::optimization::detail::compute_jacobian ( ublas::compressed_matrix< T > const &  A,
bound_function_type const &  l,
bound_function_type const &  u,
ublas::vector< size_t > const &  bitmask,
ublas::compressed_matrix< T > &  J 
) [inline]

Compute Jacobian.

Parameters:
A The coefficient matrix of the linear equation y = A x + b
l A functor used to retrieve information about the lower bound function.
u A functor used to retrieve information about the upper bound function.
bitmask A bitmask. The i'th value is equal to ``in active'' (=4) if and only if y(i) (x(i) - lo(i)) && y(i) (x(i) - hi(i)) The i'th value is equal to ``in upper'' (=2) if and only if y(i) < (x(i) - hi(i)) The i'th value is equal to ``in lower'' (=1) if and only if y(i) > (x(i) - lo(i))
J Upon return this argument holds the value of the Jacobian matrix.
template<typename T , typename bound_function_type >
void OpenTissue::math::optimization::detail::compute_partitioned_jacobian ( ublas::compressed_matrix< T > const &  A,
bound_function_type const &  l,
bound_function_type const &  u,
ublas::vector< size_t > const &  bitmask,
ublas::vector< size_t > const &  old2new,
size_t const &  cnt_active,
size_t const &  cnt_inactive,
ublas::compressed_matrix< T > &  A_aa,
ublas::compressed_matrix< T > &  A_ab,
ublas::compressed_matrix< T > &  C,
ublas::compressed_matrix< T > &  D 
) [inline]

Compute Partitioned Jacobian.

Parameters:
A The coefficient matrix of the linear equation y = A x + b
l A functor used to retrieve information about the lower bound function.
u A functor used to retrieve information about the upper bound function.
bitmask A bitmask. The i'th value is equal to ``in active'' (=4) if and only if y(i) (x(i) - lo(i)) && y(i) (x(i) - hi(i)) The i'th value is equal to ``in upper'' (=2) if and only if y(i) < (x(i) - hi(i)) The i'th value is equal to ``in lower'' (=1) if and only if y(i) > (x(i) - lo(i))
old2new This vector holds an index permutation of old indices to new indices. The permutation is such that the first sub-block of the new vector corresponds to active constraints. The second corresponds to lower constraints and the last sub-block corresponds to the upper constraints set.
cnt_active This argument holds the total number of variables in the set of active constraints.
cnt_inactive This argument holds the total number of variables in the union of the set of lower and the set of upper constraints.
A_aa Upon return this argument holds the sub-block of reordered jacobian corresponding to the row and column sets (active,active).
A_ab Upon return this argument holds the sub-block of reordered jacobian corresponding to the row and column sets (active,inactive).
C Upon return this argument holds the sub-block of reordered jacobian corresponding to the row and column sets (inactive,active).
D Upon return this argument holds the sub-block of reordered jacobian corresponding to the row and column sets (inactive,inactive).