next up previous contents index
Next: Transformation Functions Up: Utility Functions Previous: Matrix Functions

Functions for Arrays and n-dim Vectors

 

int g_get_vecpos_int (int x, int *v, int n)
searches x in v[n]; returns the index, if found, otherwise -1

void g_int3_assign (INT3 v, INT3 w)
v = w

void g_int3_list_assign (INT3 *v, INT3 *w, int n)
copy the INT3 list w of length n to v

void g_get_vecpos (double *v, int n, double x, int *i,double *fraction)
searches for x in v[n] and stores the resulting index in i

double *g_vec_append_double (double **v1, int *n1, int *m, double *v2, int n2)

float *g_vec_append_float (float **v1, int *n1, int *m, float *v2, int n2)

INSTANCE **g_vec_append_instance (INSTANCE ***v1, int *n1, int *m, INSTANCE **v2, int n2)

int *g_vec_append_int (int **v1, int *n1, int *m, int *v2, int n2)

INT3 *g_vec_append_int3 (INT3 **v1, int *n1, int *m, INT3 *v2, int n2)

VEC3 *g_vec_append_vec3 (VEC3 **v1, int *n1, int *m, VEC3 *v2, int n2)
append v2[n2] to v1[n1]; if n1 + n2 > m, then allocate new v1 and free old one. The elements of v1 and v2 have the same type as the function.

void g_vec_change_int (int *v, int n, int *v1, int *v2, int m)

void g_vec_change_int3 (INT3 *v, int n, int *v1, int *v2, int m)
change in v[n] all occurrences of numbers in v1[m] to corresponding numbers in v2[m]

void g_vec_change_value_int (int *v, int n, int x1, int x2)

void g_vec_change_value_int3 (INT3 *v, int n, int x1, int x2)
change in v[n] all values x1 to x2

int g_vec_cmp_float (float *a, float *b, int n, double eps)
returns 1 if the n-dim vectors a and b have square distance less than eps

double g_vec_max_double (double *v, int n)

float g_vec_max_float (float *v, int n)

int g_vec_max_int (int *v, int n)
return the maximum entry in the n-dim array v

double g_vec_min_double (double *v, int n)

float g_vec_min_float (float *v, int n)

int g_vec_min_int (int v, int n)
return the minimum entry in the n-dim array v


next up previous contents index
Next: Transformation Functions Up: Utility Functions Previous: Matrix Functions

SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.