Skip to content
Snippets Groups Projects
Commit 7a3c3f35 authored by Lukas Renelt's avatar Lukas Renelt
Browse files

Change ostringstream to simple string

parent 209ec643
Branches
Tags
1 merge request!465Fix inconsistency in matrixmarket file IO
......@@ -1136,11 +1136,10 @@ namespace Dune
std::string filename,
int prec=default_precision)
{
std::ostringstream rfilename;
rfilename << filename << ".mm";
std::ofstream file(rfilename.str().c_str());
std::string rfilename = filename + ".mm";
std::ofstream file(rfilename.c_str());
if(!file)
DUNE_THROW(IOError, "Could not open file for storage: " << rfilename.str().c_str());
DUNE_THROW(IOError, "Could not open file for storage: " << rfilename.c_str());
file.setf(std::ios::scientific,std::ios::floatfield);
if(prec>0)
file.precision(prec);
......@@ -1312,12 +1311,11 @@ namespace Dune
void loadMatrixMarket(M& matrix,
const std::string& filename)
{
std::ostringstream rfilename;
rfilename << filename << ".mm";
std::string rfilename = filename + ".mm";
std::ifstream file;
file.open(rfilename.str().c_str(), std::ios::in);
file.open(rfilename.c_str(), std::ios::in);
if(!file)
DUNE_THROW(IOError, "Could not open file: " << rfilename.str().c_str());
DUNE_THROW(IOError, "Could not open file: " << rfilename.c_str());
readMatrixMarket(matrix,file);
file.close();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment