28#ifndef _util_misc_compute_h
29#define _util_misc_compute_h
33#include <util/state/state.h>
34#include <util/state/stateio.h>
42typedef ResultInfo* ResultInfoP;
56 std::set<ResultInfoP> _results;
71 virtual bool throw_if_tolerance_exceeded()
const;
90 virtual void update();
94 virtual void save_data_state(
StateOut&);
95 virtual void restore_state(
StateIn&);
100 int& compute() {
return _compute; }
101 const int& compute()
const {
return _compute; }
102 int compute(
int c) {
int r = _compute; _compute = c;
return r; }
103 int& computed() {
return _computed; }
104 const int& computed()
const {
return _computed; }
105 virtual int needed()
const;
113 double _actual_accuracy;
114 double _desired_accuracy;
118 virtual void save_data_state(
StateOut&);
119 virtual void restore_state(
StateIn&);
125 double actual_accuracy()
const;
126 double desired_accuracy()
const;
127 void set_desired_accuracy(
double);
128 void set_actual_accuracy(
double);
129 int computed_to_desired_accuracy()
const
130 {
return computed() && _actual_accuracy <= _desired_accuracy; }
136#include <util/misc/comptmpl.h>
140typedef NCResult<int> Resultint;
141typedef NCResult<double> Resultdouble;
142typedef NCAccResult<double> AccResultdouble;
This is like ResultInfo but the accuracy with which a result was computed as well as the desired accu...
Definition compute.h:111
The Compute class provides a means of keeping results up to date.
Definition compute.h:52
virtual void obsolete()
Marks all results as being out of date.
virtual void compute()=0
Recompute at least the results that have compute true and are not already computed.
This is a base class for all of Compute's result types.
Definition compute.h:83
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
Contains all MPQC code up to version 3.
Definition mpqcin.h:14