From a908faf1a137ab0b98c1f37cef3d7a28acde38f9 Mon Sep 17 00:00:00 2001 From: Thomas Heinemann Date: Sun, 19 Aug 2012 16:18:57 +0200 Subject: [PATCH] Worked on TODO's (minor stuff) --- src/parser/read_tra_file.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/parser/read_tra_file.cpp b/src/parser/read_tra_file.cpp index 6c191c910..563b8ff53 100644 --- a/src/parser/read_tra_file.cpp +++ b/src/parser/read_tra_file.cpp @@ -1,5 +1,9 @@ -/* TODO: Include the proper description here, with reference to the original authors - * read_tra_file.cpp +/*! read_tra_file.cpp + * Provides functions for reading a *.tra file describing the transition + * system of a Markov chain (DTMC) and saving it into a corresponding + * matrix. + * + * Reuses code from the file "read_tra_file.c" from the old MRMC project. * * Created on: 15.08.2012 * Author: Thomas Heinemann @@ -81,7 +85,6 @@ static uint_fast32_t make_first_pass(FILE* p) { sparse::StaticSparseMatrix * read_tra_file(const char * filename) { - //TODO: Tidy this function up + comment(Thomas Heinemann, 15-08-2012) FILE *p; char s[1024]; uint_fast32_t rows, row, col, nnz, non_zero; @@ -125,7 +128,7 @@ sparse::StaticSparseMatrix * read_tra_file(const char * filename) sp = new sparse::StaticSparseMatrix(rows,non_zero); sp->initialize(); if ( NULL == sp ) { - //TODO: Throw exception (Thomas Heinemann, 15-08-2012) + throw std::bad_alloc(); return NULL; }