File: writedata.cc

package info (click to toggle)
simrisc 16.06.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,889; fortran: 669; makefile: 112; ansic: 112; sh: 107
file content (38 lines) | stat: -rw-r--r-- 1,548 bytes parent folder | download
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
#define XERR
#include "loop.ih"

    // by gencases.cc

void Loop::writeData(CSVTable &tab, size_t idx) const
{
    static Status detection[] = { SELF_PRE, SELF_DURING, SELF_POST };

                            // case numbers in data*.txt are now natural nrs.
    tab.more() << (idx + 1) <<                                  // 1
           (d_deathAge == d_naturalDeathAge ? "Natural" 
                                            : "Tumor") <<       // 2
           d_deathAge << d_naturalDeathAge << d_status;         // 3 - 5

    d_tumor.writeData(tab);                                     // 6 - 14

    ostringstream out;
    if (Globals::isZero(d_tumor.diameter()))
        (*d_tnm)(out);
    else
    {                                                   // set the tumor S3
        RowCol rowCol = d_tumor.rowCol();               // row/col. For BC
        out << rowCol.first << ',' << rowCol.second;    // row is bc: TNM, col
    }                                                   // = 0 (via Survival::
                                                        // setVSD
    tab << 
            static_cast<size_t>(round(d_caseCost)) <<               // 15
            static_cast<size_t>(round(d_biopCosts)) <<              // 15-pre
           (find(detection, detection + size(detection), d_status) != 
                          detection + size(detection)) <<           // 16

           to_string(d_modValue) << showRound() << d_roundInfo <<   // 17 - 19
           out.str();                                               // 20
}