Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
CppAD documentation
CppAD documentation
  • search
  • index
  • contents
  • user_guide
    • Install
      • download
      • cmake
        • get_optional.sh
          • get_adolc.sh
          • get_cppadcg.sh
          • get_colpack.sh
          • get_fadbad.sh
          • get_ipopt.sh
          • get_sacado.sh
        • adolc
        • eigen
        • cppadcg
        • ipopt
        • fadbad_prefix
        • sacado_prefix
        • colpack_prefix
          • colpack_jac.cpp
          • colpack_jacobian.cpp
          • colpack_hes.cpp
          • colpack_hessian.cpp
        • cppad_testvector
      • cmake_check
      • pkgconfig
      • dos_build.bat
    • Theory
      • Introduction
        • exp_2
          • exp_2.hpp
          • exp_2.cpp
          • exp_2_for0
            • exp_2_for0.cpp
          • exp_2_for1
            • exp_2_for1.cpp
          • exp_2_rev1
            • exp_2_rev1.cpp
          • exp_2_for2
            • exp_2_for2.cpp
          • exp_2_rev2
            • exp_2_rev2.cpp
          • exp_2_cppad
        • exp_eps
          • exp_eps.hpp
          • exp_eps.cpp
          • exp_eps_for0
            • exp_eps_for0.cpp
          • exp_eps_for1
            • exp_eps_for1.cpp
          • exp_eps_rev1
            • exp_eps_rev1.cpp
          • exp_eps_for2
            • exp_eps_for2.cpp
          • exp_eps_rev2
            • exp_eps_rev2.cpp
          • exp_eps_cppad
        • exp_apx.cpp
      • forward_theory
        • exp_forward
        • log_forward
        • sqrt_forward
        • sin_cos_forward
        • atan_forward
        • asin_forward
        • acos_forward
        • pow_forward
        • tan_forward
        • erf_forward
      • reverse_theory
        • exp_reverse
        • log_reverse
        • sqrt_reverse
        • sin_cos_reverse
        • atan_reverse
        • asin_reverse
        • acos_reverse
        • tan_reverse
        • erf_reverse
        • pow_reverse
      • reverse_identity
      • taylor_ode
        • taylor_ode.cpp
      • research
    • AD
      • ad_ctor
        • ad_ctor.cpp
      • ad_assign
        • ad_assign.cpp
      • Convert
        • Value
          • value.cpp
        • Integer
          • integer.cpp
        • ad_to_string
        • ad_input
          • ad_input.cpp
        • ad_output
          • ad_output.cpp
        • PrintFor
          • print_for_cout.cpp
          • print_for_string.cpp
        • Var2Par
          • var2par.cpp
      • ADValued
        • Arithmetic
          • unary_plus
            • unary_plus.cpp
          • unary_minus
            • unary_minus.cpp
          • ad_binary
            • add.cpp
            • sub.cpp
            • mul.cpp
            • div.cpp
          • compound_assign
            • add_eq.cpp
            • sub_eq.cpp
            • mul_eq.cpp
            • div_eq.cpp
        • unary_standard_math
          • acos
            • acos.cpp
          • acosh
            • acosh.cpp
          • asin
            • asin.cpp
          • asinh
            • asinh.cpp
          • atan
            • atan.cpp
          • atanh
            • atanh.cpp
          • cos
            • cos.cpp
          • cosh
            • cosh.cpp
          • erf
            • erf.cpp
          • erfc
            • erfc.cpp
          • exp
            • exp.cpp
          • expm1
            • expm1.cpp
          • log
            • log.cpp
          • log1p
            • log1p.cpp
          • log10
            • log10.cpp
          • sin
            • sin.cpp
          • sinh
            • sinh.cpp
          • sqrt
            • sqrt.cpp
          • tan
            • tan.cpp
          • tanh
            • tanh.cpp
          • abs
            • fabs.cpp
          • sign
            • sign.cpp
        • binary_math
          • atan2
            • atan2.cpp
          • pow
            • pow.cpp
            • pow_nan.cpp
          • azmul
            • azmul.cpp
        • CondExp
          • cond_exp.cpp
        • Discrete
          • tape_index.cpp
          • interp_onetape.cpp
          • interp_retape.cpp
        • numeric_limits
          • num_limits.cpp
        • atomic
          • atomic_four
            • atomic_four_define
              • atomic_four_ctor
              • atomic_four_call
              • atomic_four_for_type
              • atomic_four_forward
              • atomic_four_reverse
              • atomic_four_jac_sparsity
              • atomic_four_hes_sparsity
              • atomic_four_rev_depend
            • atomic_four_example
              • atomic_four_get_started.cpp
              • atomic_four_norm_sq.cpp
              • atomic_four_bilinear.cpp
              • atomic_four_forward.cpp
              • atomic_four_dynamic.cpp
              • atomic_four_vector
                • atomic_four_vector_add.cpp
                • atomic_four_vector_div.cpp
                • atomic_four_vector_hes_sparsity.cpp
                • atomic_four_vector_jac_sparsity.cpp
                • atomic_four_vector_mul.cpp
                • atomic_four_vector_neg.cpp
                • atomic_four_vector_rev_depend.cpp
                • atomic_four_vector_sub.cpp
                • atomic_four_vector_implement
                  • atomic_four_vector.hpp
                  • atomic_four_vector_forward_op.hpp
                  • atomic_four_vector_reverse_op.hpp
                  • atomic_four_vector_jac_sparsity.hpp
                  • atomic_four_vector_hes_sparsity.hpp
                  • atomic_four_vector_for_type.hpp
                  • atomic_four_vector_rev_depend.hpp
                  • atomic_four_vector_add_op.hpp
                  • atomic_four_vector_sub_op.hpp
                  • atomic_four_vector_mul_op.hpp
                  • atomic_four_vector_div_op.hpp
                  • atomic_four_vector_neg_op.hpp
              • atomic_four_mat_mul
                • atomic_four_mat_mul_implement
                  • atomic_four_mat_mul.hpp
                  • atomic_four_mat_mul_set.hpp
                  • atomic_four_mat_mul_get.hpp
                  • atomic_four_mat_mul_base_mat_mul.hpp
                  • atomic_four_mat_mul_for_type.hpp
                  • atomic_four_mat_mul_forward.hpp
                  • atomic_four_mat_mul_reverse.hpp
                  • atomic_four_mat_mul_jac_sparsity.hpp
                  • atomic_four_mat_mul_hes_sparsity.hpp
                  • atomic_four_mat_mul_rev_depend.hpp
                • atomic_four_mat_mul_forward.cpp
                • atomic_four_mat_mul_reverse.cpp
                • atomic_four_mat_mul_sparsity.cpp
                • atomic_four_mat_mul_rev_depend.cpp
                • atomic_four_mat_mul_identical_zero.cpp
              • atomic_four_lin_ode
                • atomic_four_lin_ode_implement
                  • atomic_four_lin_ode.hpp
                  • atomic_four_lin_ode_set.hpp
                  • atomic_four_lin_ode_get.hpp
                  • atomic_four_lin_ode_base_solver.hpp
                  • atomic_four_lin_ode_for_type.hpp
                  • atomic_four_lin_ode_forward.hpp
                  • atomic_four_lin_ode_reverse.hpp
                    • atomic_four_lin_ode_reverse_2
                  • atomic_four_lin_ode_jac_sparsity.hpp
                  • atomic_four_lin_ode_hes_sparsity.hpp
                  • atomic_four_lin_ode_rev_depend.hpp
                • atomic_four_lin_ode_forward.cpp
                • atomic_four_lin_ode_reverse.cpp
                • atomic_four_lin_ode_sparsity.cpp
                • atomic_four_lin_ode_rev_depend.cpp
          • atomic_three
            • atomic_three_define
              • atomic_three_ctor
              • atomic_three_afun
              • atomic_three_for_type
              • atomic_three_forward
                • atomic_three_forward.cpp
                • atomic_three_dynamic.cpp
              • atomic_three_reverse
                • atomic_three_reverse.cpp
              • atomic_three_jac_sparsity
                • atomic_three_jac_sparsity.cpp
              • atomic_three_hes_sparsity
                • atomic_three_hes_sparsity.cpp
              • atomic_three_rev_depend
                • atomic_three_rev_depend.cpp
            • atomic_three_example
              • atomic_three_get_started.cpp
              • atomic_three_norm_sq.cpp
              • atomic_three_tangent.cpp
              • atomic_three_base2ad.cpp
              • atomic_three_reciprocal.cpp
              • atomic_three_mat_mul.cpp
                • atomic_three_mat_mul.hpp
          • chkpoint_two
            • chkpoint_two_ctor
            • chkpoint_two_chk_fun
            • chkpoint_two_dynamic
            • chkpoint_two_get_started.cpp
            • chkpoint_two_compare.cpp
            • chkpoint_two_base2ad.cpp
            • chkpoint_two_dynamic.cpp
            • chkpoint_two_ode.cpp
      • bool_valued
        • Compare
          • compare.cpp
        • near_equal_ext
          • near_equal_ext.cpp
        • bool_fun
          • bool_fun.cpp
        • con_dyn_var
          • con_dyn_var.cpp
        • EqualOpSeq
          • equal_op_seq.cpp
      • VecAD
        • vec_ad.cpp
      • base_require
        • base_member
        • base_cond_exp
        • base_identical
        • base_ordered
        • base_std_math
        • base_limits
        • base_to_string
        • base_hash
        • base_example
          • base_alloc.hpp
          • base_require.cpp
          • base_adolc.hpp
            • mul_level_adolc.cpp
          • valvector
            • valvector_ctor
              • valvector_ctor.cpp
            • valvector_resize
              • valvector_resize.cpp
            • valvector_assign
              • valvector_assign.cpp
            • valvector_size
              • valvector_size.cpp
            • valvector_sum
              • valvector_sum.cpp
            • valvector_element
              • valvector_element.cpp
            • valvector_unary_op
              • valvector_unary_op.cpp
            • valvector_binary_op
              • valvector_binary_op.cpp
            • valvector_compound_op
              • valvector_compound_op.cpp
            • valvector_compare_op
              • valvector_compare_op.cpp
            • valvector_output
              • valvector_output.cpp
            • valvector_unary_math
              • valvector_unary_math.cpp
            • valvector_pow
              • valvector_pow.cpp
            • valvector_azmul
              • valvector_azmul.cpp
            • valvector_condexp
              • valvector_condexp.cpp
            • valvector_base_require
              • valvector_base_require.cpp
            • valvector_ad_split
              • valvector_ad_split.cpp
            • valvector_ad_join
              • valvector_ad_join.cpp
            • valvector_ad_sum
              • valvector_ad_sum.cpp
            • valvector_get_started.cpp
            • valvector_llsq_obj.cpp
          • base_float.hpp
          • base_double.hpp
          • base_complex.hpp
            • complex_poly.cpp
    • ADFun
      • record_adfun
        • Independent
          • independent.cpp
        • fun_construct
          • fun_assign.cpp
        • Dependent
        • abort_recording
          • abort_recording.cpp
        • fun_property
          • fun_property.cpp
        • function_name
          • function_name.cpp
      • other_adfun
        • base2ad
          • base2ad.cpp
          • base2vec_ad.cpp
        • json_ad_graph
          • json_graph_op
            • json_unary_op.cpp
            • json_add_op.cpp
            • json_azmul_op.cpp
            • json_div_op.cpp
            • json_mul_op.cpp
            • json_pow_op.cpp
            • json_sub_op.cpp
            • json_sum_op.cpp
            • json_cexp_op.cpp
            • json_comp_op.cpp
            • json_discrete_op.cpp
            • json_atom_op.cpp
            • json_atom4_op.cpp
            • json_print_op.cpp
          • from_json
            • from_json.cpp
          • to_json
            • to_json.cpp
          • json_get_started.cpp
          • json_sparse.cpp
        • cpp_ad_graph
          • graph_op_enum
            • graph_azmul_op.cpp
            • graph_add_op.cpp
            • graph_div_op.cpp
            • graph_mul_op.cpp
            • graph_pow_op.cpp
            • graph_sub_op.cpp
            • graph_unary_op.cpp
            • graph_sum_op.cpp
            • graph_comp_op.cpp
            • graph_cexp_op.cpp
            • graph_discrete_op.cpp
            • graph_atom_op.cpp
            • graph_atom4_op.cpp
            • graph_print_op.cpp
          • cpp_graph
            • cpp_graph_ctor
            • cpp_graph_scalar
            • cpp_graph_vector
            • cpp_graph_print
              • print_graph.cpp
          • from_graph
            • switch_var_dyn.cpp
          • to_graph
        • abs_normal_fun
          • example_abs_normal
            • abs_get_started.cpp
            • abs_print_mat
            • abs_eval
              • abs_eval.cpp
              • abs_eval.hpp
            • simplex_method
              • simplex_method.cpp
              • simplex_method.hpp
            • lp_box
              • lp_box.cpp
              • lp_box.hpp
            • abs_min_linear
              • abs_min_linear.cpp
              • abs_min_linear.hpp
            • min_nso_linear
              • min_nso_linear.cpp
              • min_nso_linear.hpp
            • qp_interior
              • qp_interior.cpp
              • qp_interior.hpp
            • qp_box
              • qp_box.cpp
              • qp_box.hpp
            • abs_min_quad
              • abs_min_quad.cpp
              • abs_min_quad.hpp
            • min_nso_quad
              • min_nso_quad.cpp
              • min_nso_quad.hpp
      • drivers
        • Jacobian
          • jacobian.cpp
        • Hessian
          • hessian.cpp
          • hes_lagrangian.cpp
        • ForOne
          • for_one.cpp
        • RevOne
          • rev_one.cpp
        • ForTwo
          • for_two.cpp
        • RevTwo
          • rev_two.cpp
      • Forward
        • new_dynamic
          • new_dynamic.cpp
        • forward_zero
        • forward_one
        • forward_two
        • forward_order
          • forward.cpp
          • forward_order.cpp
        • forward_dir
          • forward_dir.cpp
        • size_order
        • compare_change
          • compare_change.cpp
        • capacity_order
          • capacity_order.cpp
        • number_skip
          • number_skip.cpp
      • Reverse
        • reverse_one
          • reverse_one.cpp
        • reverse_two
          • reverse_two.cpp
          • hes_times_dir.cpp
        • reverse_any
          • reverse_three.cpp
          • rev_checkpoint.cpp
        • subgraph_reverse
          • subgraph_reverse.cpp
      • sparsity_pattern
        • for_jac_sparsity
          • for_jac_sparsity.cpp
        • rev_jac_sparsity
          • rev_jac_sparsity.cpp
        • for_hes_sparsity
          • for_hes_sparsity.cpp
        • rev_hes_sparsity
          • rev_hes_sparsity.cpp
        • subgraph_sparsity
          • subgraph_sparsity.cpp
        • dependency.cpp
        • rc_sparsity.cpp
        • ForSparseJac
          • for_sparse_jac.cpp
        • RevSparseJac
          • rev_sparse_jac.cpp
        • RevSparseHes
          • rev_sparse_hes.cpp
          • sparsity_sub.cpp
        • ForSparseHes
          • for_sparse_hes.cpp
      • sparse_derivative
        • sparse_jac
          • sparse_jac_for.cpp
          • sparse_jac_rev.cpp
        • sparse_jacobian
          • sparse_jacobian.cpp
        • sparse_hes
          • sparse_hes.cpp
        • sparse_hessian
          • sparse_hessian.cpp
          • sub_sparse_hes.cpp
          • sparse_sub_hes.cpp
        • subgraph_jac_rev
          • subgraph_jac_rev.cpp
          • subgraph_hes2jac.cpp
      • optimize
        • optimize_twice.cpp
        • optimize_forward_active.cpp
        • optimize_reverse_active.cpp
        • optimize_compare_op.cpp
        • optimize_print_for.cpp
        • optimize_conditional_skip.cpp
        • optimize_nest_conditional.cpp
        • optimize_cumulative_sum.cpp
      • FunCheck
        • fun_check.cpp
      • check_for_nan
        • check_for_nan.cpp
      • to_csrc
        • example_jit
          • jit_get_started.cpp
          • jit_compare_change.cpp
          • jit_compile.cpp
          • jit_atomic.cpp
          • jit_dynamic.cpp
    • preprocessor
    • multi_thread
      • parallel_ad
      • thread_test.cpp
        • a11c_openmp.cpp
        • a11c_bthread.cpp
        • a11c_pthread.cpp
        • a11c_sthread.cpp
        • openmp_get_started.cpp
        • bthread_get_started.cpp
        • pthread_get_started.cpp
        • sthread_get_started.cpp
        • team_example.cpp
        • harmonic.cpp
          • harmonic_common
          • harmonic_setup
          • harmonic_worker
          • harmonic_takedown
          • harmonic_sum
          • harmonic_time
        • multi_atomic_three.cpp
          • multi_atomic_three_user
          • multi_atomic_three_common
          • multi_atomic_three_setup
          • multi_atomic_three_worker
          • multi_atomic_three_takedown
          • multi_atomic_three_run
          • multi_atomic_three_time
        • multi_chkpoint_two.cpp
          • multi_chkpoint_two_algo
          • multi_chkpoint_two_common
          • multi_chkpoint_two_setup
          • multi_chkpoint_two_worker
          • multi_chkpoint_two_takedown
          • multi_chkpoint_two_run
          • multi_chkpoint_two_time
        • multi_newton.cpp
          • multi_newton_common
          • multi_newton_setup
          • multi_newton_worker
          • multi_newton_takedown
          • multi_newton_run
          • multi_newton_time
        • team_thread.hpp
          • team_openmp.cpp
          • team_bthread.cpp
          • team_pthread.cpp
          • team_sthread.cpp
    • utility
      • CheckNumericType
        • check_numeric_type.cpp
      • CheckSimpleVector
        • check_simple_vector.cpp
      • create_dll_lib
      • ErrorHandler
        • error_handler.cpp
        • cppad_assert
      • index_sort
        • index_sort.cpp
      • link_dll_lib
        • dll_lib.cpp
      • nan
        • nan.cpp
      • NearEqual
        • near_equal.cpp
      • OdeErrControl
        • ode_err_control.cpp
        • ode_err_maxabs.cpp
      • OdeGear
        • ode_gear.cpp
      • OdeGearControl
        • ode_gear_control.cpp
      • Poly
        • poly.cpp
        • poly.hpp
      • pow_int
        • pow_int.cpp
      • RombergMul
        • romberg_mul.cpp
      • RombergOne
        • romberg_one.cpp
      • Rosen34
        • rosen_34.cpp
      • Runge45
        • runge45_1.cpp
        • runge_45.cpp
      • set_union
        • set_union.cpp
      • sparse2eigen
        • sparse2eigen.cpp
      • sparse_rc
        • sparse_rc.cpp
      • sparse_rcv
        • sparse_rcv.cpp
      • speed_test
        • speed_test.cpp
      • SpeedTest
        • speed_program.cpp
      • test_boolofvoid
      • time_test
        • elapsed_seconds
          • elapsed_seconds.cpp
        • time_test.cpp
      • to_string
        • to_string.cpp
      • CppAD_vector
        • cppad_vector.cpp
        • vector_bool.cpp
      • lu_det_and_solve
        • LuSolve
          • lu_solve.cpp
          • lu_solve.hpp
        • LuFactor
          • lu_factor.cpp
          • lu_factor.hpp
        • LuInvert
          • lu_invert.cpp
          • lu_invert.hpp
      • NumericType
        • numeric_type.cpp
      • SimpleVector
        • simple_vector.cpp
      • thread_alloc
        • thread_alloc.cpp
        • ta_parallel_setup
        • ta_num_threads
        • ta_in_parallel
        • ta_thread_num
        • ta_get_memory
        • ta_return_memory
        • ta_free_available
        • ta_hold_memory
        • ta_inuse
        • ta_available
        • ta_create_array
        • ta_delete_array
        • ta_free_all
    • ipopt_solve
      • ipopt_solve_get_started.cpp
      • ipopt_solve_retape.cpp
      • ipopt_solve_ode_inverse.cpp
    • Example
      • get_started.cpp
      • list_all_examples
      • General
        • ad_fun.cpp
        • ad_in_c.cpp
        • conj_grad.cpp
        • cppad_eigen.hpp
          • eigen_plugin.hpp
          • eigen_array.cpp
          • eigen_det.cpp
        • hes_minor_det.cpp
        • hes_lu_det.cpp
        • interface2c.cpp
        • jac_minor_det.cpp
        • jac_lu_det.cpp
        • mul_level
          • mul_level.cpp
          • change_param.cpp
        • ode_stiff.cpp
        • mul_level_ode.cpp
        • mul_level_adolc_ode.cpp
        • stack_machine.cpp
        • code_gen_fun
          • code_gen_fun_function.cpp
          • code_gen_fun_file.cpp
          • code_gen_fun_jacobian.cpp
          • code_gen_fun_jac_as_fun.cpp
          • code_gen_fun_sparse_jacobian.cpp
          • code_gen_fun_sparse_jac_as_fun.cpp
        • code_gen_fun.hpp
        • code_gen_fun.cpp
      • example_driver
        • abs_normal.cpp
        • atomic_four.cpp
        • atomic_three.cpp
        • atomic_two.cpp
        • chkpoint_two.cpp
        • cppad_code_gen.cpp
        • general.cpp
        • lu_vec_ad.cpp
          • lu_vec_ad_ok.cpp
        • graph.cpp
        • ipopt_solve.cpp
        • jit.cpp
        • json.cpp
        • optimize.cpp
        • sparse.cpp
        • utility.cpp
        • valvector.cpp
        • speed_example.cpp
      • testvector
      • wno_conversion
    • speed
      • speed_main
        • link_routines
          • link_det_lu
          • link_det_minor
          • link_mat_mul
          • link_ode
          • link_poly
          • link_sparse_hessian
          • link_sparse_jacobian
      • speed_utility
        • det_by_lu
          • det_by_lu.cpp
          • det_by_lu.hpp
        • det_of_minor
          • det_of_minor.cpp
          • det_of_minor.hpp
        • det_by_minor
          • det_by_minor.cpp
          • det_by_minor.hpp
        • det_33
          • det_33.hpp
        • det_grad_33
          • det_grad_33.hpp
        • mat_sum_sq
          • mat_sum_sq.cpp
          • mat_sum_sq.hpp
        • ode_evaluate
          • ode_evaluate.cpp
          • ode_evaluate.hpp
        • sparse_jac_fun
          • sparse_jac_fun.cpp
          • sparse_jac_fun.hpp
        • sparse_hes_fun
          • sparse_hes_fun.cpp
          • sparse_hes_fun.hpp
        • uniform_01
          • uniform_01.hpp
      • speed_double
        • double_det_minor.cpp
        • double_det_lu.cpp
        • double_mat_mul.cpp
        • double_ode.cpp
        • double_poly.cpp
        • double_sparse_hessian.cpp
        • double_sparse_jacobian.cpp
      • speed_adolc
        • adolc_det_minor.cpp
        • adolc_det_lu.cpp
        • adolc_mat_mul.cpp
        • adolc_ode.cpp
        • adolc_poly.cpp
        • adolc_sparse_hessian.cpp
        • adolc_sparse_jacobian.cpp
        • adolc_alloc_mat
      • speed_cppad
        • cppad_det_minor.cpp
        • cppad_det_lu.cpp
        • cppad_mat_mul.cpp
        • cppad_ode.cpp
        • cppad_poly.cpp
        • cppad_sparse_hessian.cpp
        • cppad_sparse_jacobian.cpp
      • speed_fadbad
        • fadbad_det_minor.cpp
        • fadbad_det_lu.cpp
        • fadbad_mat_mul.cpp
        • fadbad_ode.cpp
        • fadbad_poly.cpp
        • fadbad_sparse_hessian.cpp
        • fadbad_sparse_jacobian.cpp
      • speed_cppad_jit
        • cppad_jit_det_minor.cpp
        • cppad_jit_det_lu.cpp
        • cppad_jit_mat_mul.cpp
        • cppad_jit_ode.cpp
        • cppad_jit_poly.cpp
        • cppad_jit_sparse_hessian.cpp
        • cppad_jit_sparse_jacobian.cpp
      • speed_cppadcg
        • cppadcg_det_minor.cpp
        • cppadcg_det_lu.cpp
        • cppadcg_mat_mul.cpp
        • cppadcg_ode.cpp
        • cppadcg_poly.cpp
        • cppadcg_sparse_hessian.cpp
        • cppadcg_sparse_jacobian.cpp
      • speed_sacado
        • sacado_det_minor.cpp
        • sacado_det_lu.cpp
        • sacado_mat_mul.cpp
        • sacado_ode.cpp
        • sacado_poly.cpp
        • sacado_sparse_hessian.cpp
        • sacado_sparse_jacobian.cpp
      • speed_xpackage
        • xpackage_det_minor.cpp
        • xpackage_det_lu.cpp
        • xpackage_mat_mul.cpp
        • xpackage_ode.cpp
        • xpackage_poly.cpp
        • xpackage_sparse_hessian.cpp
        • xpackage_sparse_jacobian.cpp
  • appendix
    • Faq
    • directory
    • glossary
    • Bib
    • wish_list
    • whats_new
      • 2026
      • 2025
      • 2024
      • 2023
      • 2022
      • 2021
      • 2020
      • 2019
      • 2018
      • 2017
      • 2016
      • 2015
      • 2014
      • 2013
      • 2012
      • 2011
      • 2010
      • 2009
      • 2008
      • 2007
      • 2006
      • 2005
      • 2004
      • 2003
    • deprecated
      • include_deprecated
      • fun_deprecated
      • CompareChange
      • omp_max_thread
      • track_new_del
      • omp_alloc
        • omp_max_num_threads
        • omp_in_parallel
        • omp_get_thread_num
        • omp_get_memory
        • omp_return_memory
        • omp_free_available
        • omp_inuse
        • omp_available
        • omp_create_array
        • omp_delete_array
        • omp_efficient
        • old_max_num_threads
      • memory_leak
      • epsilon
      • cppad_ipopt_nlp
      • atomic_one
      • atomic_two
        • atomic_two_ctor
        • atomic_two_option
        • atomic_two_afun
        • atomic_two_forward
        • atomic_two_reverse
        • atomic_two_for_sparse_jac
        • atomic_two_rev_sparse_jac
        • atomic_two_for_sparse_hes
        • atomic_two_rev_sparse_hes
        • atomic_two_clear
      • atomic_two_example
        • atomic_two_eigen_mat_mul.cpp
          • atomic_two_eigen_mat_mul.hpp
        • atomic_two_eigen_mat_inv.cpp
          • atomic_two_eigen_mat_inv.hpp
        • atomic_two_eigen_cholesky.cpp
          • cholesky_theory
          • atomic_two_eigen_cholesky.hpp
      • multi_atomic_two.cpp
        • multi_atomic_two_user
        • multi_atomic_two_common
        • multi_atomic_two_setup
        • multi_atomic_two_worker
        • multi_atomic_two_takedown
        • multi_atomic_two_run
        • multi_atomic_two_time
      • chkpoint_one
      • multi_chkpoint_one.cpp
        • multi_chkpoint_one_algo
        • multi_chkpoint_one_common
        • multi_chkpoint_one_setup
        • multi_chkpoint_one_worker
        • multi_chkpoint_one_takedown
        • multi_chkpoint_one_run
        • multi_chkpoint_one_time
      • zdouble
      • configure
    • compare_c
      • det_of_minor_c
      • det_by_minor_c
      • uniform_01_c
      • correct_det_by_minor_c
      • repeat_det_by_minor_c
      • elapsed_seconds_c
      • time_det_by_minor_c
      • main_compare_c
    • numeric_ad
      • BenderQuad
        • bender_quad.cpp
      • opt_val_hes
        • opt_val_hes.cpp
      • LuRatio
        • lu_ratio.cpp
    • addon
    • License
Back to top
View this page

\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)

link_det_lu¶

View page source

Speed Testing Gradient of Determinant Using Lu Factorization¶

Prototype¶

extern bool link_det_lu(
    size_t                     size      ,
    size_t                     repeat    ,
    CppAD::vector<double>&     matrix    ,
    CppAD::vector<double>&     gradient
);

Purpose¶

Each package must define a version of this routine as specified below. This is used by the speed_main program to run the corresponding speed and correctness tests.

Method¶

The same template routine det_by_lu is used by the different AD packages.

Return Value¶

If this speed test is not yet supported by a particular package , the corresponding return value for link_det_lu should be false .

size¶

The argument size is the number of rows and columns in the matrix.

repeat¶

The argument repeat is the number of different matrices that the gradient (or determinant) is computed for.

matrix¶

The argument matrix is a vector with size * size elements. The input value of its elements does not matter. The output value of its elements is the last matrix that the gradient (or determinant) is computed for.

gradient¶

The argument gradient is a vector with size * size elements. The input value of its elements does not matter. The output value of its elements is the gradient of the determinant of matrix with respect to its elements.

double¶

In the case where package is double , only the first element of gradient is used and it is actually the determinant value (the gradient value is not computed).

Next
link_det_minor
Previous
link_routines
Copyright ©
Made with Sphinx and @pradyunsg's Furo
On this page
  • link_det_lu
    • Speed Testing Gradient of Determinant Using Lu Factorization
      • Prototype
      • Purpose
      • Method
      • Return Value
      • size
      • repeat
      • matrix
      • gradient
        • double