home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / cug / softt-12.lbr / SETINS.DQC / SETINS.DOC
Text File  |  1984-07-05  |  1KB  |  51 lines

  1. .he 'SET_INSERT'03/23/80'SET_INSERT'
  2. NAME
  3. .sp 
  4. set_insert - place given element in a set   
  5. .sp 2   
  6. SYNOPSIS
  7. .sp 
  8. .nf 
  9. subroutine set_insert (element, set)
  10. integer element 
  11. pointer set 
  12. .sp 2   
  13. .fi 
  14. DESCRIPTION 
  15. .sp 
  16. 'Set_insert' is the primary means of placing a given element
  17. in a set.   
  18. 'Element' must be an integer between one and the maximum size   
  19. of the set, inclusive;  
  20. 'set' must be a pointer to a set data structure created by  
  21. 'set_create'.   
  22. If it is within range, the given element is marked "present"
  23. in the bit vector associated with the set.  
  24. .sp 
  25. All set manipulation routines make use of dynamic storage,  
  26. which must be initialized before use.   
  27. See 'dsinit' for further information.   
  28. .sp 
  29. Note that all set manipulation routines have long names.
  30. To avoid unique name conflicts with other routines, any Ratfor  
  31. program using the set routines should include the following 
  32. statement:  
  33. .sp 
  34. .ti +5  
  35. include "=src=/lcl/lib/swtmlb.u/swtmlb_link.r.i"
  36. .sp 2   
  37. IMPLEMENTATION  
  38. .sp 
  39. If the element is out of range, a call to 'error' is made to
  40. inform the user and terminate the program.  
  41. Otherwise, the location of the element in the bit vector is determined  
  42. and a few logical operations are employed to set the selected bit.  
  43. .sp 2   
  44. CALLS   
  45. .sp 
  46. error   
  47. .sp 2   
  48. SEE ALSO
  49. .sp 
  50. other set routines ('set_?*') (4)   
  51.