File: params.h

package info (click to toggle)
simrisc 16.05.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,877; fortran: 665; makefile: 112; ansic: 112; sh: 107
file content (55 lines) | stat: -rw-r--r-- 1,929 bytes parent folder | download | duplicates (2)
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
#ifndef INCLUDED_PARAMS_
#define INCLUDED_PARAMS_

// Params is the base class for VSDParams and for TableParams.
//
// VSDParams handles the computation of the tumor risk values based on 
//      lifetimeRisk, meanAge, and stdDev
//
// TableParams handles the computation of the tumor risk values based on the
//      riskTable values
//
// The base class defines member 
//      virtual void cptTumorRisk(DoubleVect &ageValues)
// which calls the overriding member from the derived class.
//
// The vector d_params contains unique_ptr<Params>, so for each defined
// Incidence type the appropriate ageValues is computed

#include "../typedefs/typedefs.h"

class Params
{
    unsigned d_idx;                 // see setIncidence (.2): this is the
                                    // index used in the d_params vector

                                    // set to -1 if prob. setting fails in 
    double   d_prob = 1;            // the constructor

    static StringVect const s_label;    // labels of the BC incidence modes

    public:
        Params(StringVect &base, size_t idx, bool setProb);
        virtual ~Params();

        void cptTumorRisk(DoubleVect &ageValues);
        double   prob() const;                                      // .f
        void vary(std::ostream &out);                               // .f
        void writeParameters(std::ostream &out);

        static std::string const &label(size_t idx);                // .f
        static size_t nLabels();                                    // .f

    protected:
        void invalid();     // sets d_prob = -1                     // .f
        std::string const &label() const;                           // .f

    private:
        void virtual v_cptTumorRisk(DoubleVect &ageValues) = 0;
        void virtual v_vary(std::ostream &out) = 0;
        void virtual v_writeParameters(std::ostream &out) const = 0;
};

#include "params.f"
        
#endif