Template Struct DfDy

Struct Documentation

template<typename ModelT, MemberFunctions function, class ScalarT, typename IdxT>
struct DfDy

Enzyme automatic differentiation Jacobian evaluator: Internal Jacobian, df/dy.

Template Parameters:
  • ModelT – - model type

  • MemberFunctions – - member function parameter key

  • ScalarT – - scalar data type

  • IdxT – - matrix index data type

Public Static Functions

static inline void eval(ModelT *model, size_t n_res, size_t n_var, const IdxT *res_indices, const IdxT *var_indices, ScalarT *y, ScalarT *yp, ScalarT *wb, IdxT *rows, IdxT *cols, RealT *vals, MatrixT &jac)
Parameters:
  • model[in] - Pointer to the model to be differentiated

  • n_res[in] - Number of residual functions

  • n_var[in] - Number of independent variables

  • res_indices[in] - Global residual indices

  • var_indices[in] - Global variable indices

  • y[in] - Internal variables

  • yp[in] - Internal variable derivatives

  • wb[in] - Bus variables

  • jac[inout] - Jacobian

static inline void eval(ModelT *model, size_t n_res, size_t n_var, const IdxT *res_indices, const IdxT *var_indices, ScalarT *y, ScalarT *yp, ScalarT *wb, RealT alpha, IdxT *rows, IdxT *cols, RealT *vals, MatrixT &jac)
Parameters:
  • model[in] - Pointer to the model to be differentiated

  • n_res[in] - Number of residual functions

  • n_var[in] - Number of independent variables

  • res_indices[in] - Global residual indices

  • var_indices[in] - Global variable indices

  • y[in] - Internal variables

  • yp[in] - Internal variable derivatives

  • wb[in] - Bus variables

  • alpha[in] - Time derivative jacobian coefficient

  • jac[inout] - Jacobian

static inline void eval(ModelT *model, size_t n_res, size_t n_var, const IdxT *res_indices, const IdxT *var_indices, ScalarT *y, ScalarT *yp, ScalarT *wb, ScalarT *ws, RealT alpha, IdxT *rows, IdxT *cols, RealT *vals, MatrixT &jac)
Parameters:
  • model[in] - Pointer to the model to be differentiated

  • n_res[in] - Number of residual functions

  • n_var[in] - Number of independent variables

  • res_indices[in] - Map from local residual indices to global indices

  • var_indices[in] - Map from local variable indices to global indices

  • y[in] - Internal variables

  • yp[in] - Internal variable derivatives

  • wb[in] - Bus variables

  • ws[in] - Signal variables

  • alpha[in] - Time derivative jacobian coefficient

  • jac[inout] - Jacobian