172 UTIL_CHECK(accumulators_.capacity() == nValue_);
175 for (
int i = 0; i < nValue(); ++i) {
176 double data = value(i);
177 accumulators_[i].sample(data);
181 if (nSamplePerOutput_ > 0) {
182 if (accumulators_[0].isBlockComplete()) {
184 int beginStep = iStep - (nSamplePerOutput_ - 1)*interval();
185 outputFile_ <<
Int(beginStep);
186 for (
int i = 0; i < nValue(); ++i) {
187 UTIL_CHECK(accumulators_[i].isBlockComplete());
188 double block = accumulators_[i].blockAverage();
189 outputFile_ <<
Dbl(block);
206 if (outputFile_.is_open()) {
213 for (
int i = 0; i < nValue_; ++i) {
214 length = names_[i].length();
215 if (length > nameWidth) {
222 std::string fileName = outputFileName(
".ave");
223 system().fileMaster().openOutputFile(fileName, outputFile_);
225 for (
int i = 0; i < nValue_; ++i) {
226 ave = accumulators_[i].average();
227 err = accumulators_[i].blockingError();
228 outputFile_ <<
" " << std::left << std::setw(nameWidth)
230 outputFile_ <<
Dbl(ave) <<
" +- " <<
Dbl(err, 9, 2) <<
"\n";
235 fileName = outputFileName(
".aer");
236 system().fileMaster().openOutputFile(fileName, outputFile_);
239 "---------------------------------------------------------------------";
240 for (
int i = 0; i < nValue_; ++i) {
241 outputFile_ << line << std::endl;
242 outputFile_ << names_[i] <<
" :" << std::endl;
243 accumulators_[i].output(outputFile_);
244 outputFile_ << std::endl;
250 fileName = outputFileName();
252 system().fileMaster().openOutputFile(fileName, outputFile_);
253 outputFile_ <<
"Value = " << nValue() << std::endl;
254 outputFile_ <<
"iStep ";
255 for (
int i = 0; i < nValue_; ++i) {
256 outputFile_ << names_[i] <<
" ";
258 outputFile_ << std::endl;