genomicSimulationC 0.2.6
Functions
Deletor Functions

For deleting and free associated memory of data structures. More...

+ Collaboration diagram for Deletor Functions:

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...
 

Detailed Description

For deleting and free associated memory of data structures.

Function Documentation

◆ gsc_delete_allele_matrix()

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.

Parameters
mpointer to the matrix whose data is to be cleared and memory freed.

Definition at line 4841 of file sim-operations.c.

+ Here is the caller graph for this function:

◆ gsc_delete_bidirectional_iter()

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

Parameters
itpointer to the struct whose data is to be cleared.

Definition at line 4965 of file sim-operations.c.

+ Here is the caller graph for this function:

◆ gsc_delete_dmatrix()

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.

Parameters
mpointer to the matrix whose data is to be cleared and memory freed.

Definition at line 4498 of file sim-operations.c.

+ Here is the caller graph for this function:

◆ gsc_delete_eff_set()

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

Parameters
dthe gsc_SimData struct on which to perform the operation
effIDthe identifier of the effect set to be deleted

Definition at line 4572 of file sim-operations.c.

+ Here is the call graph for this function:

◆ gsc_delete_effect_matrix()

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.

Parameters
mpointer to the matrix whose data is to be cleared and memory freed.

Definition at line 4884 of file sim-operations.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsc_delete_genome()

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

Parameters
gpointer to the structure whose data is to be cleared and memory freed.

Definition at line 4708 of file sim-operations.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsc_delete_group()

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

Parameters
dthe gsc_SimData struct on which to perform the operation
group_idthe group number of the subset of data to be cleared

Definition at line 4528 of file sim-operations.c.

+ Here is the call graph for this function:

◆ gsc_delete_label()

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

Parameters
dthe gsc_SimData struct on which to perform the operation
which_labelthe label id of the label to be destroyed

Definition at line 4626 of file sim-operations.c.

+ Here is the call graph for this function:

◆ gsc_delete_markerblocks()

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

Parameters
bpointer to the struct whose data is to be cleared and memory freed.

Definition at line 4938 of file sim-operations.c.

◆ gsc_delete_randomaccess_iter()

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

Parameters
itpointer to the struct whose data is to be cleared and memory freed.

Definition at line 4986 of file sim-operations.c.

+ Here is the caller graph for this function:

◆ gsc_delete_recombination_map()

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

Parameters
dthe gsc_SimData struct on which to perform the operation
which_mapthe ID of the recombination map to be deleted.

Definition at line 4746 of file sim-operations.c.

+ Here is the call graph for this function:

◆ gsc_delete_recombination_map_nointegrity()

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,

See also
gsc_delete_recombination_map
Parameters
mpointer to the structure whose data is to be cleared and memory freed.

Definition at line 4801 of file sim-operations.c.

+ Here is the caller graph for this function:

◆ gsc_delete_simdata()

void gsc_delete_simdata ( gsc_SimData m)

Deletes a gsc_SimData object and frees its memory.

Has short name: delete_simdata

Parameters
mpointer to the struct whose data is to be cleared and memory freed.

Definition at line 4898 of file sim-operations.c.

+ Here is the call graph for this function:

◆ gsc_move_genotype()

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.

Parameters
fromcopying source. The information at this GenoLocation will be cleared.
tocopying destination. A prior genotype existing at this location will be overwritten with a warning.
label_defaultsarray 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.

+ Here is the caller graph for this function: