From cdff7d4b0f6b5f986d157e2e09cc6b4cf4d8a033 Mon Sep 17 00:00:00 2001
From: PBerger <philipp.berger@rwth-aachen.de>
Date: Wed, 27 Jul 2016 17:13:52 +0200
Subject: [PATCH] Added template specialization for getIdentity.

Former-commit-id: 082b985333d7d709d00b7bd84e38a64c1668ff1d
---
 src/storage/dd/DdManager.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/storage/dd/DdManager.cpp b/src/storage/dd/DdManager.cpp
index 5ad46ac53..0f1e65fee 100644
--- a/src/storage/dd/DdManager.cpp
+++ b/src/storage/dd/DdManager.cpp
@@ -106,6 +106,21 @@ namespace storm {
             return result;
         }
         
+#ifdef STORM_HAVE_CARL
+		template<DdType LibraryType>
+        template<>
+        Add<LibraryType, storm::RationalFunction> DdManager<LibraryType>::getIdentity(storm::expressions::Variable const& variable) const {
+            storm::dd::DdMetaVariable<LibraryType> const& metaVariable = this->getMetaVariable(variable);
+            
+            Add<LibraryType, storm::RationalFunction> result = this->getAddZero<storm::RationalFunction>();
+            for (int_fast64_t value = metaVariable.getLow(); value <= metaVariable.getHigh(); ++value) {
+				storm::RationalFunction constantFunction(value);
+                result += this->getEncoding(variable, value).template toAdd<ValueType>() * this->getConstant(constantFunction);
+            }
+            return result;
+        }
+#endif
+		
         template<DdType LibraryType>
         std::pair<storm::expressions::Variable, storm::expressions::Variable> DdManager<LibraryType>::addMetaVariable(std::string const& name, int_fast64_t low, int_fast64_t high) {
             // Check whether the variable name is legal.