Ejemplo n.º 1
0
__global__ void _merge_space( AlleleSpaceType * in_alleles
                            , device_free_space< IntType, unordered_tag > * in_free
                            , device_event_space< IntType, unordered_tag > * new_muts
                            , device_free_space< IntType, unordered_tag > * out_free
                            , AlleleSpaceType * out_alleles ) {

    unsigned int N = in_free->total;    // total number of free elements from parent allele space
    unsigned int M = new_muts->total;   // total number of new mutations to be added to offspring population

    unsigned int P = in_alleles->capacity; // current allocated size of parent population

    unsigned int C = P + (( N < M ) ? (M - N) : 0);

//    printf( "Resize Population: %d = %d + |min(0, (%d - %d))|\n", C, P, N, M );

    _resize_space_impl(out_alleles, C );  // resize offspring allele space relative to parent space

    C = out_alleles->capacity;  // the size of the offspring allele space
//    printf( "Padded Population: %d\n", C );

    _resize_space_impl( out_free, C );     // resize offspring free space relative to offsrping allele space
 
    if( P > 0 ) {
        //printf( "Updating spaces \n" );
        _update_space( in_alleles, out_alleles );
        _update_space( in_free, out_free );
    }
}
void AnimationNodeBlendSpace1DEditor::edit(const Ref<AnimationNode> &p_node) {

	blend_space = p_node;

	if (!blend_space.is_null()) {
		_update_space();
	}
}
Ejemplo n.º 3
0
__device__ void _update_space( device_weighted_allele_space< RealType > * in_space
                            , device_weighted_allele_space< RealType > * out_space ) {
    _update_space( (device_allele_space< RealType > * ) in_space, (device_allele_space< RealType > * ) out_space );

    memcpy( out_space->weights, in_space->weights, in_space->capacity * sizeof( typename device_allele_space< RealType >::real_type ) );
}