16 Mille::Mille(
const char *outFileName,
bool asBinary,
bool writeZero) :
17 myOutFile(outFileName, (asBinary ? (std::ios::binary | std::ios::
out) : std::ios::
out)),
18 myAsBinary(asBinary), myWriteZero(writeZero), myBufferPos(-1), myHasSpecial(
false)
28 std::cerr <<
"Mille::Mille: Could not open " << outFileName
29 <<
" as output file." << std::endl;
44 int NGL,
const float *derGl,
const int *
label,
45 float rMeas,
float sigma)
47 if (sigma <= 0.)
return;
57 for (
int i = 0;
i < NLC; ++
i) {
71 for (
int i = 0;
i < NGL; ++
i) {
78 std::cerr <<
"Mille::mille: Invalid label " << label[
i]
86 void Mille::special(
int nSpecial,
const float *floatings,
const int *integers)
88 if (nSpecial == 0)
return;
91 std::cerr <<
"Mille::special: Special values already stored for this record."
112 for (
int i = 0;
i < nSpecial; ++
i) {
136 myOutFile.write(reinterpret_cast<const char*>(&numWordsToWrite),
137 sizeof(numWordsToWrite));
149 for (
int i = 0;
i < myBufferPos+1; ++
i) {
177 std::cerr <<
"Mille::checkBufferSize: Buffer too short ("
179 <<
"\n need space for nLocal (" << nLocal<<
")"
180 <<
"/nGlobal (" << nGlobal <<
") local/global derivatives, "
int myBufferInt[myBufferSize]
Mille(const char *outFileName, bool asBinary=true, bool writeZero=false)
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)
float myBufferFloat[myBufferSize]
void special(int nSpecial, const float *floatings, const int *integers)