----------------------------------------- lines 6-151 of file: src/derived_ctor.cpp ----------------------------------------- {xrst_begin derived_ctor} {xrst_spell nc nr } User Defined Class Derived From cppad_mixed ########################################### Syntax ****** | *mixed_derived* *mixed_object* ( | |tab| *n_fixed* , *n_random* , | |tab| *quasi_fixed* , *bool_sparsity* , *A_rcv* , *trace_init* , | |tab| ... | ) Prototype ********* {xrst_literal include/cppad/mixed/base_class.hpp // BEGIN_CPPAD_MIXED_CTOR // END_CPPAD_MIXED_CTOR } See Also ******** :ref:`initialize-name` mixed_derived ************* This is the name of the class derived in the following fashion: ``class`` *mixed_derived* : ``public cppad_mixed`` { mixed_object ************ This is the derived class object that is constructed by the syntax above. cppad_mixed *********** The derived class constructor must call its base class constructor as follows: | |tab| ``cppad_mixed`` ( | |tab| |tab| *n_fixed* , *n_random* , *quasi_fixed* , *bool_sparsity* , *A_rcv* | |tab| ) The arguments *quasi_fixed* , *bool_sparsity* , *A_rcv* are optional; see default values in prototype above. n_fixed ******* This is the number of :ref:`fixed effects` in the model. n_random ******** This is the number of :ref:`random effects` in the model. In the case where there are :ref:`problem@Maximum Likelihood@No Random Effects` , *n_random* = 0 . quasi_fixed *********** true ==== If *quasi_fixed* is true, a quasi-Newton approximation for the Hessian of the fixed effects objective :ref:`L(theta)` is used during the optimization of the fixed effects. This is more robust when :ref:`optimize_fixed@fixed_in` is far away from a reasonable value and might lead to the Hessian w.r.t. the random effects not being positive definite. If *quasi_fixed* is true, some initialization is skipped during :ref:`initialize-name` . This initialization is needed, and hence computed if the and when the :ref:`information matrix` is computed. false ===== If *quasi_fixed* is false, the Hessian of the fixed effects objective is computed using the approximate Laplace objective :ref:`H(beta, theta, u)` . The extra routines for initializing the second order accurate approximation for the Laplace objective ``init_laplace_obj_fun`` , and ``init_laplace_obj_hes`` are used to initialize the Hessian of the fixed effects objective. bool_sparsity ************* If *bool_sparsity* is true, where possible boolean sparsity patterns are used for this computation, otherwise set sparsity patterns are used. This should only affect to amount of time and memory used for the computations. A_rcv ***** This is a :ref:`sparse_mat_info@Notation@Sparse Matrix` representation of the :ref:`random constraint matrix` :math:`A`. If *random_vec* . ``size`` () is zero, there are no constraint equations and *A_rcv* . ``nr`` () == 0 (this is the case for the default value of this argument). Otherwise, *A_rcv* . ``nc`` () must be equal to *n_random* and *A_rcv* . ``nr`` () is the number of constraints. trace_init ********** If true, trace the initialization of cppad_mixed data structures on standard output. This can be useful for large problems where the initialization takes a significant amount of time. For an example see :ref:`hes_fixed_obj.cpp@trace_init` . ... *** Other arguments to the derived class constructor (that are not used by the base class constructor). The other arguments need not appear at the end of the derived class constructor (as in the syntax above). CppAD ErrorHandler ****************** If a CppAD error occurs, its `ErrorHandler `_ is used to map it to either a :ref:`base_class@User Defined Functions@fatal_error` or :ref:`base_class@User Defined Functions@warning` . {xrst_toc_hidden example/user/derived_ctor.cpp } Example ******* The file :ref:`derived_ctor.cpp-name` contains an example and test that uses this derived class. It returns true for success and false for failure. {xrst_end derived_ctor}