Skip to content

Commit

Permalink
Move error codes to 'siminf.h' and remove 'siminf_error.h'
Browse files Browse the repository at this point in the history
  • Loading branch information
stewid committed Apr 21, 2016
1 parent 4926d0c commit 145fae1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/misc/siminf_arg.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <Rdefines.h>
#include <time.h>

#include "siminf_error.h"
#include "siminf.h"

/**
* Check dgCMatrix argument
Expand Down
41 changes: 0 additions & 41 deletions src/misc/siminf_error.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/misc/siminf_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>

#include "siminf.h"
#include "siminf_arg.h"
#include "siminf_error.h"
#include "siminf_events.h"
#include "siminf_vec.h"

Expand Down
9 changes: 5 additions & 4 deletions src/misc/siminf_vec.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* siminf, a framework for stochastic disease spread simulations
* SimInf, a framework for stochastic disease spread simulations
* Copyright (C) 2015 Pavol Bauer
* Copyright (C) 2015 Stefan Engblom
* Copyright (C) 2015 Stefan Widgren
* Copyright (C) 2015 - 2016 Stefan Engblom
* Copyright (C) 2015 - 2016 Stefan Widgren
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -19,8 +19,9 @@
*/

#include <stdlib.h>

#include "siminf.h"
#include "siminf_vec.h"
#include "siminf_error.h"

/**
* Free memory for integer vector
Expand Down
6 changes: 3 additions & 3 deletions src/misc/siminf_vec.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* siminf, a framework for stochastic disease spread simulations
* SimInf, a framework for stochastic disease spread simulations
* Copyright (C) 2015 Pavol Bauer
* Copyright (C) 2015 Stefan Engblom
* Copyright (C) 2015 Stefan Widgren
* Copyright (C) 2015 - 2016 Stefan Engblom
* Copyright (C) 2015 - 2016 Stefan Widgren
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
14 changes: 13 additions & 1 deletion src/siminf.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@
#include <R.h>
#include <Rinternals.h>

#include "siminf_error.h"
/* Error constants */
typedef enum {
SIMINF_ERR_NEGATIVE_STATE = -1,
SIMINF_ERR_ALLOC_MEMORY_BUFFER = -2,
SIMINF_ERR_SPLIT_EVENTS = -3,
SIMINF_UNDEFINED_EVENT = -4,
SIMINF_INVALID_EDGE_PROBABILITY = -5,
SIMINF_INVALID_SEED_VALUE = -6,
SIMINF_INVALID_THREADS_VALUE = -7,
SIMINF_ERR_V_IS_NOT_FINITE = -8,
SIMINF_ERR_SAMPLE_SELECT = -9,
SIMINF_ERR_INVALID_MODEL = -10
} siminf_error_code;

/* Definition of the transition rate function. */
typedef double (*TRFun)(
Expand Down

0 comments on commit 145fae1

Please sign in to comment.