18template<
typename ValueType>
20 : ddManager(ddManager), cuddAdd(cuddAdd) {
24template<
typename ValueType>
25bool InternalAdd<DdType::CUDD, ValueType>::operator==(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
26 return this->getCuddAdd() == other.getCuddAdd();
29template<
typename ValueType>
30bool InternalAdd<DdType::CUDD, ValueType>::operator!=(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
31 return !(*
this == other);
34template<
typename ValueType>
35InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::operator+(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
36 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd() + other.getCuddAdd());
39template<
typename ValueType>
40InternalAdd<DdType::CUDD, ValueType>& InternalAdd<DdType::CUDD, ValueType>::operator+=(InternalAdd<DdType::CUDD, ValueType>
const& other) {
41 this->cuddAdd = this->getCuddAdd() + other.getCuddAdd();
45template<
typename ValueType>
46InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::operator*(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
47 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd() * other.getCuddAdd());
50template<
typename ValueType>
51InternalAdd<DdType::CUDD, ValueType>& InternalAdd<DdType::CUDD, ValueType>::operator*=(InternalAdd<DdType::CUDD, ValueType>
const& other) {
52 this->cuddAdd = this->getCuddAdd() * other.getCuddAdd();
56template<
typename ValueType>
57InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::operator-(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
58 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd() - other.getCuddAdd());
61template<
typename ValueType>
62InternalAdd<DdType::CUDD, ValueType>& InternalAdd<DdType::CUDD, ValueType>::operator-=(InternalAdd<DdType::CUDD, ValueType>
const& other) {
63 this->cuddAdd = this->getCuddAdd() - other.getCuddAdd();
67template<
typename ValueType>
68InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::operator/(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
69 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().
Divide(other.getCuddAdd()));
72template<
typename ValueType>
73InternalAdd<DdType::CUDD, ValueType>& InternalAdd<DdType::CUDD, ValueType>::operator/=(InternalAdd<DdType::CUDD, ValueType>
const& other) {
74 this->cuddAdd = this->getCuddAdd().Divide(other.getCuddAdd());
78template<
typename ValueType>
79InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::equals(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
80 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().EqualsBdd(other.getCuddAdd()));
83template<
typename ValueType>
84InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::notEquals(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
85 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().NotEqualsBdd(other.getCuddAdd()));
88template<
typename ValueType>
89InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::less(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
90 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().LessThanBdd(other.getCuddAdd()));
93template<
typename ValueType>
94InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::lessOrEqual(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
95 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().LessThanOrEqualBdd(other.getCuddAdd()));
98template<
typename ValueType>
99InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::greater(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
100 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().GreaterThanBdd(other.getCuddAdd()));
103template<
typename ValueType>
104InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::greaterOrEqual(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
105 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().GreaterThanOrEqualBdd(other.getCuddAdd()));
108template<
typename ValueType>
109InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::pow(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
110 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().Pow(other.getCuddAdd()));
113template<
typename ValueType>
114InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::mod(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
115 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().Mod(other.getCuddAdd()));
118template<
typename ValueType>
119InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::logxy(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
120 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().LogXY(other.getCuddAdd()));
123template<
typename ValueType>
124InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::floor()
const {
125 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().
Floor());
128template<
typename ValueType>
129InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::ceil()
const {
130 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().
Ceil());
133template<
typename ValueType>
134InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::minimum(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
135 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().
Minimum(other.getCuddAdd()));
138template<
typename ValueType>
139InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::maximum(InternalAdd<DdType::CUDD, ValueType>
const& other)
const {
140 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().
Maximum(other.getCuddAdd()));
143template<
typename ValueType>
144template<
typename TargetValueType>
145typename std::enable_if<std::is_same<ValueType, TargetValueType>::value, InternalAdd<DdType::CUDD, TargetValueType>>
147 ::type InternalAdd<DdType::CUDD, ValueType>::toValueType()
const {
151template<
typename ValueType>
152template<
typename TargetValueType>
153typename std::enable_if<!std::is_same<ValueType, TargetValueType>::value, InternalAdd<DdType::CUDD, TargetValueType>>
155 ::type InternalAdd<DdType::CUDD, ValueType>::toValueType()
const {
156 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation not supported.");
159template<
typename ValueType>
160InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::sumAbstract(InternalBdd<DdType::CUDD>
const& cube)
const {
161 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().ExistAbstract(cube.toAdd<ValueType>().getCuddAdd()));
164template<
typename ValueType>
165InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::minAbstract(InternalBdd<DdType::CUDD>
const& cube)
const {
166 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().MinAbstract(cube.toAdd<ValueType>().getCuddAdd()));
169template<
typename ValueType>
170InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::minAbstractRepresentative(InternalBdd<DdType::CUDD>
const& cube)
const {
171 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().MinAbstractRepresentative(cube.toAdd<ValueType>().getCuddAdd()));
174template<
typename ValueType>
175InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::maxAbstract(InternalBdd<DdType::CUDD>
const& cube)
const {
176 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().MaxAbstract(cube.toAdd<ValueType>().getCuddAdd()));
179template<
typename ValueType>
180InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::maxAbstractRepresentative(InternalBdd<DdType::CUDD>
const& cube)
const {
181 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().MaxAbstractRepresentative(cube.toAdd<ValueType>().getCuddAdd()));
184template<
typename ValueType>
185bool InternalAdd<DdType::CUDD, ValueType>::equalModuloPrecision(InternalAdd<DdType::CUDD, ValueType>
const& other, ValueType
const& precision,
186 bool relative)
const {
188 return this->getCuddAdd().EqualSupNormRel(other.getCuddAdd(), precision);
190 return this->getCuddAdd().EqualSupNorm(other.getCuddAdd(), precision);
194template<
typename ValueType>
195InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::swapVariables(std::vector<InternalBdd<DdType::CUDD>>
const& from,
196 std::vector<InternalBdd<DdType::CUDD>>
const& to)
const {
197 std::vector<cudd::ADD> fromAdd;
198 std::vector<cudd::ADD> toAdd;
199 STORM_LOG_ASSERT(fromAdd.size() == toAdd.size(),
"Sizes of vectors do not match.");
200 for (
auto it1 = from.begin(), ite1 = from.end(), it2 = to.begin(); it1 != ite1; ++it1, ++it2) {
201 fromAdd.push_back(it1->getCuddBdd().Add());
202 toAdd.push_back(it2->getCuddBdd().Add());
204 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().SwapVariables(fromAdd, toAdd));
207template<
typename ValueType>
208InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::permuteVariables(std::vector<InternalBdd<DdType::CUDD>>
const& from,
209 std::vector<InternalBdd<DdType::CUDD>>
const& to)
const {
211 uint64_t numberOfVariables = ddManager->getCuddManager().ReadSize();
212 int* permutation =
new int[numberOfVariables];
213 for (uint64_t variable = 0; variable < numberOfVariables; ++variable) {
214 permutation[variable] = variable;
217 for (
auto it1 = from.begin(), ite1 = from.end(), it2 = to.begin(); it1 != ite1; ++it1, ++it2) {
218 permutation[it1->getIndex()] = it2->getIndex();
220 InternalAdd<DdType::CUDD, ValueType> result(ddManager, this->getCuddAdd().Permute(permutation));
222 delete[] permutation;
226template<
typename ValueType>
227InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::multiplyMatrix(
228 InternalAdd<DdType::CUDD, ValueType>
const& otherMatrix, std::vector<InternalBdd<DdType::CUDD>>
const& summationDdVariables)
const {
230 std::vector<cudd::ADD> summationAdds;
231 for (
auto const& ddVariable : summationDdVariables) {
232 summationAdds.push_back(ddVariable.toAdd<ValueType>().getCuddAdd());
237 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().MatrixMultiply(otherMatrix.getCuddAdd(), summationAdds));
240template<
typename ValueType>
241InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::multiplyMatrix(
242 InternalBdd<DdType::CUDD>
const& otherMatrix, std::vector<InternalBdd<DdType::CUDD>>
const& summationDdVariables)
const {
243 return this->multiplyMatrix(otherMatrix.template toAdd<ValueType>(), summationDdVariables);
246template<
typename ValueType>
247InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::greater(ValueType
const& value)
const {
248 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().BddStrictThreshold(value));
251template<
typename ValueType>
252InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::greaterOrEqual(ValueType
const& value)
const {
253 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().BddThreshold(value));
256template<
typename ValueType>
257InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::less(ValueType
const& value)
const {
258 return InternalBdd<DdType::CUDD>(ddManager, ~this->getCuddAdd().BddThreshold(value));
261template<
typename ValueType>
262InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::lessOrEqual(ValueType
const& value)
const {
263 return InternalBdd<DdType::CUDD>(ddManager, ~this->getCuddAdd().BddStrictThreshold(value));
266template<
typename ValueType>
267InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::notZero()
const {
268 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().BddPattern());
271template<
typename ValueType>
272InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::constrain(InternalAdd<DdType::CUDD, ValueType>
const& constraint)
const {
273 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().Constrain(constraint.getCuddAdd()));
276template<
typename ValueType>
277InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::restrict(InternalAdd<DdType::CUDD, ValueType>
const& constraint)
const {
278 return InternalAdd<DdType::CUDD, ValueType>(ddManager, this->getCuddAdd().Restrict(constraint.getCuddAdd()));
281template<
typename ValueType>
282InternalBdd<DdType::CUDD> InternalAdd<DdType::CUDD, ValueType>::getSupport()
const {
283 return InternalBdd<DdType::CUDD>(ddManager, this->getCuddAdd().Support());
286template<
typename ValueType>
287uint_fast64_t InternalAdd<DdType::CUDD, ValueType>::getNonZeroCount(uint_fast64_t numberOfDdVariables)
const {
290 if (numberOfDdVariables == 0) {
293 return static_cast<uint_fast64_t
>(this->getCuddAdd().CountMinterm(
static_cast<int>(numberOfDdVariables)));
296template<
typename ValueType>
297uint_fast64_t InternalAdd<DdType::CUDD, ValueType>::getLeafCount()
const {
298 return static_cast<uint_fast64_t
>(this->getCuddAdd().CountLeaves());
301template<
typename ValueType>
302uint_fast64_t InternalAdd<DdType::CUDD, ValueType>::getNodeCount()
const {
303 return static_cast<uint_fast64_t
>(this->getCuddAdd().nodeCount());
306template<
typename ValueType>
307ValueType InternalAdd<DdType::CUDD, ValueType>::getMin()
const {
308 cudd::ADD constantMinAdd = this->getCuddAdd().FindMin();
312template<
typename ValueType>
313ValueType InternalAdd<DdType::CUDD, ValueType>::getMax()
const {
314 cudd::ADD constantMaxAdd = this->getCuddAdd().FindMax();
318template<
typename ValueType>
319ValueType InternalAdd<DdType::CUDD, ValueType>::getValue()
const {
323template<
typename ValueType>
324bool InternalAdd<DdType::CUDD, ValueType>::isOne()
const {
325 return this->getCuddAdd().IsOne();
328template<
typename ValueType>
329bool InternalAdd<DdType::CUDD, ValueType>::isZero()
const {
330 return this->getCuddAdd().IsZero();
333template<
typename ValueType>
334bool InternalAdd<DdType::CUDD, ValueType>::isConstant()
const {
335 return Cudd_IsConstant(this->getCuddAdd().getNode());
338template<
typename ValueType>
339uint_fast64_t InternalAdd<DdType::CUDD, ValueType>::getIndex()
const {
340 return static_cast<uint_fast64_t
>(this->getCuddAdd().NodeReadIndex());
343template<
typename ValueType>
344uint_fast64_t InternalAdd<DdType::CUDD, ValueType>::getLevel()
const {
345 return static_cast<uint_fast64_t
>(ddManager->getCuddManager().ReadPerm(this->getIndex()));
348template<
typename ValueType>
349void InternalAdd<DdType::CUDD, ValueType>::exportToDot(std::string
const& filename, std::vector<std::string>
const& ddVariableNamesAsStrings,
350 bool showVariablesIfPossible)
const {
352 std::vector<char*> ddNames;
353 std::string ddName(
"f");
354 ddNames.push_back(
new char[ddName.size() + 1]);
355 std::copy(ddName.c_str(), ddName.c_str() + 2, ddNames.back());
358 std::vector<char*> ddVariableNames;
359 for (
auto const& element : ddVariableNamesAsStrings) {
360 ddVariableNames.push_back(
new char[element.size() + 1]);
361 std::copy(element.c_str(), element.c_str() + element.size() + 1, ddVariableNames.back());
365 FILE* filePointer = fopen(filename.c_str(),
"w");
366 std::vector<cudd::ADD> cuddAddVector = {this->getCuddAdd()};
367 if (showVariablesIfPossible) {
368 ddManager->getCuddManager().DumpDot(cuddAddVector, ddVariableNames.data(), &ddNames[0], filePointer);
370 ddManager->getCuddManager().DumpDot(cuddAddVector,
nullptr, &ddNames[0], filePointer);
375 for (
char* element : ddNames) {
378 for (
char* element : ddVariableNames) {
383template<
typename ValueType>
384void InternalAdd<DdType::CUDD, ValueType>::exportToText(std::string
const&)
const {
385 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Operation not supported.");
388template<
typename ValueType>
389AddIterator<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::begin(DdManager<DdType::CUDD>
const& fullDdManager, InternalBdd<DdType::CUDD>
const&,
390 uint_fast64_t, std::set<storm::expressions::Variable>
const& metaVariables,
391 bool enumerateDontCareMetaVariables)
const {
394 DdGen* generator = this->getCuddAdd().FirstCube(&cube, &value);
396 (Cudd_IsGenEmpty(generator) != 0), &metaVariables, enumerateDontCareMetaVariables);
399template<
typename ValueType>
400AddIterator<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::end(DdManager<DdType::CUDD>
const& fullDdManager)
const {
401 return AddIterator<DdType::CUDD, ValueType>(fullDdManager,
nullptr,
nullptr, 0,
true,
nullptr,
false);
404template<
typename ValueType>
405cudd::ADD InternalAdd<DdType::CUDD, ValueType>::getCuddAdd()
const {
406 return this->cuddAdd;
409template<
typename ValueType>
410DdNode* InternalAdd<DdType::CUDD, ValueType>::getCuddDdNode()
const {
411 return this->getCuddAdd().getNode();
414template<
typename ValueType>
415std::string InternalAdd<DdType::CUDD, ValueType>::getStringId()
const {
416 std::stringstream ss;
417 ss << this->getCuddDdNode();
421template<
typename ValueType>
422Odd InternalAdd<DdType::CUDD, ValueType>::createOdd(std::vector<uint_fast64_t>
const& ddVariableIndices)
const {
424 std::vector<std::unordered_map<DdNode*, std::shared_ptr<Odd>>> uniqueTableForLevels(ddVariableIndices.size() + 1);
427 std::shared_ptr<Odd> rootOdd =
428 createOddRec(this->getCuddDdNode(), ddManager->getCuddManager(), 0, ddVariableIndices.size(), ddVariableIndices, uniqueTableForLevels);
431 return Odd(*rootOdd);
434template<
typename ValueType>
435std::shared_ptr<Odd> InternalAdd<DdType::CUDD, ValueType>::createOddRec(DdNode* dd, cudd::Cudd
const& manager, uint_fast64_t currentLevel,
436 uint_fast64_t maxLevel, std::vector<uint_fast64_t>
const& ddVariableIndices,
437 std::vector<std::unordered_map<DdNode*, std::shared_ptr<Odd>>>& uniqueTableForLevels) {
439 auto const& iterator = uniqueTableForLevels[currentLevel].find(dd);
440 if (iterator != uniqueTableForLevels[currentLevel].end()) {
441 return iterator->second;
447 if (currentLevel == maxLevel) {
448 uint_fast64_t elseOffset = 0;
449 uint_fast64_t thenOffset = 0;
452 if (dd != Cudd_ReadZero(
manager.getManager())) {
456 auto oddNode = std::make_shared<Odd>(
nullptr, elseOffset,
nullptr, thenOffset);
457 uniqueTableForLevels[currentLevel].emplace(dd, oddNode);
459 }
else if (ddVariableIndices[currentLevel] < Cudd_NodeReadIndex(dd)) {
462 std::shared_ptr<Odd> elseNode = createOddRec(dd, manager, currentLevel + 1, maxLevel, ddVariableIndices, uniqueTableForLevels);
463 std::shared_ptr<Odd> thenNode = elseNode;
464 auto oddNode = std::make_shared<Odd>(elseNode, elseNode->getElseOffset() + elseNode->getThenOffset(), thenNode,
465 thenNode->getElseOffset() + thenNode->getThenOffset());
466 uniqueTableForLevels[currentLevel].emplace(dd, oddNode);
470 std::shared_ptr<Odd> elseNode = createOddRec(Cudd_E(dd), manager, currentLevel + 1, maxLevel, ddVariableIndices, uniqueTableForLevels);
471 std::shared_ptr<Odd> thenNode = createOddRec(Cudd_T(dd), manager, currentLevel + 1, maxLevel, ddVariableIndices, uniqueTableForLevels);
473 uint_fast64_t totalElseOffset = elseNode->getElseOffset() + elseNode->getThenOffset();
474 uint_fast64_t totalThenOffset = thenNode->getElseOffset() + thenNode->getThenOffset();
476 auto oddNode = std::make_shared<Odd>(elseNode, totalElseOffset, thenNode, totalThenOffset);
477 uniqueTableForLevels[currentLevel].emplace(dd, oddNode);
483template<
typename ValueType>
484InternalDdManager<DdType::CUDD>
const& InternalAdd<DdType::CUDD, ValueType>::getInternalDdManager()
const {
488template<
typename ValueType>
489void InternalAdd<DdType::CUDD, ValueType>::composeWithExplicitVector(
storm::dd::Odd const& odd, std::vector<uint_fast64_t>
const& ddVariableIndices,
490 std::vector<ValueType>& targetVector,
491 std::function<
ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
492 forEachRec(this->getCuddDdNode(), 0, ddVariableIndices.size(), 0, odd, ddVariableIndices,
493 [&function, &targetVector](uint64_t
const& offset, ValueType
const& value) { targetVector[offset] = function(targetVector[offset], value); });
496template<
typename ValueType>
497void InternalAdd<DdType::CUDD, ValueType>::forEach(Odd
const& odd, std::vector<uint_fast64_t>
const& ddVariableIndices,
498 std::function<
void(uint64_t
const&, ValueType
const&)>
const& function)
const {
499 forEachRec(this->getCuddDdNode(), 0, ddVariableIndices.size(), 0, odd, ddVariableIndices, function);
502template<
typename ValueType>
503void InternalAdd<DdType::CUDD, ValueType>::composeWithExplicitVector(
storm::dd::Odd const& odd, std::vector<uint_fast64_t>
const& ddVariableIndices,
504 std::vector<uint_fast64_t>
const& offsets, std::vector<ValueType>& targetVector,
505 std::function<
ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
506 forEachRec(this->getCuddDdNode(), 0, ddVariableIndices.size(), 0, odd, ddVariableIndices,
507 [&function, &targetVector, &offsets](uint64_t
const& offset, ValueType
const& value) {
508 ValueType& targetValue = targetVector[offsets[offset]];
509 targetValue = function(targetValue, value);
513template<
typename ValueType>
514void InternalAdd<DdType::CUDD, ValueType>::forEachRec(DdNode
const* dd, uint_fast64_t currentLevel, uint_fast64_t maxLevel, uint_fast64_t currentOffset,
515 Odd
const& odd, std::vector<uint_fast64_t>
const& ddVariableIndices,
516 std::function<
void(uint64_t
const&, ValueType
const&)>
const& function)
const {
518 if (dd == Cudd_ReadZero(ddManager->getCuddManager().getManager())) {
523 if (currentLevel == maxLevel) {
525 }
else if (ddVariableIndices[currentLevel] < Cudd_NodeReadIndex(dd)) {
528 forEachRec(dd, currentLevel + 1, maxLevel, currentOffset, odd.getElseSuccessor(), ddVariableIndices, function);
529 forEachRec(dd, currentLevel + 1, maxLevel, currentOffset + odd.getElseOffset(), odd.getThenSuccessor(), ddVariableIndices, function);
532 forEachRec(Cudd_E_const(dd), currentLevel + 1, maxLevel, currentOffset, odd.getElseSuccessor(), ddVariableIndices, function);
533 forEachRec(Cudd_T_const(dd), currentLevel + 1, maxLevel, currentOffset + odd.getElseOffset(), odd.getThenSuccessor(), ddVariableIndices, function);
537template<
typename ValueType>
538std::vector<uint64_t> InternalAdd<DdType::CUDD, ValueType>::decodeGroupLabels(std::vector<uint_fast64_t>
const& ddGroupVariableIndices,
540 std::vector<uint64_t> result;
541 decodeGroupLabelsRec(this->getCuddDdNode(), result, ddGroupVariableIndices, ddLabelVariableIndices, 0, ddGroupVariableIndices.size(), 0);
545template<
typename ValueType>
546void InternalAdd<DdType::CUDD, ValueType>::decodeGroupLabelsRec(DdNode* dd, std::vector<uint64_t>& labels,
547 std::vector<uint_fast64_t>
const& ddGroupVariableIndices,
549 uint_fast64_t maxLevel, uint64_t label)
const {
551 if (dd == Cudd_ReadZero(ddManager->getCuddManager().getManager())) {
555 if (currentLevel == maxLevel) {
556 labels.push_back(label);
558 uint64_t elseLabel = label;
559 uint64_t thenLabel = label;
561 if (ddLabelVariableIndices.
get(currentLevel)) {
563 thenLabel = (thenLabel << 1) | 1;
566 if (ddGroupVariableIndices[currentLevel] < Cudd_NodeReadIndex(dd)) {
567 decodeGroupLabelsRec(dd, labels, ddGroupVariableIndices, ddLabelVariableIndices, currentLevel + 1, maxLevel, elseLabel);
568 decodeGroupLabelsRec(dd, labels, ddGroupVariableIndices, ddLabelVariableIndices, currentLevel + 1, maxLevel, thenLabel);
570 decodeGroupLabelsRec(Cudd_E(dd), labels, ddGroupVariableIndices, ddLabelVariableIndices, currentLevel + 1, maxLevel, elseLabel);
571 decodeGroupLabelsRec(Cudd_T(dd), labels, ddGroupVariableIndices, ddLabelVariableIndices, currentLevel + 1, maxLevel, thenLabel);
576template<
typename ValueType>
577std::vector<InternalAdd<DdType::CUDD, ValueType>> InternalAdd<DdType::CUDD, ValueType>::splitIntoGroups(
578 std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
579 std::vector<InternalAdd<DdType::CUDD, ValueType>> result;
580 splitIntoGroupsRec(this->getCuddDdNode(), result, ddGroupVariableIndices, 0, ddGroupVariableIndices.size());
584template<
typename ValueType>
585void InternalAdd<DdType::CUDD, ValueType>::splitIntoGroupsRec(DdNode* dd, std::vector<InternalAdd<DdType::CUDD, ValueType>>& groups,
586 std::vector<uint_fast64_t>
const& ddGroupVariableIndices, uint_fast64_t currentLevel,
587 uint_fast64_t maxLevel)
const {
589 if (dd == Cudd_ReadZero(ddManager->getCuddManager().getManager())) {
593 if (currentLevel == maxLevel) {
594 groups.push_back(InternalAdd<DdType::CUDD, ValueType>(ddManager, cudd::ADD(ddManager->getCuddManager(), dd)));
595 }
else if (ddGroupVariableIndices[currentLevel] < Cudd_NodeReadIndex(dd)) {
596 splitIntoGroupsRec(dd, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
597 splitIntoGroupsRec(dd, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
601 splitIntoGroupsRec(Cudd_E(dd), groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
602 splitIntoGroupsRec(Cudd_T(dd), groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
606template<
typename ValueType>
607std::vector<std::pair<InternalAdd<DdType::CUDD, ValueType>, InternalAdd<DdType::CUDD, ValueType>>> InternalAdd<DdType::CUDD, ValueType>::splitIntoGroups(
608 InternalAdd<DdType::CUDD, ValueType> vector, std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
609 std::vector<std::pair<InternalAdd<DdType::CUDD, ValueType>, InternalAdd<DdType::CUDD, ValueType>>> result;
610 splitIntoGroupsRec(this->getCuddDdNode(), vector.getCuddDdNode(), result, ddGroupVariableIndices, 0, ddGroupVariableIndices.size());
614template<
typename ValueType>
615void InternalAdd<DdType::CUDD, ValueType>::splitIntoGroupsRec(
616 DdNode* dd1, DdNode* dd2, std::vector<std::pair<InternalAdd<DdType::CUDD, ValueType>, InternalAdd<DdType::CUDD, ValueType>>>& groups,
617 std::vector<uint_fast64_t>
const& ddGroupVariableIndices, uint_fast64_t currentLevel, uint_fast64_t maxLevel)
const {
619 if (dd1 == Cudd_ReadZero(ddManager->getCuddManager().getManager()) && dd2 == Cudd_ReadZero(ddManager->getCuddManager().getManager())) {
623 if (currentLevel == maxLevel) {
624 groups.push_back(std::make_pair(InternalAdd<DdType::CUDD, ValueType>(ddManager, cudd::ADD(ddManager->getCuddManager(), dd1)),
625 InternalAdd<DdType::CUDD, ValueType>(ddManager, cudd::ADD(ddManager->getCuddManager(), dd2))));
626 }
else if (ddGroupVariableIndices[currentLevel] < Cudd_NodeReadIndex(dd1)) {
627 if (ddGroupVariableIndices[currentLevel] < Cudd_NodeReadIndex(dd2)) {
628 splitIntoGroupsRec(dd1, dd2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
629 splitIntoGroupsRec(dd1, dd2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
631 splitIntoGroupsRec(dd1, Cudd_T(dd2), groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
632 splitIntoGroupsRec(dd1, Cudd_E(dd2), groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
634 }
else if (ddGroupVariableIndices[currentLevel] < Cudd_NodeReadIndex(dd2)) {
635 splitIntoGroupsRec(Cudd_T(dd1), dd2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
636 splitIntoGroupsRec(Cudd_E(dd1), dd2, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
638 splitIntoGroupsRec(Cudd_T(dd1), Cudd_T(dd2), groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
639 splitIntoGroupsRec(Cudd_E(dd1), Cudd_E(dd2), groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
643template<
typename ValueType>
644std::vector<std::vector<InternalAdd<DdType::CUDD, ValueType>>> InternalAdd<DdType::CUDD, ValueType>::splitIntoGroups(
645 std::vector<InternalAdd<DdType::CUDD, ValueType>>
const& vectors, std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
646 std::vector<std::vector<InternalAdd<DdType::CUDD, ValueType>>> result;
647 std::vector<DdNode*> dds;
648 for (
auto const& vector : vectors) {
649 dds.push_back(vector.getCuddDdNode());
651 dds.push_back(this->getCuddDdNode());
653 splitIntoGroupsRec(dds, result, ddGroupVariableIndices, 0, ddGroupVariableIndices.size());
657template<
typename ValueType>
658void InternalAdd<DdType::CUDD, ValueType>::splitIntoGroupsRec(std::vector<DdNode*>
const& dds,
659 std::vector<std::vector<InternalAdd<DdType::CUDD, ValueType>>>& groups,
660 std::vector<uint_fast64_t>
const& ddGroupVariableIndices, uint_fast64_t currentLevel,
661 uint_fast64_t maxLevel)
const {
665 for (
auto const& dd : dds) {
666 if (dd != Cudd_ReadZero(ddManager->getCuddManager().getManager())) {
676 if (currentLevel == maxLevel) {
677 std::vector<InternalAdd<DdType::CUDD, ValueType>> newGroup;
678 for (
auto dd : dds) {
679 newGroup.emplace_back(ddManager, cudd::ADD(ddManager->getCuddManager(), dd));
681 groups.push_back(std::move(newGroup));
683 std::vector<DdNode*> thenSubDds(dds), elseSubDds(dds);
684 for (uint64_t ddIndex = 0; ddIndex < dds.size(); ++ddIndex) {
685 auto const& dd = dds[ddIndex];
686 if (ddGroupVariableIndices[currentLevel] == Cudd_NodeReadIndex(dd)) {
687 thenSubDds[ddIndex] = Cudd_T(dd);
688 elseSubDds[ddIndex] = Cudd_E(dd);
691 splitIntoGroupsRec(thenSubDds, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
692 splitIntoGroupsRec(elseSubDds, groups, ddGroupVariableIndices, currentLevel + 1, maxLevel);
696template<
typename ValueType>
697void InternalAdd<DdType::CUDD, ValueType>::toMatrixComponents(std::vector<uint_fast64_t>
const& rowGroupIndices, std::vector<uint_fast64_t>& rowIndications,
699 Odd
const& rowOdd, Odd
const& columnOdd, std::vector<uint_fast64_t>
const& ddRowVariableIndices,
700 std::vector<uint_fast64_t>
const& ddColumnVariableIndices,
bool writeValues)
const {
701 return toMatrixComponentsRec(this->getCuddDdNode(), rowGroupIndices, rowIndications, columnsAndValues, rowOdd, columnOdd, 0, 0,
702 ddRowVariableIndices.size() + ddColumnVariableIndices.size(), 0, 0, ddRowVariableIndices, ddColumnVariableIndices,
706template<
typename ValueType>
707void InternalAdd<DdType::CUDD, ValueType>::toMatrixComponentsRec(DdNode
const* dd, std::vector<uint_fast64_t>
const& rowGroupOffsets,
708 std::vector<uint_fast64_t>& rowIndications,
710 Odd
const& rowOdd, Odd
const& columnOdd, uint_fast64_t currentRowLevel,
711 uint_fast64_t currentColumnLevel, uint_fast64_t maxLevel, uint_fast64_t currentRowOffset,
712 uint_fast64_t currentColumnOffset, std::vector<uint_fast64_t>
const& ddRowVariableIndices,
713 std::vector<uint_fast64_t>
const& ddColumnVariableIndices,
bool generateValues)
const {
715 if (dd == Cudd_ReadZero(ddManager->getCuddManager().getManager())) {
720 if (currentRowLevel + currentColumnLevel == maxLevel) {
721 if (generateValues) {
722 columnsAndValues[rowIndications[rowGroupOffsets[currentRowOffset]]] =
725 ++rowIndications[rowGroupOffsets[currentRowOffset]];
727 DdNode
const* elseElse;
728 DdNode
const* elseThen;
729 DdNode
const* thenElse;
730 DdNode
const* thenThen;
732 if (ddColumnVariableIndices[currentColumnLevel] < Cudd_NodeReadIndex(dd)) {
733 elseElse = elseThen = thenElse = thenThen = dd;
734 }
else if (ddRowVariableIndices[currentColumnLevel] < Cudd_NodeReadIndex(dd)) {
735 elseElse = thenElse = Cudd_E_const(dd);
736 elseThen = thenThen = Cudd_T_const(dd);
738 DdNode
const* elseNode = Cudd_E_const(dd);
739 if (ddColumnVariableIndices[currentColumnLevel] < Cudd_NodeReadIndex(elseNode)) {
740 elseElse = elseThen = elseNode;
742 elseElse = Cudd_E_const(elseNode);
743 elseThen = Cudd_T_const(elseNode);
746 DdNode
const* thenNode = Cudd_T_const(dd);
747 if (ddColumnVariableIndices[currentColumnLevel] < Cudd_NodeReadIndex(thenNode)) {
748 thenElse = thenThen = thenNode;
750 thenElse = Cudd_E_const(thenNode);
751 thenThen = Cudd_T_const(thenNode);
756 toMatrixComponentsRec(elseElse, rowGroupOffsets, rowIndications, columnsAndValues, rowOdd.getElseSuccessor(), columnOdd.getElseSuccessor(),
757 currentRowLevel + 1, currentColumnLevel + 1, maxLevel, currentRowOffset, currentColumnOffset, ddRowVariableIndices,
758 ddColumnVariableIndices, generateValues);
760 toMatrixComponentsRec(elseThen, rowGroupOffsets, rowIndications, columnsAndValues, rowOdd.getElseSuccessor(), columnOdd.getThenSuccessor(),
761 currentRowLevel + 1, currentColumnLevel + 1, maxLevel, currentRowOffset, currentColumnOffset + columnOdd.getElseOffset(),
762 ddRowVariableIndices, ddColumnVariableIndices, generateValues);
764 toMatrixComponentsRec(thenElse, rowGroupOffsets, rowIndications, columnsAndValues, rowOdd.getThenSuccessor(), columnOdd.getElseSuccessor(),
765 currentRowLevel + 1, currentColumnLevel + 1, maxLevel, currentRowOffset + rowOdd.getElseOffset(), currentColumnOffset,
766 ddRowVariableIndices, ddColumnVariableIndices, generateValues);
768 toMatrixComponentsRec(thenThen, rowGroupOffsets, rowIndications, columnsAndValues, rowOdd.getThenSuccessor(), columnOdd.getThenSuccessor(),
769 currentRowLevel + 1, currentColumnLevel + 1, maxLevel, currentRowOffset + rowOdd.getElseOffset(),
770 currentColumnOffset + columnOdd.getElseOffset(), ddRowVariableIndices, ddColumnVariableIndices, generateValues);
774template<
typename ValueType>
775InternalAdd<DdType::CUDD, ValueType> InternalAdd<DdType::CUDD, ValueType>::fromVector(InternalDdManager<DdType::CUDD>
const* ddManager,
777 std::vector<uint_fast64_t>
const& ddVariableIndices) {
778 uint_fast64_t offset = 0;
779 return InternalAdd<DdType::CUDD, ValueType>(
780 ddManager, cudd::ADD(ddManager->getCuddManager(),
781 fromVectorRec(ddManager->getCuddManager().getManager(), offset, 0, ddVariableIndices.size(), values, odd, ddVariableIndices)));
784template<
typename ValueType>
785DdNode* InternalAdd<DdType::CUDD, ValueType>::fromVectorRec(::DdManager* manager, uint_fast64_t& currentOffset, uint_fast64_t currentLevel,
786 uint_fast64_t maxLevel, std::vector<ValueType>
const& values, Odd
const& odd,
787 std::vector<uint_fast64_t>
const& ddVariableIndices) {
788 if (currentLevel == maxLevel) {
792 if (odd.getThenOffset() > 0) {
793 return Cudd_addConst(manager, values[currentOffset++]);
795 return Cudd_ReadZero(manager);
799 if (odd.getThenOffset() + odd.getElseOffset() == 0) {
800 return Cudd_ReadZero(manager);
804 DdNode* elseSuccessor =
nullptr;
805 if (odd.getElseOffset() > 0) {
806 elseSuccessor = fromVectorRec(manager, currentOffset, currentLevel + 1, maxLevel, values, odd.getElseSuccessor(), ddVariableIndices);
808 elseSuccessor = Cudd_ReadZero(manager);
810 Cudd_Ref(elseSuccessor);
813 DdNode* thenSuccessor =
nullptr;
814 if (odd.getThenOffset() > 0) {
815 thenSuccessor = fromVectorRec(manager, currentOffset, currentLevel + 1, maxLevel, values, odd.getThenSuccessor(), ddVariableIndices);
817 thenSuccessor = Cudd_ReadZero(manager);
819 Cudd_Ref(thenSuccessor);
822 DdNode* result = Cudd_addIthVar(manager,
static_cast<int>(ddVariableIndices[currentLevel]));
824 DdNode* newResult = Cudd_addIte(manager, result, thenSuccessor, elseSuccessor);
828 Cudd_RecursiveDeref(manager, result);
829 Cudd_RecursiveDeref(manager, thenSuccessor);
830 Cudd_RecursiveDeref(manager, elseSuccessor);
833 Cudd_Deref(newResult);
840template<
typename ValueType>
843 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
844 "of Storm with CUDD support.");
847template<
typename ValueType>
850 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
851 "of Storm with CUDD support.");
854template<
typename ValueType>
857 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
858 "of Storm with CUDD support.");
861template<
typename ValueType>
864 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
865 "of Storm with CUDD support.");
868template<
typename ValueType>
871 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
872 "of Storm with CUDD support.");
875template<
typename ValueType>
878 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
879 "of Storm with CUDD support.");
882template<
typename ValueType>
885 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
886 "of Storm with CUDD support.");
889template<
typename ValueType>
892 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
893 "of Storm with CUDD support.");
896template<
typename ValueType>
899 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
900 "of Storm with CUDD support.");
903template<
typename ValueType>
906 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
907 "of Storm with CUDD support.");
910template<
typename ValueType>
913 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
914 "of Storm with CUDD support.");
917template<
typename ValueType>
920 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
921 "of Storm with CUDD support.");
924template<
typename ValueType>
927 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
928 "of Storm with CUDD support.");
931template<
typename ValueType>
934 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
935 "of Storm with CUDD support.");
938template<
typename ValueType>
941 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
942 "of Storm with CUDD support.");
945template<
typename ValueType>
948 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
949 "of Storm with CUDD support.");
952template<
typename ValueType>
955 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
956 "of Storm with CUDD support.");
959template<
typename ValueType>
962 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
963 "of Storm with CUDD support.");
966template<
typename ValueType>
969 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
970 "of Storm with CUDD support.");
973template<
typename ValueType>
976 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
977 "of Storm with CUDD support.");
980template<
typename ValueType>
983 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
984 "of Storm with CUDD support.");
987template<
typename ValueType>
990 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
991 "of Storm with CUDD support.");
994template<
typename ValueType>
997 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
998 "of Storm with CUDD support.");
1001template<
typename ValueType>
1002template<
typename TargetValueType>
1006 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1007 "of Storm with CUDD support.");
1010template<
typename ValueType>
1011template<
typename TargetValueType>
1015 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1016 "of Storm with CUDD support.");
1019template<
typename ValueType>
1022 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1023 "of Storm with CUDD support.");
1026template<
typename ValueType>
1029 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1030 "of Storm with CUDD support.");
1033template<
typename ValueType>
1036 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1037 "of Storm with CUDD support.");
1040template<
typename ValueType>
1043 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1044 "of Storm with CUDD support.");
1047template<
typename ValueType>
1050 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1051 "of Storm with CUDD support.");
1054template<
typename ValueType>
1056 bool relative)
const {
1058 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1059 "of Storm with CUDD support.");
1062template<
typename ValueType>
1066 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1067 "of Storm with CUDD support.");
1070template<
typename ValueType>
1074 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1075 "of Storm with CUDD support.");
1078template<
typename ValueType>
1082 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1083 "of Storm with CUDD support.");
1086template<
typename ValueType>
1090 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1091 "of Storm with CUDD support.");
1094template<
typename ValueType>
1097 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1098 "of Storm with CUDD support.");
1101template<
typename ValueType>
1104 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1105 "of Storm with CUDD support.");
1108template<
typename ValueType>
1111 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1112 "of Storm with CUDD support.");
1115template<
typename ValueType>
1118 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1119 "of Storm with CUDD support.");
1122template<
typename ValueType>
1125 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1126 "of Storm with CUDD support.");
1129template<
typename ValueType>
1132 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1133 "of Storm with CUDD support.");
1136template<
typename ValueType>
1139 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1140 "of Storm with CUDD support.");
1143template<
typename ValueType>
1146 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1147 "of Storm with CUDD support.");
1150template<
typename ValueType>
1153 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1154 "of Storm with CUDD support.");
1157template<
typename ValueType>
1160 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1161 "of Storm with CUDD support.");
1164template<
typename ValueType>
1167 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1168 "of Storm with CUDD support.");
1171template<
typename ValueType>
1174 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1175 "of Storm with CUDD support.");
1178template<
typename ValueType>
1181 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1182 "of Storm with CUDD support.");
1185template<
typename ValueType>
1188 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1189 "of Storm with CUDD support.");
1192template<
typename ValueType>
1195 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1196 "of Storm with CUDD support.");
1199template<
typename ValueType>
1202 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1203 "of Storm with CUDD support.");
1206template<
typename ValueType>
1209 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1210 "of Storm with CUDD support.");
1213template<
typename ValueType>
1216 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1217 "of Storm with CUDD support.");
1220template<
typename ValueType>
1223 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1224 "of Storm with CUDD support.");
1227template<
typename ValueType>
1229 bool showVariablesIfPossible)
const {
1231 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1232 "of Storm with CUDD support.");
1235template<
typename ValueType>
1238 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1239 "of Storm with CUDD support.");
1242template<
typename ValueType>
1244 uint_fast64_t, std::set<storm::expressions::Variable>
const& metaVariables,
1245 bool enumerateDontCareMetaVariables)
const {
1247 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1248 "of Storm with CUDD support.");
1251template<
typename ValueType>
1254 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1255 "of Storm with CUDD support.");
1258template<
typename ValueType>
1261 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1262 "of Storm with CUDD support.");
1265template<
typename ValueType>
1268 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1269 "of Storm with CUDD support.");
1272template<
typename ValueType>
1275 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1276 "of Storm with CUDD support.");
1279template<
typename ValueType>
1281 std::vector<ValueType>& targetVector,
1282 std::function<ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
1284 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1285 "of Storm with CUDD support.");
1288template<
typename ValueType>
1290 std::function<
void(uint64_t
const&, ValueType
const&)>
const& function)
const {
1292 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1293 "of Storm with CUDD support.");
1296template<
typename ValueType>
1298 std::vector<uint_fast64_t>
const& offsets, std::vector<ValueType>& targetVector,
1299 std::function<ValueType(ValueType
const&, ValueType
const&)>
const& function)
const {
1301 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1302 "of Storm with CUDD support.");
1305template<
typename ValueType>
1309 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1310 "of Storm with CUDD support.");
1313template<
typename ValueType>
1315 std::vector<uint_fast64_t>
const& ddGroupVariableIndices)
const {
1317 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1318 "of Storm with CUDD support.");
1321template<
typename ValueType>
1325 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1326 "of Storm with CUDD support.");
1329template<
typename ValueType>
1333 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1334 "of Storm with CUDD support.");
1337template<
typename ValueType>
1340 Odd const& rowOdd,
Odd const& columnOdd, std::vector<uint_fast64_t>
const& ddRowVariableIndices,
1341 std::vector<uint_fast64_t>
const& ddColumnVariableIndices,
bool writeValues)
const {
1343 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1344 "of Storm with CUDD support.");
1347template<
typename ValueType>
1350 std::vector<uint_fast64_t>
const& ddVariableIndices) {
1352 "This version of Storm was compiled without support for CUDD. Yet, a method was called that requires this support. Please choose a version "
1353 "of Storm with CUDD support.");
InternalAdd< DdType::Sylvan, double > toValueType() const
A bit vector that is internally represented as a vector of 64-bit values.
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
SFTBDDChecker::ValueType ValueType
SettingsManager const & manager()
Retrieves the settings manager.
Extremum< storm::OptimizationDirection::Maximize, ValueType > Maximum
Extremum< storm::OptimizationDirection::Minimize, ValueType > Minimum
TargetType convertNumber(SourceType const &number)
The contract of a DD backend.