17 Mille::Mille(
const char *outFileName,
bool asBinary,
bool writeZero) :
18 fileMode_(asBinary ? (
std::ios::binary |
std::ios::
out) :
std::ios::
out),
19 fileName_(outFileName),
20 outFile_(fileName_, fileMode_),
21 asBinary_(asBinary), writeZero_(writeZero), bufferPos_(-1), hasSpecial_(
false)
32 <<
"Mille::Mille: Could not open " <<
fileName_ <<
" as output file.";
47 int NGL,
const float *derGl,
const int *
label,
48 float rMeas,
float sigma)
50 if (sigma <= 0.)
return;
60 for (
int i = 0;
i < NLC; ++
i) {
74 for (
int i = 0;
i < NGL; ++
i) {
82 <<
"Mille::mille: Invalid label " << label[
i]
90 void Mille::special(
int nSpecial,
const float *floatings,
const int *integers)
92 if (nSpecial == 0)
return;
96 <<
"Mille::special: Special values already stored for this record.";
116 for (
int i = 0;
i < nSpecial; ++
i) {
148 <<
"Mille::resetOutputFile: Could not reopen " <<
fileName_ <<
".";
158 const int numWordsToWrite = (
bufferPos_ + 1)*2;
161 outFile_.write(reinterpret_cast<const char*>(&numWordsToWrite),
162 sizeof(numWordsToWrite));
168 outFile_ << numWordsToWrite <<
"\n";
174 for (
int i = 0;
i < bufferPos_+1; ++
i) {
203 <<
"Mille::checkBufferSize: Buffer too short (" 205 <<
"\n need space for nLocal (" << nLocal<<
")" 206 <<
"/nGlobal (" << nGlobal <<
") local/global derivatives, "
int bufferInt_[bufferSize_]
Mille(const char *outFileName, bool asBinary=true, bool writeZero=false)
float bufferFloat_[bufferSize_]
void mille(int NLC, const float *derLc, int NGL, const float *derGl, const int *label, float rMeas, float sigma)
bool checkBufferSize(int nLocal, int nGlobal)
const std::ios_base::openmode fileMode_
void special(int nSpecial, const float *floatings, const int *integers)
const std::string fileName_