home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdarg.h>
- #include "sets.h"
- /***************************************************************************/
- int set_member_count(set *aset)
- /***************************************************************************/
- /* Returns the number of members in a set */
- {
- int i,j,k;
- unsigned w;
-
- k = 0;
- /* go through the member records and count the '1' bits */
- for(i=0;i<aset->member_recs;i++)
- {
- w = 1;
- for(j=0;j<MEMBERS_PER_WORD;j++)
- {
- if((aset->word[i] & w) > 0)
- k++;
- w = w << 1;
- }
- }
-
- return k;
-
- } /* end set_member_count */
-
-