@ -6,20 +6,24 @@
*/
*/
# include "src/parser/DeterministicSparseTransitionParser.h"
# include "src/parser/DeterministicSparseTransitionParser.h"
# include "src/exceptions/FileIoException.h"
# include "src/exceptions/WrongFileFormatException.h"
# include "boost/integer/integer_mask.hpp"
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <clocale>
# include <iostream>
# include <errno.h>
# include <errno.h>
# include <time.h>
# include <time.h>
# include <sys/stat.h>
# include <sys/stat.h>
# include <fcntl.h>
# include <fcntl.h>
# include <locale.h>
# include <locale.h>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <clocale>
# include <iostream>
# include <string>
# include "src/exceptions/FileIoException.h"
# include "src/exceptions/WrongFileFormatException.h"
# include "boost/integer/integer_mask.hpp"
# include "log4cplus/logger.h"
# include "log4cplus/logger.h"
# include "log4cplus/loggingmacros.h"
# include "log4cplus/loggingmacros.h"
extern log4cplus : : Logger logger ;
extern log4cplus : : Logger logger ;
@ -104,8 +108,7 @@ uint_fast64_t DeterministicSparseTransitionParser::firstPass(char* buf, uint_fas
*/
*/
DeterministicSparseTransitionParser : : DeterministicSparseTransitionParser ( std : : string const & filename )
DeterministicSparseTransitionParser : : DeterministicSparseTransitionParser ( std : : string const & filename )
: matrix ( nullptr )
{
: matrix ( nullptr ) {
/*
/*
* enforce locale where decimal point is ' . '
* enforce locale where decimal point is ' . '
*/
*/
@ -125,8 +128,7 @@ DeterministicSparseTransitionParser::DeterministicSparseTransitionParser(std::st
/*
/*
* if first pass returned zero , the file format was wrong
* if first pass returned zero , the file format was wrong
*/
*/
if ( non_zero = = 0 )
{
if ( non_zero = = 0 ) {
LOG4CPLUS_ERROR ( logger , " Error while parsing " < < filename < < " : erroneous file format. " ) ;
LOG4CPLUS_ERROR ( logger , " Error while parsing " < < filename < < " : erroneous file format. " ) ;
throw storm : : exceptions : : WrongFileFormatException ( ) ;
throw storm : : exceptions : : WrongFileFormatException ( ) ;
}
}
@ -153,8 +155,7 @@ DeterministicSparseTransitionParser::DeterministicSparseTransitionParser(std::st
*/
*/
LOG4CPLUS_INFO ( logger , " Attempting to create matrix of size " < < ( maxnode + 1 ) < < " x " < < ( maxnode + 1 ) < < " . " ) ;
LOG4CPLUS_INFO ( logger , " Attempting to create matrix of size " < < ( maxnode + 1 ) < < " x " < < ( maxnode + 1 ) < < " . " ) ;
this - > matrix = std : : shared_ptr < storm : : storage : : SparseMatrix < double > > ( new storm : : storage : : SparseMatrix < double > ( maxnode + 1 ) ) ;
this - > matrix = std : : shared_ptr < storm : : storage : : SparseMatrix < double > > ( new storm : : storage : : SparseMatrix < double > ( maxnode + 1 ) ) ;
if ( this - > matrix = = NULL )
{
if ( this - > matrix = = NULL ) {
LOG4CPLUS_ERROR ( logger , " Could not create matrix of size " < < ( maxnode + 1 ) < < " x " < < ( maxnode + 1 ) < < " . " ) ;
LOG4CPLUS_ERROR ( logger , " Could not create matrix of size " < < ( maxnode + 1 ) < < " x " < < ( maxnode + 1 ) < < " . " ) ;
throw std : : bad_alloc ( ) ;
throw std : : bad_alloc ( ) ;
}
}
@ -166,8 +167,7 @@ DeterministicSparseTransitionParser::DeterministicSparseTransitionParser(std::st
/*
/*
* read all transitions from file
* read all transitions from file
*/
*/
while ( buf [ 0 ] ! = ' \0 ' )
{
while ( buf [ 0 ] ! = ' \0 ' ) {
/*
/*
* read row , col and value .
* read row , col and value .
*/
*/