gretl_array

gretl_array

Functions

Types and Values

typedef gretl_array

Description

Functions

gretl_array_destroy ()

void
gretl_array_destroy (gretl_array *A);

gretl_array_void_content ()

void
gretl_array_void_content (gretl_array *A);

gretl_array_new ()

gretl_array *
gretl_array_new (GretlType type,
                 int n,
                 int *err);

gretl_array_from_strings ()

gretl_array *
gretl_array_from_strings (char **S,
                          int n,
                          int copy,
                          int *err);

gretl_array_get_element ()

void *
gretl_array_get_element (gretl_array *A,
                         int i,
                         GretlType *type,
                         int *err);

gretl_array_set_element ()

int
gretl_array_set_element (gretl_array *A,
                         int i,
                         void *ptr,
                         GretlType type,
                         int copy);

gretl_array_set_type ()

int
gretl_array_set_type (gretl_array *A,
                      GretlType type);

gretl_array_get_strings ()

char **
gretl_array_get_strings (gretl_array *A,
                         int *ns);

gretl_array_get_content_type ()

GretlType
gretl_array_get_content_type (gretl_array *A);

gretl_array_get_length ()

int
gretl_array_get_length (gretl_array *A);

gretl_array_set_string ()

int
gretl_array_set_string (gretl_array *A,
                        int i,
                        char *s,
                        int copy);

gretl_array_append_string ()

int
gretl_array_append_string (gretl_array *A,
                           char *s,
                           int copy);

gretl_array_set_matrix ()

int
gretl_array_set_matrix (gretl_array *A,
                        int i,
                        gretl_matrix *m,
                        int copy);

gretl_array_append_matrix ()

int
gretl_array_append_matrix (gretl_array *A,
                           gretl_matrix *m,
                           int copy);

gretl_array_set_bundle ()

int
gretl_array_set_bundle (gretl_array *A,
                        int i,
                        gretl_bundle *b,
                        int copy);

gretl_array_append_bundle ()

int
gretl_array_append_bundle (gretl_array *A,
                           gretl_bundle *b,
                           int copy);

gretl_array_get_bundle ()

gretl_bundle *
gretl_array_get_bundle (gretl_array *A,
                        int i);

gretl_array_set_list ()

int
gretl_array_set_list (gretl_array *A,
                      int i,
                      int *L,
                      int copy);

gretl_array_append_list ()

int
gretl_array_append_list (gretl_array *A,
                         int *L,
                         int copy);

gretl_array_append_object ()

int
gretl_array_append_object (gretl_array *A,
                           void *ptr,
                           int copy);

gretl_array_append_array ()

int
gretl_array_append_array (gretl_array *A1,
                          const gretl_array *A2);

gretl_arrays_join ()

gretl_array *
gretl_arrays_join (gretl_array *A,
                   gretl_array *B,
                   int *err);

gretl_array_copy ()

gretl_array *
gretl_array_copy (const gretl_array *A,
                  int *err);

gretl_array_copy_as ()

int
gretl_array_copy_as (const char *name,
                     const char *copyname,
                     GretlType copytype);

Look for a saved array specified by name , and if found, make a full copy and save it under copyname . This is called from geneval.c on completion of assignment to a array named copyname , where the returned value on the right-hand side is a pre-existing array.

Parameters

name

name of source array.

 

copyname

name for copy.

 

copytpe

the type specified for the copied array, or 0.

 

Returns

0 on success, non-zero code on error.


gretl_array_copy_range ()

gretl_array *
gretl_array_copy_range (gretl_array *A,
                        int r1,
                        int r2,
                        int *err);

get_array_by_name ()

gretl_array *
get_array_by_name (const char *name);

Parameters

name

the name to look up.

 

Returns

pointer to a saved array, if found, else NULL.


gretl_array_pull_from_stack ()

gretl_array *
gretl_array_pull_from_stack (const char *name,
                             int *err);

gretl_array_print ()

int
gretl_array_print (gretl_array *A,
                   PRN *prn);

gretl_array_serialize ()

void
gretl_array_serialize (gretl_array *A,
                       FILE *fp);

gretl_array_deserialize ()

gretl_array *
gretl_array_deserialize (void *p1,
                         void *p2,
                         int *err);

Types and Values

gretl_array

typedef struct gretl_array_ gretl_array;

An opaque type; use the relevant accessor functions.