Function tskit::bindings::tsk_mutation_table_update_row
source · pub unsafe extern "C" fn tsk_mutation_table_update_row(
self_: *mut tsk_mutation_table_t,
index: tsk_id_t,
site: tsk_id_t,
node: tsk_id_t,
parent: tsk_id_t,
time: f64,
derived_state: *const c_char,
derived_state_length: tsk_size_t,
metadata: *const c_char,
metadata_length: tsk_size_t
) -> c_int
Expand description
@brief Updates the row at the specified index.
@rst
Rewrite the row at the specified index in this table to use the specified
values. Copies of the derived_state
and metadata
parameters are taken
immediately. See the :ref:table definition <sec_mutation_table_definition>
for
details of the columns in this table.
.. warning:: Because of the way that ragged columns are encoded, this method requires a full rewrite of the internal column memory in worst case, and would therefore be inefficient for bulk updates for such columns. However, if the sizes of all ragged column values are unchanged in the updated row, this method is guaranteed to only update the memory for the row in question. @endrst
@param self A pointer to a tsk_mutation_table_t object.
@param index The row to update.
@param site The site ID for the mutation.
@param node The ID of the node this mutation occurs over.
@param parent The ID of the parent mutation.
@param time The time of the mutation.
@param derived_state The derived_state for the mutation.
@param derived_state_length The length of the derived_state in bytes.
@param metadata The metadata to be associated with the mutation. This
is a pointer to arbitrary memory. Can be NULL
if metadata_length
is 0.
@param metadata_length The size of the metadata array in bytes.
@return Return 0 on success or a negative value on failure.