summaryrefslogtreecommitdiffstats
path: root/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3
downloadStudium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz
Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3')
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/.cproject942
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/.project70
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/VaR.plt25
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/CholeskyDecomposition.cpp100
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/CholeskyDecomposition.h40
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/HistoricSimulation.cpp82
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/HistoricSimulation.h26
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/MonteCarloSimulation.cpp195
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/MonteCarloSimulation.h28
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Normaldistribution.cpp64
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Normaldistribution.h24
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Parametrisation.cpp299
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Parametrisation.h160
-rw-r--r--Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/main.cpp35
14 files changed, 2090 insertions, 0 deletions
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/.cproject b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/.cproject
new file mode 100644
index 0000000..f191819
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/.cproject
@@ -0,0 +1,942 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1515720232">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1515720232" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="Aufgabe2und3" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1515720232" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1515720232." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.base.1342989898" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.base">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.PE" id="cdt.managedbuild.target.gnu.platform.mingw.base.1905621066" name="Debug Platform" osList="win32" superClass="cdt.managedbuild.target.gnu.platform.mingw.base"/>
+ <builder buildPath="${workspace_loc:/Aufgabe2und3/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.671293664" name="CDT Internal Builder.Debug" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.base.363999939" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.base">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1588696899" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1694374353" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.812374622" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base">
+ <option id="gnu.cpp.compiler.option.optimization.level.20558255" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1066384632" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1947230392" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.base.1641084126" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.base">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.415501025" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.269013065" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2113170718" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.489709831" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.997423847" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base">
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.415162733" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1515720232;cdt.managedbuild.config.gnu.exe.debug.1515720232.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1125681966;cdt.managedbuild.tool.gnu.cpp.compiler.input.2055221962">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.281449068;cdt.managedbuild.config.gnu.exe.release.281449068.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1944623056;cdt.managedbuild.tool.gnu.cpp.compiler.input.1411172284">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1515720232;cdt.managedbuild.config.gnu.exe.debug.1515720232.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.148146732;cdt.managedbuild.tool.gnu.c.compiler.input.1320074495">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.281449068;cdt.managedbuild.config.gnu.exe.release.281449068.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1032699552;cdt.managedbuild.tool.gnu.c.compiler.input.158227846">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.exe.release.281449068">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.281449068" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="Aufgabe2" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.281449068" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
+ <folderInfo id="cdt.managedbuild.config.gnu.exe.release.281449068." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.1163820951" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1657158945" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
+ <builder buildPath="${workspace_loc:/Aufgabe2/Release}" id="cdt.managedbuild.target.gnu.builder.exe.release.602021649" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.1383992200" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1944623056" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
+ <option id="gnu.cpp.compiler.exe.release.option.optimization.level.582338610" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.exe.release.option.debugging.level.1442525493" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1411172284" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.1032699552" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.242327324" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.exe.release.option.debugging.level.1448483851" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.158227846" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.423975042" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.406423738" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release">
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1133151976" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.2006650633" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.467444102" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ <entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1515720232;cdt.managedbuild.config.gnu.exe.debug.1515720232.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1125681966;cdt.managedbuild.tool.gnu.cpp.compiler.input.2055221962">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.281449068;cdt.managedbuild.config.gnu.exe.release.281449068.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1944623056;cdt.managedbuild.tool.gnu.cpp.compiler.input.1411172284">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1515720232;cdt.managedbuild.config.gnu.exe.debug.1515720232.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.148146732;cdt.managedbuild.tool.gnu.c.compiler.input.1320074495">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.281449068;cdt.managedbuild.config.gnu.exe.release.281449068.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1032699552;cdt.managedbuild.tool.gnu.c.compiler.input.158227846">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="Aufgabe2.cdt.managedbuild.target.gnu.exe.1167279579" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
+ </storageModule>
+</cproject>
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/.project b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/.project
new file mode 100644
index 0000000..33315d3
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/.project
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Aufgabe2und3</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/Aufgabe2und3/Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+</projectDescription>
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/VaR.plt b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/VaR.plt
new file mode 100644
index 0000000..5d9213f
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/VaR.plt
@@ -0,0 +1,25 @@
+set terminal wxt
+set terminal wxt font "/Library/Fonts/Sans Serif, 11"
+set multiplot
+set size 1.0,0.5
+set datafile separator ";"
+set xlabel "index"
+set ylabel "EUR"
+set origin 0.0,0.0
+plot "VaR.csv" using 1:2 title "one day" with steps
+set origin 0.0,0.5
+plot "VaR.csv" using 1:3 lt 3 title "ten days" with steps
+unset multiplot
+
+set output "VaR.png"
+set terminal png font "/Library/Fonts/Sans Serif, 11"
+set multiplot
+set size 1.0,0.5
+set datafile separator ";"
+set xlabel "index"
+set ylabel "EUR"
+set origin 0.0,0.0
+plot "VaR.csv" using 1:2 title "one day" with steps
+set origin 0.0,0.5
+plot "VaR.csv" using 1:3 lt 3 title "ten days" with steps
+replot
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/CholeskyDecomposition.cpp b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/CholeskyDecomposition.cpp
new file mode 100644
index 0000000..f74c99c
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/CholeskyDecomposition.cpp
@@ -0,0 +1,100 @@
+/*
+ * CholeskyDecomposition.cpp
+ *
+ * Created on: 20.05.2011
+ * Author: sven
+ */
+#ifndef PARAMETRISATION_H_
+ #include "Parametrisation.h"
+#endif
+
+#include <iostream>
+#include <iomanip>
+#include <cmath>
+
+#include "CholeskyDecomposition.h"
+
+CholeskyDecomposition::CholeskyDecomposition()
+{
+ for (UInt32 c = nenDaimler; c < nenEndOfCompanies ; c++)
+ {
+ mCholeskyMatrixOneDay.push_back(std::vector<double>(nenEndOfCompanies));
+ mCholeskyMatrixTenDays.push_back(std::vector<double>(nenEndOfCompanies));
+ }
+}
+
+CholeskyDecomposition::~CholeskyDecomposition() {
+}
+
+void CholeskyDecomposition::dumpCholeskyMatrices()
+{
+ std::cout << "Cholesky Matrix for one day" << std::endl;
+ int width = 12;
+ int prec = 6;
+ for(UInt32 i = 0; i < nenEndOfCompanies ; i++)
+ {
+ for (UInt32 j = 0; j < nenEndOfCompanies ; j++)
+ {
+ std::cout << std::setw(width) << std::setprecision(prec) << std::fixed << mCholeskyMatrixOneDay.at(i).at(j);
+ }
+ std::cout << std::endl;
+ }
+ std::cout << "Cholesky Matrix for ten days" << std::endl;
+ for(UInt32 i = 0; i < nenEndOfCompanies ; i++)
+ {
+ for (UInt32 j = 0; j < nenEndOfCompanies ; j++)
+ {
+ std::cout << std::setw(width) << std::setprecision(prec) << std::fixed << mCholeskyMatrixTenDays.at(i).at(j);
+ }
+ std::cout << std::endl;
+ }
+}
+
+void CholeskyDecomposition::calcCholeskyMatrix(CholeskyMatrix& d, const CovarianceMatrix& b)
+{
+ double sum,dp,diff;
+ for(int i = 0; i < nenEndOfCompanies ; i++)
+ {
+ for (int j = 0; j < nenEndOfCompanies ; j++)
+ {
+ if ( i < j)
+ {
+ d.at(i).at(j) = 0.0;
+ }
+ else if (i == j)
+ {
+ sum = 0.0;
+ int k=0;
+ while ( k < (i-1) )
+ {
+ dp = d.at(i).at(k);
+ sum += dp*dp;
+ k++;
+ }
+ diff = b.at(i).at(i) - sum;
+ d.at(i).at(j) = std::sqrt(diff);
+ }
+ else if (i > j)
+ {
+ sum = 0.0;
+ int k=0;
+ while (k < (i-1) )
+ {
+ sum += d.at(i).at(k) * d.at(j).at(k);
+ k++;
+ }
+ diff = b.at(i).at(j) - sum;
+ d.at(i).at(j) = (1.0 / d.at(j).at(j) ) * diff;
+ }
+ }
+ }
+}
+
+void CholeskyDecomposition::calcCholeskyDecompostions(const Parametrisation& params)
+{
+ calcCholeskyMatrix(mCholeskyMatrixOneDay,params.getCovarianceMatrix(nenOneDay));
+ calcCholeskyMatrix(mCholeskyMatrixTenDays,params.getCovarianceMatrix(nenTenDays));
+ dumpCholeskyMatrices();
+}
+
+
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/CholeskyDecomposition.h b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/CholeskyDecomposition.h
new file mode 100644
index 0000000..b7bdb6c
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/CholeskyDecomposition.h
@@ -0,0 +1,40 @@
+/*
+ * CholeskyDecomposition.h
+ *
+ * Created on: 20.05.2011
+ * Author: sven
+ */
+
+#ifndef CHOLESKYDECOMPOSITION_H_
+#define CHOLESKYDECOMPOSITION_H_
+
+#include <vector>
+
+typedef unsigned int UInt32;
+typedef std::vector< std::vector<double> > CholeskyMatrix;
+
+class CholeskyDecomposition {
+public:
+ CholeskyDecomposition();
+ virtual ~CholeskyDecomposition();
+ void calcCholeskyDecompostions(const Parametrisation& params);
+ const CholeskyMatrix& getMatrix(const enHoldingTime& holdingTime) const
+ {
+ switch(holdingTime)
+ {
+ case nenOneDay:
+ return mCholeskyMatrixOneDay;
+ case nenTenDays:
+ return mCholeskyMatrixTenDays;
+ default:
+ throw 17;
+ }
+ }
+private:
+ CholeskyMatrix mCholeskyMatrixOneDay;
+ CholeskyMatrix mCholeskyMatrixTenDays;
+ void dumpCholeskyMatrices();
+ void calcCholeskyMatrix(CholeskyMatrix& d, const CovarianceMatrix& b);
+};
+
+#endif /* CHOLESKYDECOMPOSITION_H_ */
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/HistoricSimulation.cpp b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/HistoricSimulation.cpp
new file mode 100644
index 0000000..412eac1
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/HistoricSimulation.cpp
@@ -0,0 +1,82 @@
+/*
+ * HistoricSimulation.cpp
+ *
+ * Created on: 27.05.2011
+ * Author: eisenhauer
+ */
+
+#include "HistoricSimulation.h"
+#include <algorithm>
+#include <iostream>
+#include <iomanip>
+#include <stdio.h>
+
+const double PORTFOLIO[] = {200000.0,150000.0,250000.0,300000.0,200000.0};
+
+HistoricSimulation::HistoricSimulation()
+{
+}
+
+HistoricSimulation::~HistoricSimulation() {
+}
+
+void HistoricSimulation::doSimulation(const Parametrisation& param, const enHoldingTime& nenHoldingTime)
+{
+ const std::vector<StockPrices>& stockPrices = param.getStockPrices();
+ uint8_t u8HoldingTime = static_cast<uint8_t>(nenHoldingTime);
+ uint32_t N = stockPrices.size() - u8HoldingTime;
+ uint32_t n = 0;
+ mData.clear();
+ std::vector<double> portfolio(static_cast<uint8_t>(nenEndOfCompanies));
+ double portfolioValue = 0.0;
+
+ for (uint8_t c=0; c < nenEndOfCompanies; c++)
+ {
+ mData.push_back(std::vector<double>(N));
+ portfolio.at(c) = param.getLastValue(static_cast<enCompany>(c) ) * PORTFOLIO[c];
+ portfolioValue += portfolio.at(c);
+ }
+
+ for(uint32_t counter = u8HoldingTime; counter < stockPrices.size() ; counter++)
+ {
+ for (uint8_t c=0; c < nenEndOfCompanies; c++)
+ {
+ double compRelChange = 0.0;
+ switch(nenHoldingTime)
+ {
+ case nenOneDay:
+ compRelChange = stockPrices.at(counter).mStock.at(c).mValueRelChangeOne;
+ break;
+ case nenTenDays:
+ compRelChange = stockPrices.at(counter).mStock.at(c).mValueRelChangeTen;
+ break;
+ }
+ double actCompValue = portfolio.at(c) + (portfolio.at(c) * compRelChange / 100);
+ mData.at(c).at(n) = actCompValue;
+ }
+ n++;
+ }
+
+ std::vector<double> simulatedPortfolioValues(N);
+ for (n = 0; n < N; n++) {
+ double sum = 0.0;
+ for (uint8_t c=0; c < nenEndOfCompanies; c++)
+ {
+ sum += mData.at(c).at(n);
+ }
+ simulatedPortfolioValues.at(n) = sum;
+ }
+ std::vector<double> simulatedPortfolioChanges(N);
+ for (n = 0; n < N; n++) {
+ simulatedPortfolioChanges.at(n) = portfolioValue - simulatedPortfolioValues.at(n);
+ }
+ std::sort(simulatedPortfolioChanges.begin(),simulatedPortfolioChanges.end());
+ uint32_t quantilIdx = (N / 100) - 1;
+ double VaR = simulatedPortfolioChanges.at(quantilIdx);
+ std::string strHoldTime = (nenHoldingTime==nenOneDay)?"one day: ":"ten days: ";
+ std::cout << "Historic simulation VaR for " + strHoldTime << VaR << " EUR" << std::endl;
+// printf("%u\n",quantilIdx);
+// for (n = 0; n < N; n++) {
+// std::cout << simulatedPortfolioChanges.at(n) << std::endl;
+// }
+}
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/HistoricSimulation.h b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/HistoricSimulation.h
new file mode 100644
index 0000000..ac71c3f
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/HistoricSimulation.h
@@ -0,0 +1,26 @@
+/*
+ * HistoricSimulation.h
+ *
+ * Created on: 27.05.2011
+ * Author: eisenhauer
+ */
+
+#ifndef HISTORICSIMULATION_H_
+#define HISTORICSIMULATION_H_
+
+#include "Parametrisation.h"
+#include <vector>
+
+typedef unsigned char uint8_t;
+typedef unsigned uint32_t;
+
+class HistoricSimulation {
+public:
+ HistoricSimulation();
+ virtual ~HistoricSimulation();
+ void doSimulation(const Parametrisation& param, const enHoldingTime& nenHoldingTime);
+private:
+ std::vector< std::vector<double> > mData;
+};
+
+#endif /* HISTORICSIMULATION_H_ */
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/MonteCarloSimulation.cpp b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/MonteCarloSimulation.cpp
new file mode 100644
index 0000000..3ca5beb
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/MonteCarloSimulation.cpp
@@ -0,0 +1,195 @@
+/*
+ * MonteCarloSimulation.cpp
+ *
+ * Created on: 20.05.2011
+ * Author: sven
+ */
+
+#include "Normaldistribution.h"
+#include "MonteCarloSimulation.h"
+#include <iomanip>
+#include <iostream>
+#include <algorithm>
+#include <vector>
+#include <fstream>
+
+static const unsigned NUMBER_OF_SIMULATIONS = 10000;
+
+const double PORTFOLIO[] = {200000.0,150000.0,250000.0,300000.0,200000.0};
+
+MonteCarloSimulation::MonteCarloSimulation()
+{
+ for (unsigned i=0; i<NUMBER_OF_SIMULATIONS; i++) {
+ mOneDaySimulatedCourseChanges.push_back(std::vector<double>(nenEndOfCompanies));
+ mTenDaySimulatedCourseChanges.push_back(std::vector<double>(nenEndOfCompanies));
+ }
+}
+
+MonteCarloSimulation::~MonteCarloSimulation() {
+}
+
+void MonteCarloSimulation::doSimulations(const Parametrisation& param, const CholeskyDecomposition& cholDecomp)
+{
+ std::vector<double> y(nenEndOfCompanies);
+ std::vector<double> mu(nenEndOfCompanies);
+ Normaldistribution norm;
+
+ for (int i=0; i<2; i++) {
+ enHoldingTime d = (i==0)?nenOneDay:nenTenDays;
+ const CholeskyMatrix& D = cholDecomp.getMatrix(d);
+ param.getArithAverages(mu,d);
+ for (unsigned i=0; i< NUMBER_OF_SIMULATIONS; i++) {
+ norm.calcRandomVector(D,mu,y);
+ if (d == nenOneDay) {
+ for (unsigned j=0; j<nenEndOfCompanies;j++) {
+ mOneDaySimulatedCourseChanges.at(i).at(j) = y.at(j);
+ }
+ } else if (d == nenTenDays) {
+ for (unsigned j=0; j<nenEndOfCompanies;j++) {
+ mTenDaySimulatedCourseChanges.at(i).at(j) = y.at(j);
+ }
+ }
+ }
+ }
+ std::vector<double> portfolio(nenEndOfCompanies);
+ double portfolioValue = 0.0;
+ for (unsigned c=0; c < nenEndOfCompanies; c++)
+ {
+ portfolio.at(c) = param.getLastValue(static_cast<enCompany>(c) ) * PORTFOLIO[c];
+ portfolioValue += portfolio.at(c);
+ }
+
+ std::vector< std::vector<double> > simulatedPortfolioOneDay;
+ std::vector< std::vector<double> > simulatedPortfolioTenDays;
+ std::vector<double> simulatedPortfolioValuesOneDay(NUMBER_OF_SIMULATIONS);
+ std::vector<double> simulatedPortfolioValuesTenDays(NUMBER_OF_SIMULATIONS);
+
+ for (unsigned i=0; i<NUMBER_OF_SIMULATIONS; i++) {
+ simulatedPortfolioOneDay.push_back(std::vector<double>(nenEndOfCompanies));
+ simulatedPortfolioTenDays.push_back(std::vector<double>(nenEndOfCompanies));
+ simulatedPortfolioValuesOneDay.at(i) = 0.0;
+ simulatedPortfolioValuesTenDays.at(i) = 0.0;
+ }
+
+ for (unsigned i=0; i<NUMBER_OF_SIMULATIONS; i++) {
+ for (unsigned j=0; j<nenEndOfCompanies;j++) {
+ simulatedPortfolioOneDay.at(i).at(j) = portfolio.at(j) + (portfolio.at(j) * mOneDaySimulatedCourseChanges.at(i).at(j) / 100.0);
+ simulatedPortfolioTenDays.at(i).at(j) = portfolio.at(j) + (portfolio.at(j) * mTenDaySimulatedCourseChanges.at(i).at(j) / 100.0);
+ simulatedPortfolioValuesOneDay.at(i) += simulatedPortfolioOneDay.at(i).at(j);
+ simulatedPortfolioValuesTenDays.at(i) += simulatedPortfolioTenDays.at(i).at(j);
+ }
+// std::cout << std::setw(20) << std::fixed << (portfolioValue - simulatedPortfolioValuesOneDay.at(i))
+// << std::setw(20) << (portfolioValue - simulatedPortfolioValuesTenDays.at(i))
+// << std::endl;
+ }
+ std::sort(simulatedPortfolioValuesOneDay.begin(), simulatedPortfolioValuesOneDay.end());
+ std::sort(simulatedPortfolioValuesTenDays.begin(), simulatedPortfolioValuesTenDays.end());
+
+ std::vector<double> portfolioValueChangesOneDay(NUMBER_OF_SIMULATIONS);
+ std::vector<double> portfolioValueChangesTenDays(NUMBER_OF_SIMULATIONS);
+ std::ofstream of;
+ of.open("VaR.csv",std::ios::out);
+ for (unsigned i=0; i<NUMBER_OF_SIMULATIONS; i++) {
+ portfolioValueChangesOneDay.at(i) = simulatedPortfolioValuesOneDay.at(i) - portfolioValue;
+ portfolioValueChangesTenDays.at(i) = simulatedPortfolioValuesTenDays.at(i) - portfolioValue;
+// std::cout << std::setw(20) << std::fixed << (portfolioValue - simulatedPortfolioValuesOneDay.at(i))
+// << std::setw(20) << (portfolioValue - simulatedPortfolioValuesTenDays.at(i))
+// << std::endl;
+ of << i << ";" << std::fixed << portfolioValueChangesOneDay.at(i)
+ << ";" << portfolioValueChangesTenDays.at(i)
+ << std::endl;
+ }
+ of.close();
+ unsigned VaRIdx = NUMBER_OF_SIMULATIONS / 100;
+ std::cout << "MonteCarlo VaR one day: " << std::setprecision(2) << std::fixed << portfolioValueChangesOneDay.at(VaRIdx)
+ << " EUR" << std::endl;
+ std::cout << "MonteCarlo VaR ten days: " << std::setprecision(2) << std::fixed << portfolioValueChangesTenDays.at(VaRIdx)
+ << " EUR" << std::endl;
+
+ // calculate arithmetic average of simulated values
+ std::vector<double> simAverOneDay(nenEndOfCompanies);
+ std::vector<double> simAverTenDays(nenEndOfCompanies);
+
+ for (unsigned n=0; n < NUMBER_OF_SIMULATIONS ; n++)
+ {
+ for (unsigned c = 0; c < nenEndOfCompanies; c++)
+ {
+ simAverOneDay.at(c) += mOneDaySimulatedCourseChanges.at(n).at(c);
+ simAverTenDays.at(c) += mTenDaySimulatedCourseChanges.at(n).at(c);
+ }
+ }
+ for (unsigned c = 0; c < nenEndOfCompanies; c++)
+ {
+ simAverOneDay.at(c) /= NUMBER_OF_SIMULATIONS;
+ simAverTenDays.at(c) /= NUMBER_OF_SIMULATIONS;
+ }
+ int width = 20;
+ int prec = 6;
+ std::cout << std::setw(width) << "Comp." << std::setw(width) << "sim. one day aver."
+ << std::setw(width) << "sim. ten days aver." << std::endl;
+ for (unsigned c = 0; c < nenEndOfCompanies; c++)
+ {
+ std::cout << std::setw(width) << c << std::setw(width) << std::setprecision(prec) << simAverOneDay.at(c)
+ << std::setw(width) << simAverTenDays.at(c) << std::endl;
+ }
+
+ // covariance matrices of simulation
+ CovarianceMatrix simOneDayCovMatrix;
+ CovarianceMatrix simTenDaysCovMatrix;
+ double sum,diffI,diffJ;
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ simOneDayCovMatrix.push_back(std::vector<double>(nenEndOfCompanies));
+ simTenDaysCovMatrix.push_back(std::vector<double>(nenEndOfCompanies));
+ }
+
+ //one day
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ if (i <= j) {
+ sum = 0.0;
+ for (unsigned n=0 ; n < NUMBER_OF_SIMULATIONS ; n++) {
+ diffI = mOneDaySimulatedCourseChanges.at(n).at(i) - simAverOneDay.at(i);
+ diffJ = mOneDaySimulatedCourseChanges.at(n).at(j) - simAverOneDay.at(j);
+ sum += (diffI * diffJ) / (NUMBER_OF_SIMULATIONS - 1);
+ }
+ simOneDayCovMatrix.at(i).at(j) = sum;
+ } else {
+ simOneDayCovMatrix.at(i).at(j) = simOneDayCovMatrix.at(j).at(i);
+ }
+ }
+ }
+
+ // ten days
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ if (i <= j) {
+ sum = 0.0;
+ for (unsigned n=0 ; n < NUMBER_OF_SIMULATIONS ; n++) {
+ diffI = mTenDaySimulatedCourseChanges.at(n).at(i) - simAverTenDays.at(i);
+ diffJ = mTenDaySimulatedCourseChanges.at(n).at(j) - simAverTenDays.at(j);
+ sum += (diffI * diffJ) / (NUMBER_OF_SIMULATIONS - 1);
+ }
+ simTenDaysCovMatrix.at(i).at(j) = sum;
+ } else {
+ simTenDaysCovMatrix.at(i).at(j) = simTenDaysCovMatrix.at(j).at(i);
+ }
+ }
+ }
+
+ // dump covariance matrices
+ width = 12;
+ std::cout << "Covariance matrix for simulation for one days" << std::endl;
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ std::cout << std::setw(width) << std::setprecision(prec) << simOneDayCovMatrix.at(i).at(j);
+ }
+ std::cout << std::endl;
+ }
+ std::cout << "Covariance matrix for simulation for ten days" << std::endl;
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ std::cout << std::setw(width) << std::setprecision(prec) << simTenDaysCovMatrix.at(i).at(j);
+ }
+ std::cout << std::endl;
+ }
+}
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/MonteCarloSimulation.h b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/MonteCarloSimulation.h
new file mode 100644
index 0000000..7865067
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/MonteCarloSimulation.h
@@ -0,0 +1,28 @@
+/*
+ * MonteCarloSimulation.h
+ *
+ * Created on: 20.05.2011
+ * Author: sven
+ */
+
+#ifndef MONTECARLOSIMULATION_H_
+#define MONTECARLOSIMULATION_H_
+
+#include "Parametrisation.h"
+#include "CholeskyDecomposition.h"
+
+#include <vector>
+
+typedef std::vector< std::vector<double> > SimulatedCourseChanges;
+
+class MonteCarloSimulation {
+public:
+ MonteCarloSimulation();
+ virtual ~MonteCarloSimulation();
+ void doSimulations(const Parametrisation& param, const CholeskyDecomposition& cholDecomp);
+private:
+ SimulatedCourseChanges mOneDaySimulatedCourseChanges;
+ SimulatedCourseChanges mTenDaySimulatedCourseChanges;
+};
+
+#endif /* MONTECARLOSIMULATION_H_ */
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Normaldistribution.cpp b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Normaldistribution.cpp
new file mode 100644
index 0000000..5c9370b
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Normaldistribution.cpp
@@ -0,0 +1,64 @@
+/*
+ * Normaldistribution.cpp
+ *
+ * Created on: 20.05.2011
+ * Author: sven
+ */
+
+#include "Normaldistribution.h"
+#include <cmath>
+#include <cstdlib>
+#include <iostream>
+
+Normaldistribution::Normaldistribution() {
+}
+
+Normaldistribution::~Normaldistribution() {
+}
+
+void Normaldistribution::calcRandomVector(const CholeskyMatrix& D, const std::vector<double>& mu , std::vector<double>& y)
+{
+ std::vector<double> u(nenEndOfCompanies);
+ calcStandardNormalDistributedRandomVector(nenEndOfCompanies,u);
+ for (int i=0;i<nenEndOfCompanies;i++)
+ {
+ double sum = 0.0;
+ for (int j=0; j< nenEndOfCompanies ; j++)
+ {
+ sum += (D.at(i).at(j) * u.at(j));
+ }
+ y.at(i) = sum + mu.at(i);
+// std::cout << y.at(i) << std::endl;
+ }
+// std::cout << std::endl;
+}
+
+void Normaldistribution::calcStandardNormalDistributedRandomVector(const int size, std::vector<double>& u)
+{
+ double x1,x2;
+ double v1,v2;
+ double u1,u2;
+ double s;
+ int counter = 0;
+ while (counter < size)
+ {
+ do
+ {
+ x1 = ((double) rand()) / (RAND_MAX + 1.0);
+ x2 = ((double) rand()) / (RAND_MAX + 1.0);
+ v1 = (2.0 * x1) - 1.0;
+ v2 = (2.0 * x2) - 1.0;
+ s = (v1*v1) + (v2*v2);
+ } while (s >= 1.0);
+ u1 = v1 * std::sqrt( - (2.0 / s) * std::log(s) );
+ u2 = v2 * std::sqrt( - (2.0 / s) * std::log(s) );
+ if (counter < size) {
+ u.at(counter) = u1;
+ counter++;
+ }
+ if (counter < size) {
+ u.at(counter) = u2;
+ counter++;
+ }
+ }
+}
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Normaldistribution.h b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Normaldistribution.h
new file mode 100644
index 0000000..5609ba3
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Normaldistribution.h
@@ -0,0 +1,24 @@
+/*
+ * Normaldistribution.h
+ *
+ * Created on: 20.05.2011
+ * Author: sven
+ */
+
+#ifndef NORMALDISTRIBUTION_H_
+#define NORMALDISTRIBUTION_H_
+
+#include "Parametrisation.h"
+#include "CholeskyDecomposition.h"
+#include <vector>
+
+class Normaldistribution {
+public:
+ Normaldistribution();
+ virtual ~Normaldistribution();
+ void calcRandomVector(const CholeskyMatrix& D, const std::vector<double>& mu , std::vector<double>& y);
+private:
+ void calcStandardNormalDistributedRandomVector(const int size, std::vector<double>& u);
+};
+
+#endif /* NORMALDISTRIBUTION_H_ */
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Parametrisation.cpp b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Parametrisation.cpp
new file mode 100644
index 0000000..a326008
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Parametrisation.cpp
@@ -0,0 +1,299 @@
+/*
+ * Parametrisation.cpp
+ *
+ * Created on: 13.05.2011
+ * Author: sven
+ */
+
+#include "Parametrisation.h"
+
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <cmath>
+#include <iomanip>
+
+const char* Parametrisation::msInputFilename = "../Kurse_SS11.csv";
+
+Parametrisation::Parametrisation()
+:mArithAverageVectors(nenEndOfCompanies)
+,mStandardDeviationsOneDay(nenEndOfCompanies)
+,mStandardDeviationsTenDays(nenEndOfCompanies)
+{
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++) {
+ mCovarinaceMatrixOneDay.push_back(std::vector<double>(nenEndOfCompanies));
+ mCovarinaceMatrixTenDays.push_back(std::vector<double>(nenEndOfCompanies));
+ mCorrelationMatrixOneDay.push_back(std::vector<double>(nenEndOfCompanies));
+ mCorrelationMatrixTenDays.push_back(std::vector<double>(nenEndOfCompanies));
+ }
+}
+
+Parametrisation::~Parametrisation() {
+}
+
+void Parametrisation::readCsvFile()
+{
+ unsigned dayCounter = 0;
+ std::ifstream inFile;
+ inFile.open(msInputFilename, std::ios::in);
+ char buffer[256];
+ unsigned lineNum = 0;
+ while(inFile.getline(buffer, sizeof(buffer)))
+ {
+ lineNum++;
+ if (lineNum <= 3) {
+ continue;
+ }
+ std::string tmp(buffer);
+ std::vector<std::string> tokens;
+ this->tokenize(tmp,tokens);
+ StockPrices prices;
+ prices.mDayIdx = dayCounter;
+ prices.mDate = tokens.at(0);
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++) {
+ prices.mStock.at(static_cast<enCompany>(c)).mValue = toDouble(tokens.at(c + 1));
+ }
+ mLastYearData.push_back(prices);
+ dayCounter++;
+ }
+ inFile.close();
+}
+void Parametrisation::tokenize(const std::string& str,
+ std::vector<std::string>& tokens,
+ const std::string& delimiters)
+{
+ // Skip delimiters at beginning.
+ std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
+ // Find first "non-delimiter".
+ std::string::size_type pos = str.find_first_of(delimiters, lastPos);
+
+ while (std::string::npos != pos || std::string::npos != lastPos)
+ {
+ std::string token = str.substr(lastPos, pos - lastPos);
+ std::string::size_type commaPos = token.find(",");
+ if (commaPos != std::string::npos)
+ {
+ token.replace(commaPos,1,".");
+ }
+ // Found a token, add it to the vector.
+ tokens.push_back(token);
+ // Skip delimiters. Note the "not_of"
+ lastPos = str.find_first_not_of(delimiters, pos);
+ // Find next "non-delimiter"
+ pos = str.find_first_of(delimiters, lastPos);
+ }
+}
+ double Parametrisation::toDouble(const std::string& str)
+ {
+ std::istringstream ssIn(str);
+ double res;
+ ssIn >> res;
+ return res;
+ }
+void Parametrisation::dumpValues()
+{
+ std::vector<StockPrices>::const_iterator it;
+ it = mLastYearData.begin();
+ for (; it != mLastYearData.end() ; it++) {
+ StockPrices sp = *it;
+ std::cout << sp.mDayIdx << ";" << sp.mDate;
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++) {
+ std::cout << ";" << sp.mStock.at(c).mValue;
+ }
+ std::cout << std::endl;
+ }
+}
+
+void Parametrisation::dumpRelChanges(const enHoldingTime& holdingTime)
+{
+ std::ofstream outFile;
+ std::ostringstream ssOut;
+ ssOut<<holdingTime;
+ std::string outFilename = "relChanges" + ssOut.str() + ".csv";
+ outFile.open(outFilename.c_str(), std::ios::out);
+ unsigned days = mLastYearData.size();
+ unsigned counter = static_cast<unsigned>(holdingTime);
+ for ( ; counter < days ; counter++) {
+ StockPrices sp = mLastYearData.at(counter);
+ outFile << sp.mDayIdx << ";" << sp.mDate;
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++) {
+ switch (holdingTime)
+ {
+ case nenOneDay:
+ outFile << ";" << sp.mStock.at(c).mValueRelChangeOne;
+ break;
+ case nenTenDays:
+ outFile << ";" << sp.mStock.at(c).mValueRelChangeTen;
+ break;
+ }
+
+ }
+ outFile << std::endl;
+ }
+ outFile.close();
+}
+
+void Parametrisation::calcRelChanges(const enHoldingTime& holdingTime)
+{
+ unsigned days = mLastYearData.size();
+ unsigned counter = static_cast<unsigned>(holdingTime);
+ StockPrices* prev;
+ StockPrices* act;
+ for ( ; counter < days ; counter++) {
+ act = &(mLastYearData.at(counter));
+ prev = &(mLastYearData.at(counter - static_cast<unsigned>(holdingTime)));
+ act->calcRelChanges(*prev,holdingTime);
+ }
+ dumpRelChanges(holdingTime);
+}
+
+void Parametrisation::calcArithAverageVectors()
+{
+ unsigned days = mLastYearData.size();
+ unsigned counter = 1;
+ for ( ; counter < days ; counter++) {
+ StockPrices sp = mLastYearData.at(counter);
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++)
+ {
+ if (counter >= nenOneDay) {
+ mArithAverageVectors.at(c).mArithAverOneDay += sp.mStock.at(c).mValueRelChangeOne;
+ }
+ if (counter >= nenTenDays) {
+ mArithAverageVectors.at(c).mArithAverTenDays += sp.mStock.at(c).mValueRelChangeTen;
+ }
+ }
+ }
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++)
+ {
+ mArithAverageVectors.at(c).mArithAverOneDay /= (days - nenOneDay - 1);
+ mArithAverageVectors.at(c).mArithAverTenDays /= ( days - nenTenDays - 1);
+ }
+
+ // standard deviation for one day
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++)
+ {
+ double sum = 0.0;
+ double diff = 0.0;
+ for (unsigned counter = nenOneDay; counter < days ; counter++) {
+ diff = mLastYearData.at(counter).mStock.at(c).mValueRelChangeOne - mArithAverageVectors.at(c).mArithAverOneDay;
+ sum += (diff * diff) / (mLastYearData.size() - nenOneDay - 1);
+ }
+ mStandardDeviationsOneDay.at(c) = std::sqrt(sum);
+ }
+
+ // standard deviation for ten days
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++)
+ {
+ double sum = 0.0;
+ double diff = 0.0;
+ for (unsigned counter = nenTenDays; counter < days ; counter++) {
+ diff = mLastYearData.at(counter).mStock.at(c).mValueRelChangeTen - mArithAverageVectors.at(c).mArithAverTenDays;
+ sum += (diff * diff) / (mLastYearData.size() - nenTenDays - 1);
+ }
+ mStandardDeviationsTenDays.at(c) = std::sqrt(sum);
+ }
+ dumpArithAverageVectors();
+}
+
+void Parametrisation::dumpArithAverageVectors()
+{
+ int width = 16;
+ int prec = 6;
+ std::cout << std::setw(width) << "Idx" << std::setw(width) << "one day avg" << std::setw(width) << "ten days avg" << std::endl;
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++)
+ {
+ ArithAverages av = mArithAverageVectors.at(c);
+ std::cout << std::setw(width) << std::setprecision(prec) << std::fixed << c
+ << std::setw(width) << std::setprecision(prec) << std::fixed << av.mArithAverOneDay
+ << std::setw(width) << std::setprecision(prec) << std::fixed << av.mArithAverTenDays << std::endl;
+ }
+}
+
+void Parametrisation::calcCovarianceMatrices()
+{
+ double diffI = 0.0;
+ double diffJ = 0.0;
+ double sum = 0.0;
+
+ //one day
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ if (i <= j) {
+ sum = 0.0;
+ for (unsigned n=nenOneDay ; n < mLastYearData.size() ; n++) {
+ diffI = mLastYearData.at(n).mStock.at(i).mValueRelChangeOne - mArithAverageVectors.at(i).mArithAverOneDay;
+ diffJ = mLastYearData.at(n).mStock.at(j).mValueRelChangeOne - mArithAverageVectors.at(j).mArithAverOneDay;
+ sum += (diffI * diffJ) / (mLastYearData.size() - nenOneDay - 1);
+ }
+ mCovarinaceMatrixOneDay.at(i).at(j) = sum;
+ } else {
+ mCovarinaceMatrixOneDay.at(i).at(j) = mCovarinaceMatrixOneDay.at(j).at(i);
+ }
+ }
+ }
+
+ // ten days
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ sum = 0.0;
+ for (unsigned n=nenTenDays ; n < mLastYearData.size() ; n++) {
+ diffI = mLastYearData.at(n).mStock.at(i).mValueRelChangeTen - mArithAverageVectors.at(i).mArithAverTenDays;
+ diffJ = mLastYearData.at(n).mStock.at(j).mValueRelChangeTen - mArithAverageVectors.at(j).mArithAverTenDays;
+ sum += (diffI * diffJ) / (mLastYearData.size() - nenTenDays - 1);
+ }
+ mCovarinaceMatrixTenDays.at(i).at(j) = sum;
+ }
+ }
+ dumpCovarianceMatrices();
+}
+
+void Parametrisation::dumpCovarianceMatrices()
+{
+ int width = 12;
+ int prec = 6;
+ std::cout << "Covariance matrix for one day" << std::endl;
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ std::cout << std::setw(width) << std::setprecision(prec) << std::fixed << mCovarinaceMatrixOneDay.at(i).at(j);
+ }
+ std::cout << std::endl;
+ }
+ std::cout << "Covariance matrix for ten days" << std::endl;
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ std::cout << std::setw(width) << std::setprecision(prec) << std::fixed << mCovarinaceMatrixTenDays.at(i).at(j);
+ }
+ std::cout << std::endl;
+ }
+}
+
+void Parametrisation::calcCorrelationMatrices()
+{
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ mCorrelationMatrixOneDay.at(i).at(j) = mCovarinaceMatrixOneDay.at(i).at(j) / (mStandardDeviationsOneDay.at(i) * mStandardDeviationsOneDay.at(j));
+ mCorrelationMatrixTenDays.at(i).at(j) = mCovarinaceMatrixTenDays.at(i).at(j) / (mStandardDeviationsTenDays.at(i) * mStandardDeviationsTenDays.at(j));
+ }
+ }
+ dumpCorrelationMatrices();
+}
+
+void Parametrisation::dumpCorrelationMatrices()
+{
+ int width = 12;
+ int prec = 6;
+ std::cout << "Correlation matrix for one day" << std::endl;
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ std::cout << std::setw(width) << std::setprecision(prec) << std::fixed << mCorrelationMatrixOneDay.at(i).at(j);
+ }
+ std::cout << std::endl;
+ }
+ std::cout << "Correlation matrix for ten days" << std::endl;
+ for (unsigned i = static_cast<unsigned>(nenDaimler) ; i < static_cast<unsigned>(nenEndOfCompanies); i++) {
+ for (unsigned j = static_cast<unsigned>(nenDaimler) ; j < static_cast<unsigned>(nenEndOfCompanies); j++) {
+ std::cout << std::setw(width) << std::setprecision(prec) << std::fixed << mCorrelationMatrixTenDays.at(i).at(j);
+ }
+ std::cout << std::endl;
+ }
+}
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Parametrisation.h b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Parametrisation.h
new file mode 100644
index 0000000..337442e
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/Parametrisation.h
@@ -0,0 +1,160 @@
+/*
+ * Parametrisation.h
+ *
+ * Created on: 13.05.2011
+ * Author: sven
+ */
+
+#ifndef PARAMETRISATION_H_
+#define PARAMETRISATION_H_
+
+#include <vector>
+#include <map>
+#include <string>
+
+enum enCompany
+{
+ nenDaimler = 0,
+ nenDeuBa,
+ nenFMC,
+ nenRWE,
+ nenSolarWorld,
+
+ // must be last entry
+ nenEndOfCompanies
+};
+
+enum enHoldingTime
+{
+ nenOneDay = 1,
+ nenTenDays = 10
+};
+
+struct Stock
+{
+ double mValue;
+ double mValueRelChangeOne;
+ double mValueRelChangeTen;
+ Stock()
+ :mValue(-99999999.9),mValueRelChangeOne(-99999999.9),mValueRelChangeTen(-99999999.9)
+ {}
+ void calcRelChange(const Stock& prev, const enHoldingTime& holdingTime)
+ {
+ switch (holdingTime)
+ {
+ case nenOneDay:
+ mValueRelChangeOne = ((mValue - prev.mValue) / prev.mValue) * 100.0;
+ break;
+ case nenTenDays:
+ mValueRelChangeTen = ((mValue - prev.mValue) / prev.mValue) * 100.0;
+ break;
+ default:
+ break;
+ }
+
+ }
+};
+
+struct StockPrices
+{
+ StockPrices()
+ :mStock(nenEndOfCompanies) {}
+ std::string mDate;
+ unsigned mDayIdx;
+ std::vector<Stock> mStock;
+ void calcRelChanges(const StockPrices& prevDay, const enHoldingTime& holdingTime)
+ {
+ for (unsigned c = static_cast<unsigned>(nenDaimler) ; c < static_cast<unsigned>(nenEndOfCompanies); c++) {
+ mStock.at(c).calcRelChange(prevDay.mStock.at(c), holdingTime);
+ }
+ }
+};
+
+
+struct ArithAverages{
+ double mArithAverOneDay;
+ double mArithAverTenDays;
+ ArithAverages()
+ :mArithAverOneDay(0.0),mArithAverTenDays(0.0) {}
+};
+
+
+typedef std::vector< std::vector<double> > CovarianceMatrix;
+typedef CovarianceMatrix CorrelationMatrix;
+
+
+class Parametrisation {
+public:
+ Parametrisation();
+ virtual ~Parametrisation();
+ void readCsvFile();
+ void calcRelChanges(const enHoldingTime& holdingTime);
+ void calcArithAverageVectors();
+ void calcCovarianceMatrices();
+ void calcCorrelationMatrices();
+
+ double getLastValue(const enCompany& comp) const
+ {
+ return mLastYearData.back().mStock.at(comp).mValue;
+ }
+
+ const CovarianceMatrix& getCovarianceMatrix(const enHoldingTime& holdingTime) const
+ {
+ switch (holdingTime)
+ {
+ case nenOneDay:
+ //return mCorrelationMatrixOneDay;
+ return mCovarinaceMatrixOneDay;
+ case nenTenDays:
+ //return mCorrelationMatrixTenDays;
+ return mCovarinaceMatrixTenDays;
+ default:
+ throw 17 ;
+ }
+ }
+ void getArithAverages(std::vector<double>& mu, const enHoldingTime holdingTime) const
+ {
+ unsigned c;
+ switch(holdingTime)
+ {
+ case nenOneDay:
+ for (c = nenDaimler; c < nenEndOfCompanies; c++)
+ {
+ mu.at(c) = mArithAverageVectors.at(c).mArithAverOneDay;
+ }
+ return;
+ case nenTenDays:
+ for (c = nenDaimler; c < nenEndOfCompanies; c++)
+ {
+ mu.at(c) = mArithAverageVectors.at(c).mArithAverTenDays;
+ }
+ return;
+ default:
+ throw 17;
+ }
+ }
+ const std::vector<StockPrices>& getStockPrices() const
+ {
+ return mLastYearData;
+ }
+private:
+ const static char* msInputFilename;
+ std::vector< StockPrices > mLastYearData;
+ std::vector<ArithAverages> mArithAverageVectors;
+ std::vector<double> mStandardDeviationsOneDay;
+ std::vector<double> mStandardDeviationsTenDays;
+ CovarianceMatrix mCovarinaceMatrixOneDay;
+ CovarianceMatrix mCovarinaceMatrixTenDays;
+ CorrelationMatrix mCorrelationMatrixOneDay;
+ CorrelationMatrix mCorrelationMatrixTenDays;
+
+ void tokenize(const std::string& str, std::vector<std::string>& tokens, const std::string& delimiters = ";");
+ double toDouble(const std::string& str);
+ void dumpValues();
+ void dumpRelChanges(const enHoldingTime& holdingTime);
+ void dumpArithAverageVectors();
+ void dumpCovarianceMatrices();
+ void dumpCorrelationMatrices();
+};
+
+#endif /* PARAMETRISATION_H_ */
diff --git a/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/main.cpp b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/main.cpp
new file mode 100644
index 0000000..e868108
--- /dev/null
+++ b/Master/Modellbildung_und_Simulation/Aufgabenblatt2/Aufgabe2und3/src/main.cpp
@@ -0,0 +1,35 @@
+/*
+ * main.cpp
+ *
+ * Created on: 13.05.2011
+ * Author: sven
+ */
+
+#include "Parametrisation.h"
+#include "CholeskyDecomposition.h"
+#include "MonteCarloSimulation.h"
+#include "HistoricSimulation.h"
+
+#include <cstdlib>
+#include <ctime>
+
+int main(int argc, char* argv[])
+{
+ srand(time(NULL));
+ Parametrisation param;
+ CholeskyDecomposition cholDecomp;
+ param.readCsvFile();
+ param.calcRelChanges(nenOneDay);
+ param.calcRelChanges(nenTenDays);
+ param.calcArithAverageVectors();
+ param.calcCovarianceMatrices();
+ param.calcCorrelationMatrices();
+ cholDecomp.calcCholeskyDecompostions(param);
+ HistoricSimulation hsim;
+ hsim.doSimulation(param,nenOneDay);
+ hsim.doSimulation(param,nenTenDays);
+ MonteCarloSimulation sim;
+ sim.doSimulations(param,cholDecomp);
+
+ return 0;
+}