#include <stdlib.h>
#include <stdio.h>
#include "GA_message.h"
#include "GA_vector.h"
int GA_get_bin_number | ( | double | x, | |
GAVectorReal * | lookup, | |||
GAClampMode | clamp | |||
) |
Get bin number.
Get the bin number for the argument using the specified lookup vector. If clamp
is set to GA_CLAMP_ENABLED, values which are outside of the boundaries of the lookup range will be clamped to the bins at the end of the range. If clamp
is set to GA_CLAMP_DISABLED, out-of-range values will be reported as errors.
x | number which should be binned | |
lookup | lookup vector | |
clamp | clamp the result to the lookup range |
GAVectorInt* GA_invert_permutation_int | ( | GAVectorInt * | vec | ) |
Invert permutation.
Invert the permutation defined by the specified vector. The result will be referenced and should be destroyed by using GA_vector_destroy_int() when it is not needed anymore.
vec | vector |
GAVectorInt* GA_vector_create_from_array_int | ( | int * | source, | |
int | srcSize | |||
) |
Create vector from array (int).
Create a vector of integers from an array of integers. The new vector will be referenced and should be destroyed by using GA_vector_destroy_int() when it is not needed anymore.
source | source array | |
srcSize | size of source array |
GAVectorReal* GA_vector_create_from_array_real | ( | double * | source, | |
int | srcSize | |||
) |
Create vector from array (real).
Create a vector of real numbers from an array of real numbers. The new vector will be referenced and should be destroyed by using GA_vector_destroy_real() when it is not needed anymore.
source | source array | |
srcSize | size of source array |
GAVectorInt* GA_vector_create_int | ( | int | size | ) |
Create vector (int).
Create a vector of integers. The new vector will be referenced and should be destroyed by using GA_vector_destroy_int() when it is not needed anymore.
size | Number of elements. |
GAVectorReal* GA_vector_create_real | ( | int | size | ) |
Create vector (real).
Create a vector of real numbers. The new vector will be referenced and should be destroyed by using GA_vector_destroy_int() when it is not needed anymore.
size | Number of elements. |
void GA_vector_destroy_int | ( | GAVectorInt * | vec | ) |
Destroy vector (int).
Remove a reference from a vector. If the reference count drops to zero, all resources allocated for the vector will be freed and the vector itself will be destroyed.
vec | Vector. |
void GA_vector_destroy_real | ( | GAVectorReal * | vec | ) |
Destroy vector (real).
Remove a reference from a vector. If the reference count drops to zero, all resources allocated for the vector will be freed and the vector itself will be destroyed.
vec | vector. |
int* GA_vector_get_elt_int | ( | GAVectorInt * | vec, | |
int | index | |||
) |
Get vector element (int).
Get the element of the vector with the specified index. An error will be reported if the index is out of range.
vec | vector | |
index | index |
double* GA_vector_get_elt_real | ( | GAVectorReal * | vec, | |
int | index | |||
) |
Get vector element (real).
Get the element of the vector with the specified index. An error will be reported if the index is out of range.
vec | vector | |
index | index |
GAVectorInt* GA_vector_init_from_array_int | ( | GAVectorInt * | vec, | |
int * | source, | |||
int | srcSize | |||
) |
Initialize vector from array (int).
Initialize a vector of integers from an array of integers.
vec | vector | |
source | source array | |
srcSize | size of source array |
GAVectorReal* GA_vector_init_from_array_real | ( | GAVectorReal * | vec, | |
double * | source, | |||
int | srcSize | |||
) |
Initialize vector from array (real).
Initialize a vector of real numbers from an array of real numbers.
vec | vector | |
source | source array | |
srcSize | size of source array |
GAVectorInt* GA_vector_init_zero_int | ( | GAVectorInt * | vec | ) |
Initialize vector to zero (int).
Set all elements of a vector to zero.
vec | vector |
GAVectorReal* GA_vector_init_zero_real | ( | GAVectorReal * | vec | ) |
Initialize vector to zero (real).
Set all elements of a vector to zero.
vec | vector |
GAVectorInt* GA_vector_print_int | ( | GAVectorInt * | vec | ) |
Print vector (int).
Print a vector of integers in a nice, readable way.
vec | vector |
GAVectorReal* GA_vector_print_real | ( | GAVectorReal * | vec | ) |
Print vector (real).
Print a vector of real numbers in a nice, readable way.
vec | vector |
GAVectorInt* GA_vector_ref_int | ( | GAVectorInt * | vec | ) |
Add reference (int).
Add a reference for a vector. The user of this function is responsible for removing the reference using GA_vector_destroy_int().
vec | Vector. |
GAVectorReal* GA_vector_ref_real | ( | GAVectorReal * | vec | ) |
Add reference (real).
Add a reference for a vector. The user of this function is responsible for removing the reference using GA_vector_destroy_real().
vec | Vector. |
GAVectorInt* GA_vector_to_bin_real | ( | GAVectorReal * | vec, | |
GAVectorReal * | lookup, | |||
GAClampMode | clamp | |||
) |
Convert to bin vector (real).
Convert a vector of real numbers to a vector of integer bin numbers according to the specified lookup vector. The new vector will be referenced and should be destroyed by using GA_vector_destroy_int() when it is not needed anymore.
vec | vector | |
lookup | lookup vector | |
clamp | clamp values to the lookup range |