Index: /trunk/psLib/src/collections/psBitSet.c
===================================================================
--- /trunk/psLib/src/collections/psBitSet.c	(revision 1171)
+++ /trunk/psLib/src/collections/psBitSet.c	(revision 1172)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-01 00:57:31 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-01 21:48:11 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -86,5 +86,5 @@
 
     if(n <= 0) {
-        psError(__func__, " : Line %d - Allocation size must be > 0: size = %d\n", __LINE__, n);
+        psError(__func__, " : Line %d - Allocation size must be > 0: size = %d", __LINE__, n);
         return 0;
     }
@@ -113,5 +113,5 @@
 {
     if(inBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument\n", __LINE__);
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return;
     }
@@ -124,11 +124,11 @@
 
     if(inBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument\n", __LINE__);
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return inBitSet;
     } else if(bit < 0) {
-        psError(__func__, " : Line %d - Bit position too small: %d\n", __LINE__, bit);
+        psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
         return inBitSet;
     } else if(bit > inBitSet->n*8-1) {
-        psError(__func__, " : Line %d - Bit position too large: %d\n", __LINE__, bit);
+        psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
         return inBitSet;
     }
@@ -146,11 +146,11 @@
 
     if(inBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument\n", __LINE__);
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return 0;
     } else if(bit < 0) {
-        psError(__func__, " : Line %d - Bit position too small: %d\n", __LINE__, bit);
+        psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
         return 0;
     } else if(bit > inBitSet->n*8-1) {
-        psError(__func__, " : Line %d - Bit position too large: %d\n", __LINE__, bit);
+        psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
         return 0;
     }
@@ -175,11 +175,6 @@
     char *inBits2 = NULL;
 
-    if(outBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for outBitSet argument\n", __LINE__);
-        return outBitSet;
-    }
-
     if(inBitSet1 == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet1 argument\n", __LINE__);
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet1 argument", __LINE__);
         return outBitSet;
     }
@@ -191,10 +186,14 @@
 
     if(inBitSet2 == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet2 argument\n", __LINE__);
-        return outBitSet;
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet2 argument", __LINE__);
+        return outBitSet;
+    }
+
+    if(outBitSet == NULL) {
+        outBitSet = psBitSetAlloc(inBitSet1->n*8);
     }
 
     if(inBitSet1->n != inBitSet2->n || outBitSet->n != inBitSet1->n) {
-        psError(__func__, " : Line %d - psBitSet sizes not the same\n", __LINE__);
+        psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__);
         return outBitSet;
     }
@@ -223,5 +222,42 @@
         break;
     default:
-        psError(__func__, " : Line %d - Invalid psBitMask binary operation: %s\n", __LINE__, operator);
+        psError(__func__, " : Line %d - Invalid psBitMask binary operation: %s", __LINE__, operator);
+    }
+
+    return outBitSet;
+}
+
+psBitSet* psBitSetNot(psBitSet *outBitSet, const psBitSet *restrict inBitSet)
+{
+    int i = 0;
+    int n = 0;
+    char *outBits = NULL;
+    char *inBits = NULL;
+
+    if(inBitSet == NULL) {
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
+        return outBitSet;
+    }
+
+    n = inBitSet->n;
+    if(n == 0) {
+        psError(__func__, " : Line %d - No elements in inBitSet", __LINE__);
+        return outBitSet;
+    }
+
+    if(outBitSet == NULL) {
+        outBitSet = psBitSetAlloc(n*8);
+    }
+
+    if(inBitSet->n != outBitSet->n) {
+        psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__);
+        return outBitSet;
+    }
+
+    outBits = outBitSet->bits;
+    inBits = inBitSet->bits;
+
+    for(i=0; i<n; i++) {
+        outBits[i] = ~inBits[i];
     }
 
Index: /trunk/psLib/src/collections/psBitSet.h
===================================================================
--- /trunk/psLib/src/collections/psBitSet.h	(revision 1171)
+++ /trunk/psLib/src/collections/psBitSet.h	(revision 1172)
@@ -12,6 +12,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-01 00:45:32 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-01 21:48:11 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -97,4 +97,15 @@
 );
 
+/** Perform a not operation on a psBitSet
+ *
+ *  Toggles bits in a psBitset. All zero bits are set to one and all one bits are set to zero.
+ *
+ *  @return  psBitSet*: Pointer to struct containing result of operation.
+ */
+psBitSet* psBitSetNot(
+    psBitSet *outBitSet,                /**< Resulting psBitSet from operation */
+    const psBitSet *restrict inBitSet   /**< Input psBitSet */
+);
+
 /** Convert the psBitSet to a string of ones and zeros.
  *
Index: /trunk/psLib/src/types/psBitSet.c
===================================================================
--- /trunk/psLib/src/types/psBitSet.c	(revision 1171)
+++ /trunk/psLib/src/types/psBitSet.c	(revision 1172)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-01 00:57:31 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-01 21:48:11 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -86,5 +86,5 @@
 
     if(n <= 0) {
-        psError(__func__, " : Line %d - Allocation size must be > 0: size = %d\n", __LINE__, n);
+        psError(__func__, " : Line %d - Allocation size must be > 0: size = %d", __LINE__, n);
         return 0;
     }
@@ -113,5 +113,5 @@
 {
     if(inBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument\n", __LINE__);
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return;
     }
@@ -124,11 +124,11 @@
 
     if(inBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument\n", __LINE__);
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return inBitSet;
     } else if(bit < 0) {
-        psError(__func__, " : Line %d - Bit position too small: %d\n", __LINE__, bit);
+        psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
         return inBitSet;
     } else if(bit > inBitSet->n*8-1) {
-        psError(__func__, " : Line %d - Bit position too large: %d\n", __LINE__, bit);
+        psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
         return inBitSet;
     }
@@ -146,11 +146,11 @@
 
     if(inBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument\n", __LINE__);
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return 0;
     } else if(bit < 0) {
-        psError(__func__, " : Line %d - Bit position too small: %d\n", __LINE__, bit);
+        psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
         return 0;
     } else if(bit > inBitSet->n*8-1) {
-        psError(__func__, " : Line %d - Bit position too large: %d\n", __LINE__, bit);
+        psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
         return 0;
     }
@@ -175,11 +175,6 @@
     char *inBits2 = NULL;
 
-    if(outBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for outBitSet argument\n", __LINE__);
-        return outBitSet;
-    }
-
     if(inBitSet1 == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet1 argument\n", __LINE__);
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet1 argument", __LINE__);
         return outBitSet;
     }
@@ -191,10 +186,14 @@
 
     if(inBitSet2 == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet2 argument\n", __LINE__);
-        return outBitSet;
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet2 argument", __LINE__);
+        return outBitSet;
+    }
+
+    if(outBitSet == NULL) {
+        outBitSet = psBitSetAlloc(inBitSet1->n*8);
     }
 
     if(inBitSet1->n != inBitSet2->n || outBitSet->n != inBitSet1->n) {
-        psError(__func__, " : Line %d - psBitSet sizes not the same\n", __LINE__);
+        psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__);
         return outBitSet;
     }
@@ -223,5 +222,42 @@
         break;
     default:
-        psError(__func__, " : Line %d - Invalid psBitMask binary operation: %s\n", __LINE__, operator);
+        psError(__func__, " : Line %d - Invalid psBitMask binary operation: %s", __LINE__, operator);
+    }
+
+    return outBitSet;
+}
+
+psBitSet* psBitSetNot(psBitSet *outBitSet, const psBitSet *restrict inBitSet)
+{
+    int i = 0;
+    int n = 0;
+    char *outBits = NULL;
+    char *inBits = NULL;
+
+    if(inBitSet == NULL) {
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
+        return outBitSet;
+    }
+
+    n = inBitSet->n;
+    if(n == 0) {
+        psError(__func__, " : Line %d - No elements in inBitSet", __LINE__);
+        return outBitSet;
+    }
+
+    if(outBitSet == NULL) {
+        outBitSet = psBitSetAlloc(n*8);
+    }
+
+    if(inBitSet->n != outBitSet->n) {
+        psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__);
+        return outBitSet;
+    }
+
+    outBits = outBitSet->bits;
+    inBits = inBitSet->bits;
+
+    for(i=0; i<n; i++) {
+        outBits[i] = ~inBits[i];
     }
 
Index: /trunk/psLib/src/types/psBitSet.h
===================================================================
--- /trunk/psLib/src/types/psBitSet.h	(revision 1171)
+++ /trunk/psLib/src/types/psBitSet.h	(revision 1172)
@@ -12,6 +12,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-01 00:45:32 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-01 21:48:11 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -97,4 +97,15 @@
 );
 
+/** Perform a not operation on a psBitSet
+ *
+ *  Toggles bits in a psBitset. All zero bits are set to one and all one bits are set to zero.
+ *
+ *  @return  psBitSet*: Pointer to struct containing result of operation.
+ */
+psBitSet* psBitSetNot(
+    psBitSet *outBitSet,                /**< Resulting psBitSet from operation */
+    const psBitSet *restrict inBitSet   /**< Input psBitSet */
+);
+
 /** Convert the psBitSet to a string of ones and zeros.
  *
