vec_gen.h File Reference (original) (raw)
Classes
struct
Structure definition for double precision general size vector. More...
Defines
#define
GAN_VECTOR_STRUCT_DEFINED
#define
Gan_Matrix struct Gan_Matrix
#define
Gan_SquMatrix struct Gan_SquMatrix
Typedefs
typedef Gan_Vector
Structure definition for double precision general size vector.
Functions
gan_vec_form_gen (Gan_Vector *x, unsigned long rows, double *data, size_t data_size)
void
gan_vec_free (Gan_Vector *x)
gan_vec_set_size (Gan_Vector *x, unsigned long rows)
gan_vec_fill_va (Gan_Vector *x, unsigned long rows,...)
Fill vector from variable argument list.
gan_vec_fill_vap (Gan_Vector *x, unsigned long rows, va_list *aptr)
Fill vector from variable argument list.
gan_vec_fill_const_q (Gan_Vector *x, unsigned long rows, double value)
Fill all elements of a vector with the same value.
gan_vec_read_va (const Gan_Vector *x, unsigned long rows,...)
Read vector from variable argument list.
gan_vec_copy_q (const Gan_Vector *x, Gan_Vector *y)
gan_vec_scale_q (Gan_Vector *x, double a, Gan_Vector *y)
gan_vec_add_q (Gan_Vector *x, Gan_Vector *y, Gan_Vector *z)
Add two vectors and write result into a third.
gan_vec_sub_q (Gan_Vector *x, Gan_Vector *y, Gan_Vector *z)
Subtract two vectors and write result into a third.
double
gan_vec_dot (const Gan_Vector *x, const Gan_Vector *y)
gan_vec_outer_q (const Gan_Vector *x, const Gan_Vector *y, struct Gan_Matrix *A)
gan_vec_outer_sym_q (const Gan_Vector *x, struct Gan_SquMatrix *A)
gan_vec_insert (Gan_Vector *x, unsigned long rx, const Gan_Vector *y, unsigned long ry, unsigned long rows)
Insert part of vector in another vector.
void
gan_vec_free_va (Gan_Vector *x,...)
Free a NULL terminated variable argument list of vectors.
gan_vec_insert_mat (Gan_Vector *x, unsigned long rx, const struct Gan_Matrix *A, unsigned long ra, unsigned long ca, unsigned long rows)
gan_vec_insert_matT (Gan_Vector *x, unsigned long rx, const struct Gan_Matrix *A, unsigned long ra, unsigned long ca, unsigned long rows)
gan_vec_fprint (FILE *fp, const Gan_Vector *x, const char *prefix, int indent, const char *fmt)
gan_vec_fscanf_q (FILE *fp, Gan_Vector *x, char *prefix, int prefix_len)
gan_vec_fwrite (FILE *fp, const Gan_Vector *x, gan_uint32 magic_number)
Print vector to binary file pointer.
gan_vec_fread_q (FILE *fp, Gan_Vector *x, gan_uint32 *magic_number)
gan_vec_alloc (unsigned long rows)
Macro: Allocate and return a generic vector.
gan_vec_form (Gan_Vector *x, unsigned long rows)
Macro: Form and return a generic vector.
gan_vec_form_data (Gan_Vector *x, unsigned long rows, void *data, size_t data_size)
Macro: Form and return a generic vector.
gan_vec_set_el (Gan_Vector *x, unsigned i, double value)
Macro: Set specific element of vector.
double
gan_vec_get_el (const Gan_Vector *x, unsigned i)
Macro: Get specific element of vector.
gan_vec_inc_el (Gan_Vector *x, unsigned i, double value)
Macro: Increment specific element of vector by given value.
gan_vec_dec_el (Gan_Vector *x, unsigned i, double value)
Macro: Decrement specific element of vector by given value.
gan_vec_print (const Gan_Vector *x, const char *prefix, int indent, const char *fmt)
Macro: Print vector to standard output.
gan_vec_fill_const_s (unsigned long rows, double value)
Macro: Allocate and fill all elements of a vector with the same value.
gan_vec_fill_zero_q (Gan_Vector *x, unsigned long rows)
Macro: Fill vector with zeros.
gan_vec_fill_zero_s (unsigned long rows)
Macro: Allocate and fill vector with zeros.
gan_vec_copy_s (const Gan_Vector *x)
gan_vec_scale_s (Gan_Vector *x, double a)
Macro: Multiply vector by scalar.
gan_vec_scale_i (Gan_Vector *x, double a)
Macro: Multiply vector by scalar.
gan_vec_divide_q (Gan_Vector *x, double a, Gan_Vector *y)
Macro: Divide vector by scalar.
gan_vec_divide_s (Gan_Vector *x, double a)
Macro: Divide vector by scalar.
gan_vec_divide_i (Gan_Vector *x, double a)
Macro: Divide vector by scalar.
gan_vec_negate_q (Gan_Vector *x, Gan_Vector *y)
gan_vec_negate_s (Gan_Vector *x)
gan_vec_negate_i (Gan_Vector *x)
gan_vec_add_s (Gan_Vector *x, Gan_Vector *y)
gan_vec_add_i1 (Gan_Vector *x, Gan_Vector *y)
Macro: Add two vectors and overwrite the first with the result.
gan_vec_add_i2 (Gan_Vector *x, Gan_Vector *y)
Macro: Add two vectors and overwrite the second with the result.
gan_vec_increment (Gan_Vector *x, Gan_Vector *y)
Macro: Increment a vector with another vector.
gan_vec_sub_s (Gan_Vector *x, Gan_Vector *y)
gan_vec_sub_i1 (Gan_Vector *x, Gan_Vector *y)
Macro: Subtract two vectors and overwrite the first with the result.
gan_vec_sub_i2 (Gan_Vector *x, Gan_Vector *y)
Macro: Subtract two vectors and overwrite the second with the result.
gan_vec_decrement (Gan_Vector *x, Gan_Vector *y)
Macro: Decrement a vector with another vector.
gan_vec_outer_s (const Gan_Vector *x, const Gan_Vector *y)
gan_vec_outer_sym_s (const Gan_Vector *x)
Macro: vector outer product with self.
double
gan_vec_sqrlen (const Gan_Vector *x)
gan_vec_same_size (const Gan_Vector *x, const Gan_Vector *y)
Macro: Checks that two vectors have the same number of rows.
size_t
gan_vec_data_size (unsigned long rows)
Macro: Returns size of data array in bytes needed to hold vector data.
gan_vec_fscanf_s (FILE *fp, const char *prefix, int prefix_len)
gan_vec_fread_s (FILE *fp, gan_uint32 *magic_number)
Macro: Read vector from file in binary format.
gan_vec_realloc (Gan_Vector *x, unsigned long rows)