extract Interface

public interface extract

Creates a new bitset, new, from a range, start_pos to stop_pos, in bitset old. If start_pos is greater than stop_pos the new bitset is empty. If start_pos is less than zero or stop_pos is greater than bits(old)-1 then if status is present it has the value index_invalid_error and new is undefined, otherwise processing stops with an informative message. (Specification)

Example

    program demo_extract
        use stdlib_bitsets
        type(bitset_large) :: set0, set1
        call set0 % init(166)
        call set0 % set(100,150)
        call extract( set1, set0, 100, 150)
        if ( set1 % bits() == 51 ) &
            write(*,*) 'SET1 has the proper size.'
        if ( set1 % all() ) write(*,*) 'SET1 has the proper values.'
    end program demo_extract

Contents


Subroutines

public subroutine extract_64(new, old, start_pos, stop_pos, status)

Arguments

Type IntentOptional AttributesName
type(bitset_64), intent(out) :: new
type(bitset_64), intent(in) :: old
integer(kind=bits_kind), intent(in) :: start_pos
integer(kind=bits_kind), intent(in) :: stop_pos
integer, intent(out), optional :: status

public subroutine extract_large(new, old, start_pos, stop_pos, status)

Arguments

Type IntentOptional AttributesName
type(bitset_large), intent(out) :: new
type(bitset_large), intent(in) :: old
integer(kind=bits_kind), intent(in) :: start_pos
integer(kind=bits_kind), intent(in) :: stop_pos
integer, intent(out), optional :: status