File: ResultTable.h

package info (click to toggle)
pchar 1.5-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 644 kB
  • ctags: 402
  • sloc: cpp: 6,096; sh: 2,510; makefile: 192
file content (66 lines) | stat: -rw-r--r-- 1,976 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// -*- c++ -*-
//
// $Id: ResultTable.h 1082 2005-02-12 19:40:04Z bmah $
//
// ResultTable.h
// Bruce A. Mah <bmah@acm.org>
//
// This work was first produced by an employee of Sandia National
// Laboratories under a contract with the U.S. Department of Energy.
// Sandia National Laboratories dedicates whatever right, title or
// interest it may have in this software to the public. Although no
// license from Sandia is needed to copy and use this software,
// copying and using the software might infringe the rights of
// others. This software is provided as-is. SANDIA DISCLAIMS ANY
// WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
//
// Table of pc results.
//

#ifndef RESULTTABLE_H
#define RESULTTABLE_H

#include <stdio.h>

class ResultTable {
    
  public:
    const unsigned int increment, mtu, burst, repetitions;
    const unsigned int columns;
    ResultTable(unsigned int i, unsigned int m, unsigned int b, 
		unsigned int r);
    virtual ~ResultTable();
    
    int put(int size, double time);
    ResultTable *getMin();
    double queueing();
    void slr(double &a, double &b, double &r2, double &sa, double &sb);
    void tau(double &a, double &b, double &blower, double &bupper);
    void lms(double &a, double &b, double &r2);
    void lmsint(double &a, double &b, double &r2);
    double median(double *values, unsigned int numValues);
    unsigned int median(unsigned int *values, unsigned int numValues);

    int Print(FILE *fp, char *tag, int hop);

  protected:
    double **data;
    int *used;
	
    bool cacheSlrValid;	// Cached SLR results valid?
    double cacheSlrA, cacheSlrB, cacheSlrR2;
    double cacheSlrSA, cacheSlrSB;

    bool cacheTauValid;		// Cached tau results valid?

    bool cacheLmsValid;		// Cached tau results valid?

    bool cacheQueueingValid;	// Cached queueing results valid?
    double cacheQueueing;

    int size2column(int s) { return (s); }
    int column2size(int c) { return (c); }
};

#endif /* RESULTTABLE_H */