Next: , Previous: The Multiset struct, Up: Multisets


11.2 Multiset allocation

— Function: gsl_multiset * gsl_multiset_alloc (size_t n, size_t k)

This function allocates memory for a new multiset with parameters n, k. The multiset is not initialized and its elements are undefined. Use the function gsl_multiset_calloc if you want to create a multiset which is initialized to the lexicographically first multiset element. A null pointer is returned if insufficient memory is available to create the multiset.

— Function: gsl_multiset * gsl_multiset_calloc (size_t n, size_t k)

This function allocates memory for a new multiset with parameters n, k and initializes it to the lexicographically first multiset element. A null pointer is returned if insufficient memory is available to create the multiset.

— Function: void gsl_multiset_init_first (gsl_multiset * c)

This function initializes the multiset c to the lexicographically first multiset element, i.e. 0 repeated k times.

— Function: void gsl_multiset_init_last (gsl_multiset * c)

This function initializes the multiset c to the lexicographically last multiset element, i.e. n-1 repeated k times.

— Function: void gsl_multiset_free (gsl_multiset * c)

This function frees all the memory used by the multiset c.

— Function: int gsl_multiset_memcpy (gsl_multiset * dest, const gsl_multiset * src)

This function copies the elements of the multiset src into the multiset dest. The two multisets must have the same size.