forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14758 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
cea9e516a8
commit
edb3f9559c
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue