Deleted Added
sdiff udiff text old ( 8243:63e849f0f341 ) new ( 8296:be7f03723412 )
full compact
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 34 unchanged lines hidden (view full) ---

43#include <cmath>
44#include <fstream>
45#include <iostream>
46#include <sstream>
47#include <string>
48
49#include "base/stats/info.hh"
50#include "base/stats/text.hh"
51#include "base/stats/visit.hh"
52#include "base/cast.hh"
53#include "base/misc.hh"
54#include "base/str.hh"
55
56using namespace std;
57
58#ifndef NAN
59float __nan();

--- 73 unchanged lines hidden (view full) ---

133
134bool
135Text::valid() const
136{
137 return stream != NULL && stream->good();
138}
139
140void
141Text::output()
142{
143 ccprintf(*stream, "\n---------- Begin Simulation Statistics ----------\n");
144 list<Info *>::const_iterator i, end = statsList().end();
145 for (i = statsList().begin(); i != end; ++i)
146 (*i)->visit(*this);
147 ccprintf(*stream, "\n---------- End Simulation Statistics ----------\n");
148 stream->flush();
149}
150
151bool
152Text::noOutput(const Info &info)
153{
154 if (!info.flags.isSet(display))

--- 420 unchanged lines hidden (view full) ---

575}
576
577void
578Text::visit(const FormulaInfo &info)
579{
580 visit((const VectorInfo &)info);
581}
582
583bool
584initText(const string &filename, bool desc)
585{
586 static Text text;
587 static bool connected = false;
588
589 if (connected)
590 return false;
591
592 extern list<Output *> OutputList;
593
594 text.open(*simout.find(filename));
595 text.descriptions = desc;
596 OutputList.push_back(&text);
597 connected = true;
598
599 return true;
600}
601
602} // namespace Stats