PetscBT — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscBT

PETSc bitarrays, efficient storage of arrays of boolean values

## Synopsis

    typedef char *PetscBT;

## Notes

The following routines do not have their own manual pages

         PetscBTCreate(m,&bt)         - creates a bit array with enough room to hold m values
         PetscBTDestroy(&bt)          - destroys the bit array
         PetscBTMemzero(m,bt)         - zeros the entire bit array (sets all values to false)
         PetscBTSet(bt,index)         - sets a particular entry as true
         PetscBTClear(bt,index)       - sets a particular entry as false
         PetscBTLookup(bt,index)      - returns the value
         PetscBTLookupSet(bt,index)   - returns the value and then sets it true
         PetscBTLookupClear(bt,index) - returns the value and then sets it false
         PetscBTLength(m)             - returns number of bytes in array with m bits
         PetscBTView(m,bt,viewer)     - prints all the entries in a bit array

PETSc does not check error flags on `PetscBTLookup()`, `PetcBTLookupSet()`, `PetscBTLength()` because error checking would cost hundreds more cycles then the operation.

## Level

advanced

## Location

include/petscsystypes.h

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages