git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14758 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2016-03-21 16:10:48 +00:00
parent cea9e516a8
commit edb3f9559c
3 changed files with 8 additions and 1 deletions

View File

@ -235,6 +235,7 @@ std::string LammpsInterface::read_file(std::string filename) const
eof = lammps_->comm->read_lines_from_file(fp,1,MAXLINE,buffer);
s << buffer;
}
fclose(fp);
delete [] buffer;
return s.str(); // can't copy the stream itself
}

View File

@ -88,6 +88,10 @@ namespace ATC_matrix {
// Collect results on all processors
allgatherv(_comm, C.ptr() + myMajorOffset * nMinor, myNMajor * nMinor,
C.ptr(), majorCounts, majorOffsets);
delete[] majorCounts;
delete[] majorOffsets;
}
} // end namespace

View File

@ -204,7 +204,9 @@ namespace ATC_Utility
{
double v;
std::istringstream in(s);
return (in >> v);
in >> v;
// in.good() == true indicates, that not the whole string was converted.
return !(in.fail() || in.good());
}
/** convert a string to anything that has iostream::>> defined, second arg is to disambibuate type */