Browse Source
Merge branch 'gspn' of https://sselab.de/lab9/private/git/storm into gspn
Merge branch 'gspn' of https://sselab.de/lab9/private/git/storm into gspn
Former-commit-id: 71d8f4caca
main
86 changed files with 708 additions and 501 deletions
-
4CMakeLists.txt
-
1README.md
-
23doc/build.md
-
41doc/dependencies.md
-
1doc/getting-started.md
-
11resources/3rdparty/CMakeLists.txt
-
0resources/3rdparty/cpplint/cpplint.py
-
4resources/3rdparty/include_xerces.cmake
-
64resources/BUILD.txt
-
0resources/doxygen/Doxyfile.in
-
3src/adapters/EigenAdapter.cpp
-
2src/builder/ExplicitGspnModelBuilder.cpp
-
6src/builder/ExplicitGspnModelBuilder.h
-
6src/builder/ExplicitModelBuilder.cpp
-
8src/cli/cli.cpp
-
2src/cli/entrypoints.h
-
5src/generator/Choice.cpp
-
7src/generator/CompressedState.cpp
-
6src/generator/JaniNextStateGenerator.cpp
-
8src/generator/NextStateGenerator.cpp
-
3src/generator/NextStateGenerator.h
-
13src/generator/PrismNextStateGenerator.cpp
-
6src/generator/StateBehavior.cpp
-
5src/modelchecker/csl/SparseCtmcCslModelChecker.cpp
-
53src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp
-
5src/modelchecker/prctl/SparseDtmcPrctlModelChecker.cpp
-
5src/modelchecker/prctl/SparseMdpPrctlModelChecker.cpp
-
3src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp
-
3src/modelchecker/prctl/helper/SparseMdpPrctlHelper.cpp
-
4src/modelchecker/propositional/SparsePropositionalModelChecker.cpp
-
3src/modelchecker/reachability/SparseDtmcEliminationModelChecker.cpp
-
4src/modelchecker/results/CheckResult.cpp
-
3src/modelchecker/results/ExplicitQuantitativeCheckResult.cpp
-
6src/models/sparse/Ctmc.cpp
-
6src/models/sparse/DeterministicModel.cpp
-
4src/models/sparse/Dtmc.cpp
-
3src/models/sparse/MarkovAutomaton.cpp
-
6src/models/sparse/Mdp.cpp
-
9src/models/sparse/Model.cpp
-
2src/models/sparse/Model.h
-
6src/models/sparse/NondeterministicModel.cpp
-
2src/models/sparse/StandardRewardModel.cpp
-
4src/parser/DFTGalileoParser.cpp
-
22src/solver/EigenLinearEquationSolver.cpp
-
4src/solver/EigenLinearEquationSolver.h
-
7src/solver/EliminationLinearEquationSolver.cpp
-
11src/solver/LinearEquationSolver.cpp
-
3src/solver/LinearEquationSolver.h
-
9src/solver/MinMaxLinearEquationSolver.cpp
-
3src/solver/SolveGoal.cpp
-
7src/solver/StandardMinMaxLinearEquationSolver.cpp
-
3src/solver/TerminationCondition.cpp
-
4src/solver/stateelimination/ConditionalStateEliminator.cpp
-
3src/solver/stateelimination/DynamicStatePriorityQueue.cpp
-
8src/solver/stateelimination/EliminatorBase.cpp
-
5src/solver/stateelimination/EquationSystemEliminator.cpp
-
4src/solver/stateelimination/LongRunAverageEliminator.cpp
-
4src/solver/stateelimination/PrioritizedStateEliminator.cpp
-
4src/solver/stateelimination/StateEliminator.cpp
-
2src/storage/Distribution.cpp
-
5src/storage/FlexibleSparseMatrix.cpp
-
3src/storage/MaximalEndComponentDecomposition.cpp
-
2src/storage/SparseMatrix.cpp
-
8src/storage/StronglyConnectedComponentDecomposition.cpp
-
2src/storage/bisimulation/BisimulationDecomposition.cpp
-
2src/storage/bisimulation/DeterministicModelBisimulationDecomposition.cpp
-
4src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp
-
4src/storage/expressions/ExpressionEvaluator.cpp
-
4src/storage/expressions/ExpressionEvaluator.h
-
5src/storage/expressions/ExpressionEvaluatorBase.cpp
-
5src/storage/expressions/ExprtkExpressionEvaluator.cpp
-
4src/storage/expressions/ToRationalFunctionVisitor.cpp
-
4src/storage/expressions/ToRationalFunctionVisitor.h
-
20src/storage/expressions/ToRationalNumberVisitor.cpp
-
1src/storage/gspn/GSPN.h
-
10src/storage/gspn/ImmediateTransition.h
-
1src/storage/gspn/Marking.h
-
4src/storm-dyftee.cpp
-
623src/utility/constants.cpp
-
15src/utility/graph.cpp
-
1src/utility/parametric.h
-
4src/utility/prism.cpp
-
4src/utility/stateelimination.cpp
-
4src/utility/storm.h
-
3test/functional/modelchecker/EigenDtmcPrctlModelCheckerTest.cpp
-
4test/functional/solver/EigenLinearEquationSolverTest.cpp
@ -0,0 +1 @@ |
|||
For more instructions, check out the documentation found in [Getting Started](doc/getting-started.md) |
@ -0,0 +1,23 @@ |
|||
CMake >= 2.8.11 |
|||
CMake is required as it is used to generate the Makefiles or Projects/Solutions required to build StoRM. |
|||
|
|||
Compiler: |
|||
A C++11 compliant compiler is required to build StoRM. It is tested and known to work with the following compilers: |
|||
- GCC 5.0 |
|||
- Clang 3.5.0 |
|||
|
|||
Other versions or compilers might work, but are not tested. |
|||
|
|||
The following Compilers are known NOT to work: Microsoft Visual Studio versions older than 2013, GCC versions 4.7 and older. |
|||
|
|||
Prerequisites: |
|||
Boost >= 1.60 |
|||
Build using the Boost Build system, for x64 use "bjam address-model=64" or "bjam.exe address-model=64 --build-type=complete" |
|||
|
|||
|
|||
It is recommended to make an out-of-source build, meaning that the folder in which CMake generates its Cache, Makefiles and output files should not be the Project Root nor its Source Directory. |
|||
A typical build layout is to create a folder "build" in the project root alongside the CMakeLists.txt file, change into this folder and execute "cmake .." as this will leave all source files untouched |
|||
and makes cleaning up the build tree very easy. |
|||
There are several options available for the CMake Script as to control behaviour and included components. |
|||
If no error occured during the last CMake Configure round, press Generate. |
|||
Now you can build StoRM using the generated project/makefiles in the Build folder you selected. |
@ -0,0 +1,41 @@ |
|||
|
|||
|
|||
|
|||
Included Dependencies: |
|||
Carl 1.0 |
|||
|
|||
CUDD 3.0.0 |
|||
CUDD is included in the StoRM Sources under /resources/3rdparty/cudd-2.5.0 and builds automatically alongside StoRM. |
|||
Its Sourced where heavily modified as to incorporate newer Versions of Boost, changes in C++ (TR1 to C++11) and |
|||
to remove components only available under UNIX. |
|||
|
|||
Eigen 3.3 beta1 |
|||
Eigen is included in the StoRM Sources under /resources/3rdparty/eigen and builds automatically alongside StoRM. |
|||
|
|||
|
|||
GTest 1.7.0 |
|||
GTest is included in the StoRM Sources under /resources/3rdparty/gtest-1.7.0 and builds automatically alongside StoRM |
|||
GMM >= 4.2 |
|||
GMM is included in the StoRM Sources under /resources/3rdparty/gmm-4.2 and builds automatically alongside StoRM. |
|||
|
|||
|
|||
Optional: |
|||
Gurobi >= 5.6.2 |
|||
Specify the path to the gurobi root dir using -DGUROBI_ROOT=/your/path/to/gurobi |
|||
Z3 >= 4.3.2 |
|||
Specify the path to the z3 root dir using -DZ3_ROOT=/your/path/to/z3 |
|||
MathSAT >= 5.2.11 |
|||
Specify the path to the mathsat root dir using -DMSAT_ROOT=/your/path/to/mathsat |
|||
MPIR >= 2.7.0 |
|||
MSVC only and only if linked with MathSAT |
|||
Specify the path to the gmp-include directory -DGMP_INCLUDE_DIR=/your/path/to/mathsat |
|||
Specify the path to the mpir.lib directory -DGMP_MPIR_LIBRARY=/your/path/to/mpir.lib |
|||
Specify the path to the mpirxx.lib directory -DGMP_MPIRXX_LIBRARY=/your/path/to/mpirxx.lib |
|||
GMP |
|||
clang and gcc only |
|||
CUDA Toolkit >= 6.5 |
|||
Specify the path to the cuda toolkit root dir using -DCUDA_ROOT=/your/path/to/cuda |
|||
CUSP >= 0.4.0 |
|||
Only of built with CUDA Toolkit |
|||
CUSP is included in the StoRM Sources as a git-submodule unter /resources/3rdparty/cusplibrary |
|||
|
@ -0,0 +1 @@ |
|||
|
@ -1,64 +0,0 @@ |
|||
CMake >= 2.8.11 |
|||
CMake is required as it is used to generate the Makefiles or Projects/Solutions required to build StoRM. |
|||
|
|||
Compiler: |
|||
A C++11 compliant compiler is required to build StoRM. It is tested and known to work with the following compilers: |
|||
- GCC 4.9.1 |
|||
- Clang 3.5.0 |
|||
- Microsoft Visual Studio 2013 |
|||
|
|||
Other versions or compilers might work, but are not tested. |
|||
|
|||
The following Compilers are known NOT to work: Microsoft Visual Studio versions older than 2013, GCC versions 4.7 and older. |
|||
|
|||
Prerequisites: |
|||
Boost >= 1.56 |
|||
Build using the Boost Build system, for x64 use "bjam address-model=64" or "bjam.exe address-model=64 --build-type=complete" |
|||
You may use --toolset to specify the compiler, for ex. msvc-10.0, intel11.1, etc |
|||
Doxygen |
|||
Set DOXYGEN_EXECUTABLE to your doxygen executable, e.g. "C:/Program Files/doxygen/bin/doxygen.exe" |
|||
GTest >= 1.7.0 |
|||
GTest is included in the StoRM Sources under /resources/3rdparty/gtest-1.7.0 and builds automatically alongside StoRM |
|||
CUDD >= 2.5.0 |
|||
CUDD is included in the StoRM Sources under /resources/3rdparty/cudd-2.5.0 and builds automatically alongside StoRM. |
|||
Its Sourced where heavily modified as to incorporate newer Versions of Boost, changes in C++ (TR1 to C++11) and |
|||
to remove components only available under UNIX. |
|||
Log4CPlus >= 1.1.2 |
|||
Log4CPlus is included in the StoRM Sources under /resources/3rdparty/log4cplus-1.1.3-rc1 and builds automatically alongside StoRM. |
|||
Its Sourced where slightly modified as to incorporate Unicode handling under Win32, Clang compatability and shared/static build options. |
|||
Eigen >= 3.2.1 |
|||
Eigen is included in the StoRM Sources under /resources/3rdparty/eigen and builds automatically alongside StoRM. |
|||
GMM >= 4.2 |
|||
GMM is included in the StoRM Sources under /resources/3rdparty/gmm-4.2 and builds automatically alongside StoRM. |
|||
LTL2DStar >= 0.5.1 |
|||
LTL2DStar is included in the StoRM Sources under /resources/3rdparty/ltl2dstar-0.5.1 and builds automatically alongside StoRM. |
|||
Its Sourced where heavily modified as to incorporate changes in C++ (TR1 to C++11) and |
|||
to remove components only available under UNIX. |
|||
|
|||
Optional: |
|||
Gurobi >= 5.6.2 |
|||
Specify the path to the gurobi root dir using -DGUROBI_ROOT=/your/path/to/gurobi |
|||
Z3 >= 4.3.2 |
|||
Specify the path to the z3 root dir using -DZ3_ROOT=/your/path/to/z3 |
|||
MathSAT >= 5.2.11 |
|||
Specify the path to the mathsat root dir using -DMSAT_ROOT=/your/path/to/mathsat |
|||
MPIR >= 2.7.0 |
|||
MSVC only and only if linked with MathSAT |
|||
Specify the path to the gmp-include directory -DGMP_INCLUDE_DIR=/your/path/to/mathsat |
|||
Specify the path to the mpir.lib directory -DGMP_MPIR_LIBRARY=/your/path/to/mpir.lib |
|||
Specify the path to the mpirxx.lib directory -DGMP_MPIRXX_LIBRARY=/your/path/to/mpirxx.lib |
|||
GMP |
|||
clang and gcc only and inly if linked with MathSAT |
|||
CUDA Toolkit >= 6.5 |
|||
Specify the path to the cuda toolkit root dir using -DCUDA_ROOT=/your/path/to/cuda |
|||
CUSP >= 0.4.0 |
|||
Only of built with CUDA Toolkit |
|||
CUSP is included in the StoRM Sources as a git-submodule unter /resources/3rdparty/cusplibrary |
|||
|
|||
|
|||
It is recommended to make an out-of-source build, meaning that the folder in which CMake generates its Cache, Makefiles and output files should not be the Project Root nor its Source Directory. |
|||
A typical build layout is to create a folder "build" in the project root alongside the CMakeLists.txt file, change into this folder and execute "cmake .." as this will leave all source files untouched |
|||
and makes cleaning up the build tree very easy. |
|||
There are several options available for the CMake Script as to control behaviour and included components. |
|||
If no error occured during the last CMake Configure round, press Generate. |
|||
Now you can build StoRM using the generated project/makefiles in the Build folder you selected. |
@ -1,307 +1,316 @@ |
|||
#include "src/utility/constants.h"
|
|||
|
|||
#include "src/storage/sparse/StateType.h"
|
|||
#include "src/storage/SparseMatrix.h"
|
|||
#include "src/settings/SettingsManager.h"
|
|||
#include "src/settings/modules/GeneralSettings.h"
|
|||
|
|||
#include "src/adapters/CarlAdapter.h"
|
|||
|
|||
namespace storm { |
|||
namespace utility { |
|||
|
|||
template<typename ValueType> |
|||
ValueType one() { |
|||
return ValueType(1); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType zero() { |
|||
return ValueType(0); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType infinity() { |
|||
return std::numeric_limits<ValueType>::infinity(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool isOne(ValueType const& a) { |
|||
return a == one<ValueType>(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool isZero(ValueType const& a) { |
|||
return a == zero<ValueType>(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool isConstant(ValueType const& a) { |
|||
return true; |
|||
} |
|||
|
|||
template<> |
|||
bool isOne(storm::RationalNumber const& a) { |
|||
return carl::isOne(a); |
|||
} |
|||
|
|||
template<> |
|||
bool isZero(storm::RationalNumber const& a) { |
|||
return carl::isZero(a); |
|||
} |
|||
|
|||
template<> |
|||
storm::RationalNumber infinity() { |
|||
// FIXME: this should be treated more properly.
|
|||
return storm::RationalNumber(-1); |
|||
} |
|||
|
|||
template<> |
|||
bool isOne(storm::RationalFunction const& a) { |
|||
return a.isOne(); |
|||
} |
|||
|
|||
template<> |
|||
bool isZero(storm::RationalFunction const& a) { |
|||
return a.isZero(); |
|||
} |
|||
|
|||
template<> |
|||
bool isConstant(storm::RationalFunction const& a) { |
|||
return a.isConstant(); |
|||
} |
|||
|
|||
template<> |
|||
bool isOne(storm::Polynomial const& a) { |
|||
return a.isOne(); |
|||
} |
|||
|
|||
template<> |
|||
bool isZero(storm::Polynomial const& a) { |
|||
return a.isZero(); |
|||
} |
|||
|
|||
template<> |
|||
bool isConstant(storm::Polynomial const& a) { |
|||
return a.isConstant(); |
|||
} |
|||
|
|||
template<> |
|||
storm::RationalFunction infinity() { |
|||
//FIXME: this should be treated more properly.
|
|||
return storm::RationalFunction(-1.0); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType pow(ValueType const& value, uint_fast64_t exponent) { |
|||
assert(false); |
|||
//return std::pow(value, exponent);
|
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType simplify(ValueType value) { |
|||
// In the general case, we don't do anything here, but merely return the value. If something else is
|
|||
// supposed to happen here, the templated function can be specialized for this particular type.
|
|||
return value; |
|||
} |
|||
|
|||
template<> |
|||
double convertNumber(double const& number){ |
|||
return number; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType abs(ValueType const& number) { |
|||
return carl::abs(number); |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction& simplify(RationalFunction& value); |
|||
|
|||
template<> |
|||
RationalFunction&& simplify(RationalFunction&& value); |
|||
|
|||
template<> |
|||
RationalFunction pow(RationalFunction const& value, uint_fast64_t exponent) { |
|||
return carl::pow(value, exponent); |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction simplify(RationalFunction value) { |
|||
value.simplify(); |
|||
return value; |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction& simplify(RationalFunction& value) { |
|||
value.simplify(); |
|||
return value; |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction&& simplify(RationalFunction&& value) { |
|||
value.simplify(); |
|||
return std::move(value); |
|||
} |
|||
|
|||
template<> |
|||
double convertNumber(RationalNumber const& number){ |
|||
return carl::toDouble(number); |
|||
} |
|||
|
|||
template<> |
|||
RationalNumber convertNumber(double const& number){ |
|||
return carl::rationalize<RationalNumber>(number); |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction convertNumber(double const& number){ |
|||
return RationalFunction(carl::rationalize<RationalNumber>(number)); |
|||
} |
|||
|
|||
template<> |
|||
storm::RationalNumber abs(storm::RationalNumber const& number) { |
|||
return carl::abs(number); |
|||
} |
|||
|
|||
template<typename IndexType, typename ValueType> |
|||
storm::storage::MatrixEntry<IndexType, ValueType> simplify(storm::storage::MatrixEntry<IndexType, ValueType> matrixEntry) { |
|||
simplify(matrixEntry.getValue()); |
|||
return matrixEntry; |
|||
} |
|||
|
|||
template<typename IndexType, typename ValueType> |
|||
storm::storage::MatrixEntry<IndexType, ValueType>& simplify(storm::storage::MatrixEntry<IndexType, ValueType>& matrixEntry) { |
|||
simplify(matrixEntry.getValue()); |
|||
return matrixEntry; |
|||
} |
|||
|
|||
template<typename IndexType, typename ValueType> |
|||
storm::storage::MatrixEntry<IndexType, ValueType>&& simplify(storm::storage::MatrixEntry<IndexType, ValueType>&& matrixEntry) { |
|||
simplify(matrixEntry.getValue()); |
|||
return std::move(matrixEntry); |
|||
} |
|||
|
|||
// Explicit instantiations.
|
|||
template bool isOne(double const& value); |
|||
template bool isZero(double const& value); |
|||
template bool isConstant(double const& value); |
|||
|
|||
template double one(); |
|||
template double zero(); |
|||
template double infinity(); |
|||
|
|||
template double pow(double const& value, uint_fast64_t exponent); |
|||
|
|||
template double simplify(double value); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, double> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, double> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, double>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, double>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, double>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, double>&& matrixEntry); |
|||
|
|||
template double abs(double const& number); |
|||
|
|||
template bool isOne(float const& value); |
|||
template bool isZero(float const& value); |
|||
template bool isConstant(float const& value); |
|||
|
|||
template float one(); |
|||
template float zero(); |
|||
template float infinity(); |
|||
|
|||
template float pow(float const& value, uint_fast64_t exponent); |
|||
|
|||
template float simplify(float value); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, float> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, float> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, float>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, float>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, float>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, float>&& matrixEntry); |
|||
|
|||
template bool isOne(int const& value); |
|||
template bool isZero(int const& value); |
|||
template bool isConstant(int const& value); |
|||
|
|||
template int one(); |
|||
template int zero(); |
|||
template int infinity(); |
|||
|
|||
template int pow(int const& value, uint_fast64_t exponent); |
|||
|
|||
template int simplify(int value); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, int> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, int> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, int>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, int>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, int>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, int>&& matrixEntry); |
|||
|
|||
template bool isOne(storm::storage::sparse::state_type const& value); |
|||
template bool isZero(storm::storage::sparse::state_type const& value); |
|||
template bool isConstant(storm::storage::sparse::state_type const& value); |
|||
|
|||
template uint32_t one(); |
|||
template uint32_t zero(); |
|||
template uint32_t infinity(); |
|||
|
|||
template storm::storage::sparse::state_type one(); |
|||
template storm::storage::sparse::state_type zero(); |
|||
template storm::storage::sparse::state_type infinity(); |
|||
|
|||
template storm::storage::sparse::state_type pow(storm::storage::sparse::state_type const& value, uint_fast64_t exponent); |
|||
|
|||
template storm::storage::sparse::state_type simplify(storm::storage::sparse::state_type value); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type>&& matrixEntry); |
|||
|
|||
// Instantiations for rational number.
|
|||
template bool isOne(storm::RationalNumber const& value); |
|||
template bool isZero(storm::RationalNumber const& value); |
|||
template bool isConstant(storm::RationalNumber const& value); |
|||
|
|||
template storm::RationalNumber one(); |
|||
template storm::RationalNumber zero(); |
|||
template storm::RationalNumber infinity(); |
|||
|
|||
template double convertNumber(storm::RationalNumber const& number); |
|||
template storm::RationalNumber convertNumber(double const& number); |
|||
|
|||
template storm::RationalNumber abs(storm::RationalNumber const& number); |
|||
|
|||
template storm::RationalNumber pow(storm::RationalNumber const& value, uint_fast64_t exponent); |
|||
|
|||
template storm::RationalNumber simplify(storm::RationalNumber value); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber>&& matrixEntry); |
|||
|
|||
#ifdef STORM_HAVE_CARL
|
|||
template bool isOne(RationalFunction const& value); |
|||
template bool isZero(RationalFunction const& value); |
|||
template bool isConstant(RationalFunction const& value); |
|||
|
|||
template RationalFunction one(); |
|||
template RationalFunction zero(); |
|||
template storm::RationalFunction infinity(); |
|||
|
|||
template RationalFunction pow(RationalFunction const& value, uint_fast64_t exponent); |
|||
template RationalFunction simplify(RationalFunction value); |
|||
template RationalFunction& simplify(RationalFunction& value); |
|||
template RationalFunction&& simplify(RationalFunction&& value); |
|||
|
|||
template Polynomial one(); |
|||
template Polynomial zero(); |
|||
|
|||
template bool isOne(Interval const& value); |
|||
template bool isZero(Interval const& value); |
|||
template bool isConstant(Interval const& value); |
|||
|
|||
template Interval one(); |
|||
template Interval zero(); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction>&& matrixEntry); |
|||
#endif
|
|||
|
|||
} |
|||
} |
|||
#include "src/utility/constants.h"
|
|||
|
|||
#include "src/storage/sparse/StateType.h"
|
|||
#include "src/storage/SparseMatrix.h"
|
|||
#include "src/settings/SettingsManager.h"
|
|||
#include "src/settings/modules/GeneralSettings.h"
|
|||
|
|||
#include "src/adapters/CarlAdapter.h"
|
|||
|
|||
namespace storm { |
|||
namespace utility { |
|||
|
|||
template<typename ValueType> |
|||
ValueType one() { |
|||
return ValueType(1); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType zero() { |
|||
return ValueType(0); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType infinity() { |
|||
return std::numeric_limits<ValueType>::infinity(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool isOne(ValueType const& a) { |
|||
return a == one<ValueType>(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool isZero(ValueType const& a) { |
|||
return a == zero<ValueType>(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool isConstant(ValueType const& a) { |
|||
return true; |
|||
} |
|||
|
|||
#ifdef STORM_HAVE_CARL
|
|||
template<> |
|||
bool isOne(storm::RationalNumber const& a) { |
|||
return carl::isOne(a); |
|||
} |
|||
|
|||
template<> |
|||
bool isZero(storm::RationalNumber const& a) { |
|||
return carl::isZero(a); |
|||
} |
|||
|
|||
template<> |
|||
storm::RationalNumber infinity() { |
|||
// FIXME: this should be treated more properly.
|
|||
return storm::RationalNumber(-1); |
|||
} |
|||
|
|||
template<> |
|||
bool isOne(storm::RationalFunction const& a) { |
|||
return a.isOne(); |
|||
} |
|||
|
|||
template<> |
|||
bool isZero(storm::RationalFunction const& a) { |
|||
return a.isZero(); |
|||
} |
|||
|
|||
template<> |
|||
bool isConstant(storm::RationalFunction const& a) { |
|||
return a.isConstant(); |
|||
} |
|||
|
|||
template<> |
|||
bool isOne(storm::Polynomial const& a) { |
|||
return a.isOne(); |
|||
} |
|||
|
|||
template<> |
|||
bool isZero(storm::Polynomial const& a) { |
|||
return a.isZero(); |
|||
} |
|||
|
|||
template<> |
|||
bool isConstant(storm::Polynomial const& a) { |
|||
return a.isConstant(); |
|||
} |
|||
|
|||
template<> |
|||
storm::RationalFunction infinity() { |
|||
// FIXME: this should be treated more properly.
|
|||
return storm::RationalFunction(-1.0); |
|||
} |
|||
#endif
|
|||
|
|||
template<typename ValueType> |
|||
ValueType pow(ValueType const& value, uint_fast64_t exponent) { |
|||
return std::pow(value, exponent); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType simplify(ValueType value) { |
|||
// In the general case, we don't do anything here, but merely return the value. If something else is
|
|||
// supposed to happen here, the templated function can be specialized for this particular type.
|
|||
return value; |
|||
} |
|||
|
|||
template<> |
|||
double convertNumber(double const& number){ |
|||
return number; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ValueType abs(ValueType const& number) { |
|||
return std::fabs(number); |
|||
} |
|||
|
|||
#ifdef STORM_HAVE_CARL
|
|||
template<> |
|||
RationalNumber pow(RationalNumber const& value, uint_fast64_t exponent) { |
|||
return carl::pow(value, exponent); |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction& simplify(RationalFunction& value); |
|||
|
|||
template<> |
|||
RationalFunction&& simplify(RationalFunction&& value); |
|||
|
|||
template<> |
|||
RationalFunction pow(RationalFunction const& value, uint_fast64_t exponent) { |
|||
return carl::pow(value, exponent); |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction simplify(RationalFunction value) { |
|||
value.simplify(); |
|||
return value; |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction& simplify(RationalFunction& value) { |
|||
value.simplify(); |
|||
return value; |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction&& simplify(RationalFunction&& value) { |
|||
value.simplify(); |
|||
return std::move(value); |
|||
} |
|||
|
|||
template<> |
|||
double convertNumber(RationalNumber const& number){ |
|||
return carl::toDouble(number); |
|||
} |
|||
|
|||
template<> |
|||
RationalNumber convertNumber(double const& number){ |
|||
return carl::rationalize<RationalNumber>(number); |
|||
} |
|||
|
|||
template<> |
|||
RationalFunction convertNumber(double const& number){ |
|||
return RationalFunction(carl::rationalize<RationalNumber>(number)); |
|||
} |
|||
|
|||
template<> |
|||
storm::RationalNumber abs(storm::RationalNumber const& number) { |
|||
return carl::abs(number); |
|||
} |
|||
#endif
|
|||
|
|||
template<typename IndexType, typename ValueType> |
|||
storm::storage::MatrixEntry<IndexType, ValueType> simplify(storm::storage::MatrixEntry<IndexType, ValueType> matrixEntry) { |
|||
simplify(matrixEntry.getValue()); |
|||
return matrixEntry; |
|||
} |
|||
|
|||
template<typename IndexType, typename ValueType> |
|||
storm::storage::MatrixEntry<IndexType, ValueType>& simplify(storm::storage::MatrixEntry<IndexType, ValueType>& matrixEntry) { |
|||
simplify(matrixEntry.getValue()); |
|||
return matrixEntry; |
|||
} |
|||
|
|||
template<typename IndexType, typename ValueType> |
|||
storm::storage::MatrixEntry<IndexType, ValueType>&& simplify(storm::storage::MatrixEntry<IndexType, ValueType>&& matrixEntry) { |
|||
simplify(matrixEntry.getValue()); |
|||
return std::move(matrixEntry); |
|||
} |
|||
|
|||
// Explicit instantiations.
|
|||
template bool isOne(double const& value); |
|||
template bool isZero(double const& value); |
|||
template bool isConstant(double const& value); |
|||
|
|||
template double one(); |
|||
template double zero(); |
|||
template double infinity(); |
|||
|
|||
template double pow(double const& value, uint_fast64_t exponent); |
|||
|
|||
template double simplify(double value); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, double> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, double> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, double>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, double>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, double>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, double>&& matrixEntry); |
|||
|
|||
template double abs(double const& number); |
|||
|
|||
template bool isOne(float const& value); |
|||
template bool isZero(float const& value); |
|||
template bool isConstant(float const& value); |
|||
|
|||
template float one(); |
|||
template float zero(); |
|||
template float infinity(); |
|||
|
|||
template float pow(float const& value, uint_fast64_t exponent); |
|||
|
|||
template float simplify(float value); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, float> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, float> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, float>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, float>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, float>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, float>&& matrixEntry); |
|||
|
|||
template bool isOne(int const& value); |
|||
template bool isZero(int const& value); |
|||
template bool isConstant(int const& value); |
|||
|
|||
template int one(); |
|||
template int zero(); |
|||
template int infinity(); |
|||
|
|||
template int pow(int const& value, uint_fast64_t exponent); |
|||
|
|||
template int simplify(int value); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, int> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, int> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, int>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, int>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, int>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, int>&& matrixEntry); |
|||
|
|||
template bool isOne(storm::storage::sparse::state_type const& value); |
|||
template bool isZero(storm::storage::sparse::state_type const& value); |
|||
template bool isConstant(storm::storage::sparse::state_type const& value); |
|||
|
|||
template uint32_t one(); |
|||
template uint32_t zero(); |
|||
template uint32_t infinity(); |
|||
|
|||
template storm::storage::sparse::state_type one(); |
|||
template storm::storage::sparse::state_type zero(); |
|||
template storm::storage::sparse::state_type infinity(); |
|||
|
|||
template storm::storage::sparse::state_type pow(storm::storage::sparse::state_type const& value, uint_fast64_t exponent); |
|||
|
|||
template storm::storage::sparse::state_type simplify(storm::storage::sparse::state_type value); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::storage::sparse::state_type>&& matrixEntry); |
|||
|
|||
#ifdef STORM_HAVE_CARL
|
|||
// Instantiations for rational number.
|
|||
template bool isOne(storm::RationalNumber const& value); |
|||
template bool isZero(storm::RationalNumber const& value); |
|||
template bool isConstant(storm::RationalNumber const& value); |
|||
|
|||
template storm::RationalNumber one(); |
|||
template storm::RationalNumber zero(); |
|||
template storm::RationalNumber infinity(); |
|||
|
|||
template double convertNumber(storm::RationalNumber const& number); |
|||
template storm::RationalNumber convertNumber(double const& number); |
|||
|
|||
template storm::RationalNumber abs(storm::RationalNumber const& number); |
|||
|
|||
template storm::RationalNumber pow(storm::RationalNumber const& value, uint_fast64_t exponent); |
|||
|
|||
template storm::RationalNumber simplify(storm::RationalNumber value); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber>&& matrixEntry); |
|||
|
|||
// Instantiations for rational function.
|
|||
template bool isOne(RationalFunction const& value); |
|||
template bool isZero(RationalFunction const& value); |
|||
template bool isConstant(RationalFunction const& value); |
|||
|
|||
template RationalFunction one(); |
|||
template RationalFunction zero(); |
|||
template storm::RationalFunction infinity(); |
|||
|
|||
template RationalFunction pow(RationalFunction const& value, uint_fast64_t exponent); |
|||
template RationalFunction simplify(RationalFunction value); |
|||
template RationalFunction& simplify(RationalFunction& value); |
|||
template RationalFunction&& simplify(RationalFunction&& value); |
|||
|
|||
template Polynomial one(); |
|||
template Polynomial zero(); |
|||
|
|||
template bool isOne(Interval const& value); |
|||
template bool isZero(Interval const& value); |
|||
template bool isConstant(Interval const& value); |
|||
|
|||
template Interval one(); |
|||
template Interval zero(); |
|||
|
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction> simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction> matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction>& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction>& matrixEntry); |
|||
template storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction>&& simplify(storm::storage::MatrixEntry<storm::storage::sparse::state_type, RationalFunction>&& matrixEntry); |
|||
#endif
|
|||
|
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue