Angka
0.0.1
A C library focusing on data manipulation and visualization
|
the library for vector data manipulation More...
Go to the source code of this file.
Data Structures | |
struct | s_vector |
creating vector data type in this library More... | |
Typedefs | |
typedef char * | p_vectorString_t |
vector string typedef More... | |
typedef struct s_vector | AgxVector |
creating vector data type in this library More... | |
Functions | |
AgxVector * | agx_vector_new (int size) |
create an empty vector with a certain size More... | |
int | agx_vector_set_item (AgxVector *vec, int index, double val) |
set value in a certain element of vector More... | |
int | agx_vector_get_item (AgxVector *vec, int index, double *output) |
get value in a certain element of vector More... | |
p_vectorString_t | agx_vector_to_string (AgxVector *vec, int islong) |
convert vector to string using malloc More... | |
void | agx_vector_delete (AgxVector **vec) |
delete vector More... | |
AgxVector * | agx_vector_new_random (int size, double min, double max) |
create a vector with random values More... | |
AgxVector * | agx_vector_new_from_array (double *ndarray_in, int size) |
create a new vector from C array More... | |
void | agx_vector_to_array (AgxVector *vec, double **ndarray_out, int *size) |
passing the array reference to ndarray_out More... | |
int | agx_vector_print (AgxVector *vec, int islong) |
print vector in the console More... | |
int | agx_vector_append_value (AgxVector *vec, double val) |
append vector with a value in the end of vector array More... | |
int | agx_vector_append_vector (AgxVector *vec_target, AgxVector *vec_another) |
append vector with another vector and overwriting More... | |
int | agx_vector_print_partial (AgxVector *vec) |
print the partial of vector More... | |
int | agx_vector_print_full (AgxVector *vec) |
print the full of vector More... | |
int | agx_vector_add_by_value (AgxVector *vec, double val) |
adding all elements of vector by a value More... | |
int | agx_vector_substract_by_value (AgxVector *vec, double val) |
substracting all elements of vector by a value More... | |
int | agx_vector_multiply_by_value (AgxVector *vec, double val) |
multiplying all elements of vector by a value More... | |
int | agx_vector_divide_by_value (AgxVector *vec, double val) |
dividing all elements of vector by a value More... | |
int | agx_vector_change_elements_by_value (AgxVector *vec, double val) |
changing all elements of vector by a value More... | |
AgxVector * | agx_vector_new_constant (int size, double val) |
create agx_vector_new with a constant value More... | |
AgxVector * | agx_vector_new_duplicate_size (AgxVector *vec) |
create agx_vector_new by using the size of another vector More... | |
int | agx_vector_copy_elements (AgxVector *src, AgxVector *target) |
copy all elements of a vector to a target vector More... | |
AgxVector * | agx_vector_new_copy (AgxVector *vec) |
create agx_vector_new by copying another vector More... | |
AgxVector * | agx_vector_new_zero (int size) |
create agx_vector_new_constant with zero value More... | |
AgxVector * | agx_vector_new_linspace (double min, double max, int size) |
create a new range vector by using the size value More... | |
AgxVector * | agx_vector_new_arange (int min, int step, int max) |
create a new range vector using the interval value More... | |
AgxVector * | agx_vector_new_arange_double (double min, double step, double max) |
create a new range vector using the interval value More... | |
double | agx_vector_min (AgxVector *vec) |
looking for the minimum value of vector More... | |
double | agx_vector_max (AgxVector *vec) |
looking for the maximum value of vector More... | |
AgxVector * | agx_vector_new_values (double *array, int size) |
create a vector from C array More... | |
void | agx_vector_input_function (AgxVector *vec, void(*function)(double *)) |
change each element of vector based on a certain function More... | |
void | agx_vector_sin (AgxVector *vec) |
the sinus of each element of the vector More... | |
void | agx_sin (double *val) |
the double sinus More... | |
int | agx_vector_isexist (AgxVector *vec, int idx1, int idx2, double val) |
checking a value is exist on the vector in a certain indexes range More... | |
int | agx_vector_sort (AgxVector *vec) |
sorting the elements of vector from minimum to maximum More... | |
the library for vector data manipulation
creating vector data type in this library
after this struct is created, we need to delete unused using agx_vector_delete. Usually we call this struct using its typedef AgxVector
typedef char* p_vectorString_t |
vector string typedef
it is used for indentifying that this typedef need to be delete in memory before quit a program. Deleting this type can use agx_data_delete in standard.h.
void agx_sin | ( | double * | val | ) |
the double sinus
int agx_vector_add_by_value | ( | AgxVector * | vec, |
double | val | ||
) |
adding all elements of vector by a value
int agx_vector_append_value | ( | AgxVector * | vec, |
double | val | ||
) |
append vector with a value in the end of vector array
append vector with another vector and overwriting
int agx_vector_change_elements_by_value | ( | AgxVector * | vec, |
double | val | ||
) |
changing all elements of vector by a value
copy all elements of a vector to a target vector
void agx_vector_delete | ( | AgxVector ** | vec | ) |
delete vector
int agx_vector_divide_by_value | ( | AgxVector * | vec, |
double | val | ||
) |
dividing all elements of vector by a value
int agx_vector_get_item | ( | AgxVector * | vec, |
int | index, | ||
double * | output | ||
) |
get value in a certain element of vector
output | is the output of getting the value. |
void agx_vector_input_function | ( | AgxVector * | vec, |
void(*)(double *) | function | ||
) |
change each element of vector based on a certain function
int agx_vector_isexist | ( | AgxVector * | vec, |
int | idx1, | ||
int | idx2, | ||
double | val | ||
) |
checking a value is exist on the vector in a certain indexes range
double agx_vector_max | ( | AgxVector * | vec | ) |
looking for the maximum value of vector
double agx_vector_min | ( | AgxVector * | vec | ) |
looking for the minimum value of vector
int agx_vector_multiply_by_value | ( | AgxVector * | vec, |
double | val | ||
) |
multiplying all elements of vector by a value
AgxVector* agx_vector_new | ( | int | size | ) |
create an empty vector with a certain size
AgxVector* agx_vector_new_arange | ( | int | min, |
int | step, | ||
int | max | ||
) |
create a new range vector using the interval value
step | the interval value |
AgxVector* agx_vector_new_arange_double | ( | double | min, |
double | step, | ||
double | max | ||
) |
create a new range vector using the interval value
step | the interval value |
AgxVector* agx_vector_new_constant | ( | int | size, |
double | val | ||
) |
create agx_vector_new with a constant value
create agx_vector_new by copying another vector
create agx_vector_new by using the size of another vector
AgxVector* agx_vector_new_from_array | ( | double * | ndarray_in, |
int | size | ||
) |
create a new vector from C array
AgxVector* agx_vector_new_linspace | ( | double | min, |
double | max, | ||
int | size | ||
) |
create a new range vector by using the size value
AgxVector* agx_vector_new_random | ( | int | size, |
double | min, | ||
double | max | ||
) |
create a vector with random values
AgxVector* agx_vector_new_values | ( | double * | array, |
int | size | ||
) |
create a vector from C array
AgxVector* agx_vector_new_zero | ( | int | size | ) |
create agx_vector_new_constant with zero value
int agx_vector_print | ( | AgxVector * | vec, |
int | islong | ||
) |
print vector in the console
it is using agx_vector_to_string to create a string vector and this function has automatically delete the return of agx_vector_to_string
islong | BOOLEAN for deciding that it is partial (0) or full vector (1) that need to be printed |
int agx_vector_print_full | ( | AgxVector * | vec | ) |
print the full of vector
it is based on agx_vector_print with islong = 1
int agx_vector_print_partial | ( | AgxVector * | vec | ) |
print the partial of vector
it is based on agx_vector_print with islong = 0
int agx_vector_set_item | ( | AgxVector * | vec, |
int | index, | ||
double | val | ||
) |
set value in a certain element of vector
vec | overwrite the existing vector |
index | the index of vector |
val | the value for that index |
void agx_vector_sin | ( | AgxVector * | vec | ) |
the sinus of each element of the vector
int agx_vector_sort | ( | AgxVector * | vec | ) |
sorting the elements of vector from minimum to maximum
int agx_vector_substract_by_value | ( | AgxVector * | vec, |
double | val | ||
) |
substracting all elements of vector by a value
void agx_vector_to_array | ( | AgxVector * | vec, |
double ** | ndarray_out, | ||
int * | size | ||
) |
passing the array reference to ndarray_out
p_vectorString_t agx_vector_to_string | ( | AgxVector * | vec, |
int | islong | ||
) |
convert vector to string using malloc
it is used for saving the string before put in the print function