genomicSimulationC 0.2.6
|
For deleting and free associated memory of data structures. More...
Functions | |
void | gsc_delete_group (gsc_SimData *d, const gsc_GroupNum group_id) |
Deletes all genotypes belonging to a particular group. More... | |
void | gsc_delete_label (gsc_SimData *d, const gsc_LabelID whichLabel) |
Clears memory of this label from the simulation and all its genotypes. More... | |
void | gsc_delete_genome (gsc_KnownGenome *g) |
Deletes and clears the memory of a gsc_KnownGenome object and its children. More... | |
void | gsc_delete_recombination_map (gsc_SimData *d, const gsc_MapID whichMap) |
Deletes a particular recombination map from memory. More... | |
void | gsc_delete_recombination_map_nointegrity (gsc_RecombinationMap *m) |
Deletes and clears the memory of a gsc_RecombinationMap struct. More... | |
void | gsc_delete_allele_matrix (gsc_AlleleMatrix *m) |
Delete the gsc_AlleleMatrix linked list from m onwards and frees its memory. More... | |
void | gsc_delete_effect_matrix (gsc_EffectMatrix *m) |
Deletes an gsc_EffectMatrix object and frees its memory. More... | |
void | gsc_delete_eff_set (gsc_SimData *d, gsc_EffectID whichID) |
Deletes a particular set of marker effects from memory. More... | |
void | gsc_delete_simdata (gsc_SimData *m) |
Deletes a gsc_SimData object and frees its memory. More... | |
void | gsc_delete_markerblocks (gsc_MarkerBlocks *b) |
Delete a gsc_MarkerBlocks struct. More... | |
void | gsc_delete_dmatrix (gsc_DecimalMatrix *m) |
Deletes a gsc_DecimalMatrix and frees its memory. More... | |
void | gsc_delete_bidirectional_iter (gsc_BidirectionalIterator *it) |
Deletes a gsc_BidirectionalIterator object. More... | |
void | gsc_delete_randomaccess_iter (gsc_RandomAccessIterator *it) |
Deletes a gsc_RandomAccessIterator object and frees its memory. More... | |
void | gsc_move_genotype (gsc_GenoLocation from, gsc_GenoLocation to, int *label_defaults) |
Move all details of the genotype at one gsc_GenoLocation to another gsc_GenoLocation. More... | |
For deleting and free associated memory of data structures.
void gsc_delete_allele_matrix | ( | gsc_AlleleMatrix * | m | ) |
Delete the gsc_AlleleMatrix linked list from m onwards and frees its memory.
Freeing its memory includes freeing the gsc_AlleleMatrix, which was allocated on the heap by gsc_create_empty_allelematrix(). All matrices further along in the linked list chain (eg pointed to by m->next or a chain of ->next pointers) will be similarly deleted.
m | pointer to the matrix whose data is to be cleared and memory freed. |
Definition at line 4841 of file sim-operations.c.
void gsc_delete_bidirectional_iter | ( | gsc_BidirectionalIterator * | it | ) |
Deletes a gsc_BidirectionalIterator object.
A gsc_BidirectionalIterator has no heap memory to free, so calling this function is mostly unnecessary. The function will set all values in the struct to uninitialised/null values, and will set the iterator to think it is both at the start and end of its sequence, so that any next_* functions will not attempt to search for group member locations.
Has short name: delete_bidirectional_iter
it | pointer to the struct whose data is to be cleared. |
Definition at line 4965 of file sim-operations.c.
void gsc_delete_dmatrix | ( | gsc_DecimalMatrix * | m | ) |
Deletes a gsc_DecimalMatrix and frees its memory.
m will now refer to an empty matrix, with every pointer set to null and dimensions set to 0.
m | pointer to the matrix whose data is to be cleared and memory freed. |
Definition at line 4498 of file sim-operations.c.
void gsc_delete_eff_set | ( | gsc_SimData * | d, |
gsc_EffectID | effID | ||
) |
Deletes a particular set of marker effects from memory.
Has short name: delete_eff_set
d | the gsc_SimData struct on which to perform the operation |
effID | the identifier of the effect set to be deleted |
Definition at line 4572 of file sim-operations.c.
void gsc_delete_effect_matrix | ( | gsc_EffectMatrix * | m | ) |
Deletes an gsc_EffectMatrix object and frees its memory.
m will now refer to an empty matrix, with every pointer set to null and dimensions set to 0.
m | pointer to the matrix whose data is to be cleared and memory freed. |
Definition at line 4884 of file sim-operations.c.
void gsc_delete_genome | ( | gsc_KnownGenome * | g | ) |
Deletes and clears the memory of a gsc_KnownGenome object and its children.
Children include all recombination maps associated with this KnownGenome object
g | pointer to the structure whose data is to be cleared and memory freed. |
Definition at line 4708 of file sim-operations.c.
void gsc_delete_group | ( | gsc_SimData * | d, |
const gsc_GroupNum | group_id | ||
) |
Deletes all genotypes belonging to a particular group.
This includes all of their details. Persistent ids (used to track pedigree) will not be re-used.
Uses a call to gsc_condense_allele_matrix() to ensure that the gsc_SimData remains valid after deletion.
Has short name: delete_group
d | the gsc_SimData struct on which to perform the operation |
group_id | the group number of the subset of data to be cleared |
Definition at line 4528 of file sim-operations.c.
void gsc_delete_label | ( | gsc_SimData * | d, |
const gsc_LabelID | which_label | ||
) |
Clears memory of this label from the simulation and all its genotypes.
Has short name: delete_label
d | the gsc_SimData struct on which to perform the operation |
which_label | the label id of the label to be destroyed |
Definition at line 4626 of file sim-operations.c.
void gsc_delete_markerblocks | ( | gsc_MarkerBlocks * | b | ) |
Delete a gsc_MarkerBlocks struct.
Deletes a gsc_MarkerBlocks object and frees its associated memory. b will now refer to an empty struct, with every pointer set to null and number of markers set to 0.
Has short name: delete_markerblocks
b | pointer to the struct whose data is to be cleared and memory freed. |
Definition at line 4938 of file sim-operations.c.
void gsc_delete_randomaccess_iter | ( | gsc_RandomAccessIterator * | it | ) |
Deletes a gsc_RandomAccessIterator object and frees its memory.
All values in the struct will be set to uninitialised/null values, except for groupSize, which will be set to 0 to so that any next_* functions called on the iterator will not attempt to search for group member locations.
Has short name: delete_randomaccess_iter
it | pointer to the struct whose data is to be cleared and memory freed. |
Definition at line 4986 of file sim-operations.c.
void gsc_delete_recombination_map | ( | gsc_SimData * | d, |
const gsc_MapID | which_map | ||
) |
Deletes a particular recombination map from memory.
Has short name: delete_recombination_map
d | the gsc_SimData struct on which to perform the operation |
which_map | the ID of the recombination map to be deleted. |
Definition at line 4746 of file sim-operations.c.
void gsc_delete_recombination_map_nointegrity | ( | gsc_RecombinationMap * | m | ) |
Deletes and clears the memory of a gsc_RecombinationMap struct.
"No integrity" because it does not check that the corresponding gsc_MapID is correspondingly removed from simulation memory.
For a safer/user-friendlier version of this function,
m | pointer to the structure whose data is to be cleared and memory freed. |
Definition at line 4801 of file sim-operations.c.
void gsc_delete_simdata | ( | gsc_SimData * | m | ) |
Deletes a gsc_SimData object and frees its memory.
Has short name: delete_simdata
m | pointer to the struct whose data is to be cleared and memory freed. |
Definition at line 4898 of file sim-operations.c.
void gsc_move_genotype | ( | gsc_GenoLocation | from, |
gsc_GenoLocation | to, | ||
int * | label_defaults | ||
) |
Move all details of the genotype at one gsc_GenoLocation to another gsc_GenoLocation.
After the genotype at gsc_GenoLocation from has been copied to gsc_GenoLocation to, the information is cleared from gsc_GenoLocation from.
Copying a genotype that belongs to one gsc_SimData object to a gsc_GenoLocation in a different gsc_SimData object is not recommended, as genetic maps and numbers of custom labels may differ. This function is not suitable for that purpose.
from | copying source. The information at this GenoLocation will be cleared. |
to | copying destination. A prior genotype existing at this location will be overwritten with a warning. |
label_defaults | array of default values for custom labels. It must have at least enough values that to.localAM.n_labels values can be read from it. |
Definition at line 1217 of file sim-operations.c.