Index: src/Fragmentation/Summation/Makefile.am
===================================================================
--- src/Fragmentation/Summation/Makefile.am	(revision 2df58073c4555585bcb4fd140b1cdabe8e1aae79)
+++ src/Fragmentation/Summation/Makefile.am	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
@@ -17,4 +17,5 @@
 	IndexSet.hpp \
 	IndexSetContainer.hpp \
+	SetValue.hpp \
 	SortedVector.hpp \
 	SubsetMap.hpp
Index: src/Fragmentation/Summation/SetValue.hpp
===================================================================
--- src/Fragmentation/Summation/SetValue.hpp	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
+++ src/Fragmentation/Summation/SetValue.hpp	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
@@ -0,0 +1,61 @@
+/*
+ * SetValue.hpp
+ *
+ *  Created on: Jun 25, 2012
+ *      Author: heber
+ */
+
+#ifndef SETVALUE_HPP_
+#define SETVALUE_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "IndexSet.hpp"
+
+template <class T>
+class SetValue
+{
+public:
+  SetValue(const IndexSet &_indices, const T &_value) :
+    value(_value),
+    indices(_indices)
+  {};
+
+  SetValue & operator+=(const SetValue &other) {
+    if (indices.contains(other.indices))
+      value += other.value;
+    return *this;
+  }
+
+  SetValue & operator-=(const SetValue &other) {
+    if (indices.contains(other.indices))
+      value -= other.value;
+    return *this;
+  }
+
+  const T getValue() const {
+    return value;
+  }
+
+  const IndexSet& getIndexSet() const {
+    return indices;
+  }
+
+protected:
+  void setValue(const T& _value) {
+    value = _value;
+  }
+
+  //!> value associated with this IndexSet
+  T value;
+private:
+  //!> reference to the index set
+  const IndexSet &indices;
+};
+
+
+#endif /* SETVALUE_HPP_ */
Index: src/Fragmentation/Summation/unittests/Makefile.am
===================================================================
--- src/Fragmentation/Summation/unittests/Makefile.am	(revision 2df58073c4555585bcb4fd140b1cdabe8e1aae79)
+++ src/Fragmentation/Summation/unittests/Makefile.am	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
@@ -10,4 +10,5 @@
 	../Fragmentation/unittests/IndexSetUnitTest.cpp \
 	../Fragmentation/unittests/IndexSetContainerUnitTest.cpp \
+	../Fragmentation/unittests/SetValueUnitTest.cpp \
 	../Fragmentation/unittests/SubsetMapUnitTest.cpp
 
@@ -15,4 +16,5 @@
 	../Fragmentation/unittests/IndexSetUnitTest.hpp \
 	../Fragmentation/unittests/IndexSetContainerUnitTest.cpp \
+	../Fragmentation/unittests/SetValueUnitTest.hpp \
 	../Fragmentation/unittests/SubsetMapUnitTest.hpp
 
@@ -20,4 +22,5 @@
   IndexSetUnitTest \
   IndexSetContainerUnitTest \
+  SetValueUnitTest \
   SubsetMapUnitTest
 
@@ -46,4 +49,9 @@
 IndexSetContainerUnitTest_LDADD = ${FRAGMENTATIONSUMMATIONLIBS}
 
+SetValueUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	unittests/SetValueUnitTest.cpp \
+	unittests/SetValueUnitTest.hpp \
+	SetValue.hpp
+SetValueUnitTest_LDADD = ${FRAGMENTATIONSUMMATIONLIBS}
 
 SubsetMapUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
Index: src/Fragmentation/Summation/unittests/SetValueUnitTest.cpp
===================================================================
--- src/Fragmentation/Summation/unittests/SetValueUnitTest.cpp	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
+++ src/Fragmentation/Summation/unittests/SetValueUnitTest.cpp	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
@@ -0,0 +1,100 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * SetValueUnitTest.cpp
+ *
+ *  Created on: Jun 27, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "Fragmentation/Summation/SetValue.hpp"
+
+#include "SetValueUnitTest.hpp"
+
+#include <boost/assign.hpp>
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+using namespace boost::assign;
+
+/********************************************** Test classes **************************************/
+
+enum { OTHER=2, VALUE = 4 };
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( SetValueTest );
+
+
+void SetValueTest::setUp()
+{
+  IndexSet set;
+  set += 1,2,3,4;
+  indices = new IndexSet( set );
+  value = new SetValue<int>(*indices, VALUE);
+};
+
+
+void SetValueTest::tearDown()
+{
+  delete value;
+  delete indices;
+};
+
+/** UnitTest for constructor
+ */
+void SetValueTest::constructorTest()
+{
+  CPPUNIT_ASSERT( value != NULL );
+  CPPUNIT_ASSERT_EQUAL( (int)VALUE, value->getValue() );
+
+};
+
+/** UnitTest for operator()
+ */
+void SetValueTest::operatorTest()
+{
+  SetValue<int> other(*indices, OTHER);
+
+  // operator-=
+  other -= *value;
+  CPPUNIT_ASSERT_EQUAL( (int)OTHER - (int)VALUE, other.getValue() );
+  CPPUNIT_ASSERT_EQUAL( (int)VALUE, value->getValue() );
+
+  // operator+=
+  *value -= other;
+  CPPUNIT_ASSERT_EQUAL( (int)OTHER - (int)VALUE, other.getValue() );
+  CPPUNIT_ASSERT_EQUAL( (int)VALUE - ((int)OTHER - (int)VALUE), value->getValue() );
+};
Index: src/Fragmentation/Summation/unittests/SetValueUnitTest.hpp
===================================================================
--- src/Fragmentation/Summation/unittests/SetValueUnitTest.hpp	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
+++ src/Fragmentation/Summation/unittests/SetValueUnitTest.hpp	(revision d699deb0842e7f1db520bb6cbef3956df3ea6202)
@@ -0,0 +1,44 @@
+/*
+ * SetValueUnitTest.hpp
+ *
+ *  Created on: Jun 27, 2012
+ *      Author: heber
+ */
+
+#ifndef SETVALUEUNITTEST_HPP_
+#define SETVALUEUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "Fragmentation/Summation/SetValue.hpp"
+
+class IndexSet;
+
+/********************************************** Test classes **************************************/
+
+class SetValueTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( SetValueTest) ;
+    CPPUNIT_TEST ( constructorTest );
+    CPPUNIT_TEST ( operatorTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void constructorTest();
+      void operatorTest();
+
+private:
+      IndexSet *indices;
+      SetValue<int> *value;
+
+};
+
+#endif /* SETVALUEUNITTEST_HPP_ */
