| Libgretl Reference Manual |
|---|
objstackobjstack — |
enum GretlObjType; enum SavedObjectFlags; void set_as_last_model (void *ptr, GretlObjType type); int gretl_model_protect (MODEL *pmod); void* get_last_model (GretlObjType *type); void* get_genr_model (GretlObjType *type); MODEL* get_model_by_name (const char *mname); MODEL* get_model_by_ID (int ID); GRETL_VAR* get_VAR_by_name (const char *vname); GRETL_VAR* get_VECM_by_name (const char *vname); gretl_equation_system* get_equation_system_by_name (const char *sname); void* gretl_get_object_by_name (const char *name); int gretl_get_object_and_type (const char *name, void **pp, GretlObjType *type); GretlObjType gretl_model_get_type (const char *name); int object_is_on_stack (const void *ptr); int gretl_stack_object (void *ptr, GretlObjType type); int gretl_stack_object_as (void *ptr, GretlObjType type, const char *name); void remove_model_from_stack (MODEL *pmod); int maybe_stack_model (MODEL *pmod, const CMD *cmd, PRN *prn); int maybe_stack_var (GRETL_VAR *var, const CMD *cmd); void gretl_object_ref (void *ptr, GretlObjType type); void gretl_object_unref (void *ptr, GretlObjType type); double saved_object_get_scalar (const char *oname, int idx, int *err); int saved_object_print_scalar (const char *oname, const char *key, PRN *prn); double saved_object_get_scalar_element (const char *oname, const char *key, const DATAINFO *pdinfo, int *err); double* saved_object_get_series (const char *oname, int idx, const DATAINFO *pdinfo, int *err); gretl_matrix* saved_object_get_matrix (const char *oname, int idx, int *err); int gretl_object_rename (void *p, GretlObjType type, const char *oname); int gretl_object_compose_name (void *p, GretlObjType type); const char* gretl_object_get_name (void *p, GretlObjType type); int parse_object_command (const char *s, char *name, char **cmd); int match_object_command (const char *s, GretlObjType type); int last_model_test_ok (int ci, gretlopt opt, const DATAINFO *pdinfo, PRN *prn); int last_model_test_uhat (double ***pZ, DATAINFO *pdinfo, PRN *prn); void set_genr_model (MODEL *pmod); void unset_genr_model (void); void gretl_saved_objects_cleanup (void);
typedef enum {
GRETL_OBJ_ANY,
GRETL_OBJ_EQN,
GRETL_OBJ_SYS,
GRETL_OBJ_VAR,
GRETL_OBJ_DSET,
GRETL_OBJ_INFO,
GRETL_OBJ_STATS,
GRETL_OBJ_CORR,
GRETL_OBJ_SCRIPT,
GRETL_OBJ_NOTES,
GRETL_OBJ_MODTAB,
GRETL_OBJ_GPAGE,
GRETL_OBJ_GRAPH,
GRETL_OBJ_PLOT,
GRETL_OBJ_TEXT,
GRETL_OBJ_MATRIX,
GRETL_OBJ_UNKNOWN,
GRETL_OBJ_MAX
} GretlObjType;
typedef enum {
IN_GUI_SESSION = 1 << 0,
IN_NAMED_STACK = 1 << 1,
IN_MODEL_TABLE = 1 << 2,
IS_LAST_MODEL = 1 << 3,
IN_GRAPH_PAGE = 1 << 4
} SavedObjectFlags;
void set_as_last_model (void *ptr,
GretlObjType type);
Puts ptr in place as the "last model" (which will be
accessed by default via accessors such as "$uhat").
ptr : |
pointer to gretl object (e.g. MODEL). |
type : |
type of object. |
void* get_last_model (GretlObjType *type);
type : |
location to receive type of last model, or NULL.
|
| Returns : | pointer to the last model estimated. Note that
this may be NULL if no model has been estimated.
|
gretl_equation_system* get_equation_system_by_name (const char *sname);
sname : |
|
| Returns : |
int gretl_get_object_and_type (const char *name,
void **pp,
GretlObjType *type);
name : |
|
pp : |
|
type : |
|
| Returns : |
int gretl_stack_object_as (void *ptr,
GretlObjType type,
const char *name);
ptr : |
|
type : |
|
name : |
|
| Returns : |
int maybe_stack_model (MODEL *pmod, const CMD *cmd, PRN *prn);
pmod : |
|
cmd : |
|
prn : |
|
| Returns : |
void gretl_object_ref (void *ptr,
GretlObjType type);
Augments the reference count for the object represented by
ptr, of type type.
ptr : |
pointer to gretl obejct (e.g. MODEL). |
type : |
type of object. |
void gretl_object_unref (void *ptr,
GretlObjType type);
Decrements the reference count for the object represented by
ptr, of type type. When the count reaches zero the object
is destroyed.
ptr : |
pointer to gretl object (e.g. MODEL). |
type : |
type of object. |
double saved_object_get_scalar (const char *oname,
int idx,
int *err);
oname : |
|
idx : |
|
err : |
|
| Returns : |
int saved_object_print_scalar (const char *oname,
const char *key,
PRN *prn);
oname : |
|
key : |
|
prn : |
|
| Returns : |
double saved_object_get_scalar_element (const char *oname,
const char *key,
const DATAINFO *pdinfo,
int *err);
oname : |
|
key : |
|
pdinfo : |
|
err : |
|
| Returns : |
double* saved_object_get_series (const char *oname,
int idx,
const DATAINFO *pdinfo,
int *err);
oname : |
|
idx : |
|
pdinfo : |
|
err : |
|
| Returns : |
gretl_matrix* saved_object_get_matrix (const char *oname, int idx, int *err);
oname : |
|
idx : |
|
err : |
|
| Returns : |
int gretl_object_rename (void *p,
GretlObjType type,
const char *oname);
p : |
|
type : |
|
oname : |
|
| Returns : |
int gretl_object_compose_name (void *p,
GretlObjType type);
p : |
|
type : |
|
| Returns : |
const char* gretl_object_get_name (void *p,
GretlObjType type);
p : |
pointer to gretl object (e.g. MODEL). |
type : |
type of object. |
| Returns : | the name of the object of type type with
location p, or NULL if the object is not found.
|
int parse_object_command (const char *s,
char *name,
char **cmd);
s : |
|
name : |
|
cmd : |
|
| Returns : |
int match_object_command (const char *s,
GretlObjType type);
s : |
|
type : |
|
| Returns : |
int last_model_test_ok (int ci,
gretlopt opt,
const DATAINFO *pdinfo,
PRN *prn);
ci : |
|
opt : |
|
pdinfo : |
|
prn : |
|
| Returns : |
int last_model_test_uhat (double ***pZ,
DATAINFO *pdinfo,
PRN *prn);
pZ : |
|
pdinfo : |
|
prn : |
|
| Returns : |
| << interact | libset >> |