Main Page   Modules   Compound List   File List   Compound Members   File Members  

vec_gen.h File Reference

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <gandalf/common/misc_defs.h>
#include <gandalf/common/misc_error.h>
#include <gandalf/linalg/mat_gen.h>
#include <gandalf/linalg/mat_square.h>

Go to the source code of this file.

Compounds

struct  Gan_Vector
 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 Gan_Vector
 Structure definition for double precision general size vector.


Functions

Gan_Vectorgan_vec_form_gen (Gan_Vector *x, unsigned long rows, double *data, size_t data_size)
void gan_vec_free (Gan_Vector *x)
 Free a vector.

Gan_Vectorgan_vec_set_size (Gan_Vector *x, unsigned long rows)
 Set size of vector.

Gan_Vectorgan_vec_fill_va (Gan_Vector *x, unsigned long rows,...)
 Fill vector from variable argument list.

Gan_Vectorgan_vec_fill_vap (Gan_Vector *x, unsigned long rows, va_list *aptr)
 Fill vector from variable argument list.

Gan_Vectorgan_vec_fill_const_q (Gan_Vector *x, unsigned long rows, double value)
 Fill all elements of a vector with the same value.

Gan_Bool gan_vec_read_va (Gan_Vector *x, unsigned long rows,...)
 Read vector from variable argument list.

Gan_Vectorgan_vec_copy_q (Gan_Vector *x, Gan_Vector *y)
 Copy vector.

Gan_Vectorgan_vec_scale_q (Gan_Vector *x, double a, Gan_Vector *y)
 Multiply vector by scalar.

Gan_Vectorgan_vec_add_q (Gan_Vector *x, Gan_Vector *y, Gan_Vector *z)
 Add two vectors and write result into a third.

Gan_Vectorgan_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 (Gan_Vector *x, Gan_Vector *y)
 Vector dot product.

Gan_Matrixgan_vec_outer_q (Gan_Vector *x, Gan_Vector *y, struct Gan_Matrix *A)
Gan_SquMatrixgan_vec_outer_sym_q (Gan_Vector *x, struct Gan_SquMatrix *A)
Gan_Vectorgan_vec_insert (Gan_Vector *x, unsigned long rx, 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_Vectorgan_vec_insert_mat (Gan_Vector *x, unsigned long rx, struct Gan_Matrix *A, unsigned long ra, unsigned long ca, unsigned long rows)
Gan_Vectorgan_vec_insert_matT (Gan_Vector *x, unsigned long rx, struct Gan_Matrix *A, unsigned long ra, unsigned long ca, unsigned long rows)
Gan_Bool gan_vec_fprint (FILE *fp, Gan_Vector *x, const char *prefix, int indent, const char *fmt)
 Print vector to file pointer.

Gan_Vectorgan_vec_fscanf_q (FILE *fp, Gan_Vector *x, char *prefix, int prefix_len)
 Read vector from file.

Gan_Bool gan_vec_fwrite (FILE *fp, Gan_Vector *x, gan_ui32 magic_number)
 Print vector to binary file pointer.

Gan_Vectorgan_vec_fread_q (FILE *fp, Gan_Vector *x, gan_ui32 *magic_number)
 Read vector from file.

Gan_Vectorgan_vec_alloc (unsigned long rows)
 Macro: Allocate and return a generic vector.

Gan_Vectorgan_vec_form (Gan_Vector *x, unsigned long rows)
 Macro: Form and return a generic vector.

Gan_Vectorgan_vec_form_data (Gan_Vector *x, unsigned long rows, void *data, size_t data_size)
 Macro: Form and return a generic vector.

Gan_Bool gan_vec_set_el (Gan_Vector *x, unsigned i, double value)
 Macro: Set specific element of vector.

double gan_vec_get_el (Gan_Vector *x, unsigned i)
 Macro: Get specific element of vector.

Gan_Bool gan_vec_inc_el (Gan_Vector *x, unsigned i, double value)
 Macro: Increment specific element of vector by given value.

Gan_Bool gan_vec_dec_el (Gan_Vector *x, unsigned i, double value)
 Macro: Decrement specific element of vector by given value.

Gan_Bool gan_vec_print (Gan_Vector *x, const char *prefix, int indent, const char *fmt)
 Macro: Print vector to standard output.

Gan_Vectorgan_vec_fill_const_s (unsigned long rows, double value)
 Macro: Allocate and fill all elements of a vector with the same value.

Gan_Vectorgan_vec_fill_zero_q (Gan_Vector *x, unsigned long rows)
 Macro: Fill vector with zeros.

Gan_Vectorgan_vec_fill_zero_s (unsigned long rows)
 Macro: Allocate and fill vector with zeros.

Gan_Vectorgan_vec_copy_s (Gan_Vector *x)
 Macro: Copy vector.

Gan_Vectorgan_vec_scale_s (Gan_Vector *x, double a)
 Macro: Multiply vector by scalar.

Gan_Vectorgan_vec_scale_i (Gan_Vector *x, double a)
 Macro: Multiply vector by scalar.

Gan_Vectorgan_vec_divide_q (Gan_Vector *x, double a, Gan_Vector *y)
 Macro: Divide vector by scalar.

Gan_Vectorgan_vec_divide_s (Gan_Vector *x, double a)
 Macro: Divide vector by scalar.

Gan_Vectorgan_vec_divide_i (Gan_Vector *x, double a)
 Macro: Divide vector by scalar.

Gan_Vectorgan_vec_negate_q (Gan_Vector *x, Gan_Vector *y)
 Macro: Negate vector.

Gan_Vectorgan_vec_negate_s (Gan_Vector *x)
 Macro: Negate vector.

Gan_Vectorgan_vec_negate_i (Gan_Vector *x)
 Macro: Negate vector.

Gan_Vectorgan_vec_add_s (Gan_Vector *x, Gan_Vector *y)
 Macro: Add two vectors.

Gan_Vectorgan_vec_add_i1 (Gan_Vector *x, Gan_Vector *y)
 Macro: Add two vectors and overwrite the first with the result.

Gan_Vectorgan_vec_add_i2 (Gan_Vector *x, Gan_Vector *y)
 Macro: Add two vectors and overwrite the second with the result.

Gan_Vectorgan_vec_increment (Gan_Vector *x, Gan_Vector *y)
 Macro: Increment a vector with another vector.

Gan_Vectorgan_vec_sub_s (Gan_Vector *x, Gan_Vector *y)
 Macro: Subtract two vectors.

Gan_Vectorgan_vec_sub_i1 (Gan_Vector *x, Gan_Vector *y)
 Macro: Subtract two vectors and overwrite the first with the result.

Gan_Vectorgan_vec_sub_i2 (Gan_Vector *x, Gan_Vector *y)
 Macro: Subtract two vectors and overwrite the second with the result.

Gan_Vectorgan_vec_decrement (Gan_Vector *x, Gan_Vector *y)
 Macro: Decrement a vector with another vector.

Gan_Matrixgan_vec_outer_s (Gan_Vector *x, Gan_Vector *y)
 Macro: vector outer product.

Gan_SquMatrixgan_vec_outer_sym_s (Gan_Vector *x)
 Macro: vector outer product with self.

double gan_vec_sqrlen (Gan_Vector *x)
 Macro: Vector squared length.

Gan_Bool gan_vec_same_size (Gan_Vector *x, 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_Vectorgan_vec_fscanf_s (FILE *fp, const char *prefix, int prefix_len)
 Macro: Read vector from file.

Gan_Vectorgan_vec_fread_s (FILE *fp, gan_ui32 *magic_number)
 Macro: Read vector from file in binary format.

Gan_Bool gan_vec_realloc (Gan_Vector *x, unsigned long rows)
void gan_vec_db (Gan_Vector *x)


Detailed Description

Module: Generic column vectors (double precision)

Part of: Gandalf Library

Revision: Last edited: Author:

Copyright: (c) 2000 Imagineer Software Limited


Generated on Mon Oct 13 16:14:46 2003 by doxygen1.3-rc1