void misfit_ranking_iset( misfit_ranking_type * misfit_ranking , int iens , hash_type * obs_hash , double total_misfit) { if (iens > vector_get_size(misfit_ranking->ensemble)) vector_grow_NULL( misfit_ranking->ensemble , iens ); if (obs_hash != NULL) vector_iset_owned_ref( misfit_ranking->ensemble , iens , obs_hash , hash_free__ ); else vector_iset_ref( misfit_ranking->ensemble , iens , NULL ); double_vector_iset( misfit_ranking->total , iens , total_misfit ); }
static void vector_iset__(vector_type * vector , int index , node_data_type * node) { if (index > vector->size) vector_grow_NULL( vector , index ); if (index == vector->size) vector_append_node( vector , node ); else { if (vector->data[index] != NULL) node_data_free( vector->data[index] ); vector->data[index] = node; } }
vector_type * vector_alloc_NULL_initialized( int size ) { vector_type * vector = vector_alloc_new(); vector_grow_NULL( vector , size ); return vector; }