-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmainpage.dox
58 lines (46 loc) · 1.28 KB
/
mainpage.dox
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
/**
\author Rikard Nordgren
*/
/**
\mainpage main
\section Examples
\subsection example_1 Read existing SO
\code
#include "so.h"
main()
{
so *my_so = so_read("file.SO.xml");
// If error print error message and exit
if (!my_so) {
printf("%s", so_get_last_error());
exit(-1);
}
// Do stuff with my_so
so_free(my_so);
}
\endcode
\subsection example_2 Create a new SO
\code
#include <stdio.h>
#include <so.h>
int main()
{
so_SO *so = so_SO_new();
so_SOBlock *block = so_SO_create_SOBlock(so);
so_SOBlock_set_blkId(block, "SOBlockExample");
so_Estimation *est = so_SOBlock_create_Estimation(block);
so_PopulationEstimates *pe = so_Estimation_create_PopulationEstimates(est);
so_Table *mle = so_PopulationEstimates_create_MLE(pe);
so_Table_set_number_of_rows(mle, 1);
double cl_value = 3.54;
double v_value = 0.0023;
double k_value = 289.2;
so_Table_new_column(mle, "CL", PHARMML_COLTYPE_UNDEFINED, PHARMML_VALUETYPE_REAL, &cl_value);
so_Table_new_column(mle, "V", PHARMML_COLTYPE_UNDEFINED, PHARMML_VALUETYPE_REAL, &v_value);
so_Table_new_column(mle, "K", PHARMML_COLTYPE_UNDEFINED, PHARMML_VALUETYPE_REAL, &k_value);
so_SO_write(so, "example.SO.xml", 1);
so_SO_free(so);
return 0;
}
\endcode
*/