@classmethod<EOL><INDENT>def _cont_to_discrete_object(cls, X, F, L, Qc, compute_derivatives=False,<EOL>grad_params_no=None,<EOL>P_inf=None, dP_inf=None, dF = None, dQc=None,<EOL>dt0=None):<DEDENT>
unique_round_decimals = <NUM_LIT:10><EOL>threshold_number_of_unique_time_steps = <NUM_LIT:20> <EOL>dt = np.empty((X.shape[<NUM_LIT:0>],))<EOL>dt[<NUM_LIT:1>:] = np.diff(X[:,<NUM_LIT:0>],axis=<NUM_LIT:0>)<EOL>if dt0 is None:<EOL><INDENT>dt[<NUM_LIT:0>]  = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>if isinstance(dt0,str):<EOL><INDENT>dt = dt[<NUM_LIT:1>:]<EOL><DEDENT>else:<EOL><INDENT>dt[<NUM_LIT:0>] = dt0<EOL><DEDENT><DEDENT>unique_indices = np.unique(np.round(dt, decimals=unique_round_decimals))<EOL>number_unique_indices = len(unique_indices)<EOL>if use_cython:<EOL><INDENT>class AQcompute_batch(state_space_cython.AQcompute_batch_Cython):<EOL><INDENT>def __init__(self, F,L,Qc,dt,compute_derivatives=False, grad_params_no=None, P_inf=None, dP_inf=None, dF = None, dQc=None):<EOL><INDENT>As, Qs, reconstruct_indices, dAs, dQs = ContDescrStateSpace.lti_sde_to_descrete(F,<EOL>L,Qc,dt,compute_derivatives,<EOL>grad_params_no=grad_params_no, P_inf=P_inf, dP_inf=dP_inf, dF=dF, dQc=dQc)<EOL>super(AQcompute_batch,self).__init__(As, Qs, reconstruct_indices, dAs,dQs)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>AQcompute_batch = cls.AQcompute_batch_Python<EOL><DEDENT>if number_unique_indices > threshold_number_of_unique_time_steps:<EOL><INDENT>AQcomp = cls.AQcompute_once(F,L,Qc, dt,compute_derivatives=compute_derivatives,<EOL>grad_params_no=grad_params_no, P_inf=P_inf, dP_inf=dP_inf, dF=dF, dQc=dQc)<EOL>if print_verbose:<EOL><INDENT>print("<STR_LIT>")<EOL>print("<STR_LIT>" % (number_unique_indices,) )<EOL><DEDENT><DEDENT>else:<EOL><INDENT>AQcomp = AQcompute_batch(F,L,Qc,dt,compute_derivatives=compute_derivatives,<EOL>grad_params_no=grad_params_no, P_inf=P_inf, dP_inf=dP_inf, dF=dF, dQc=dQc)<EOL>if print_verbose:<EOL><INDENT>print("<STR_LIT>")<EOL>print("<STR_LIT>" % (number_unique_indices,) )<EOL>print("<STR_LIT>" % (AQcomp.total_size_of_data,) )<EOL><DEDENT><DEDENT>return AQcomp<EOL>
Function return the object which is used in Kalman filter and/or
smoother to obtain matrices A, Q and their derivatives for discrete model
from the continuous model.

There are 2 objects AQcompute_once and AQcompute_batch and the function
returs the appropriate one based on the number of different time steps.

Input:
----------------------
X, F, L, Qc: matrices
    Continuous model matrices

f_a: function
    Dynamic Function is attached to the Dynamic_Model_Callables class
compute_derivatives: boolean
    Whether to compute derivatives

grad_params_no: int
    Number of parameters in the gradient

P_inf, dP_inf, dF, dQ: matrices and 3D objects
    Data necessary to compute derivatives.

Output:
--------------------------
AQcomp: object
    Its methods return matrices (and optionally derivatives) for the
    discrete state-space model.