Feb 1, 2016
Updated the naming convention and switched to the Random_stream header
|
|
|
2 |
* Copyright (c) 2015 University of Lübeck |
|
3 |
* |
|
4 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
5 |
* of this software and associated documentation files (the "Software"), to deal |
|
6 |
* in the Software without restriction, including without limitation the rights |
|
7 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
8 |
* copies of the Software, and to permit persons to whom the Software is |
|
9 |
* furnished to do so, subject to the following conditions: |
|
10 |
* |
|
11 |
* The above copyright notice and this permission notice shall be included in |
|
12 |
* all copies or substantial portions of the Software. |
|
13 |
* |
|
14 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
15 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
16 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
17 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
18 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
19 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
20 |
* THE SOFTWARE. |
|
21 |
* |
|
22 |
* AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com |
|
23 |
* |
|
24 |
* Based on: A thalamocortical neural mass model of the EEG during NREM sleep and its response |
|
25 |
* to auditory stimulation. |
|
26 |
* M Schellenberger Costa, A Weigenand, H-VV Ngo, L Marshall, J Born, T Martinetz, |
|
27 |
* JC Claussen. |
Sep 13, 2016
Major cleanup and code modernization
|
|
|
47 |
/******************************************************************************/ |
|
48 |
/* Fixed simulation settings */ |
|
49 |
/******************************************************************************/ |
|
50 |
extern const int onset = 20; /* Time until data is stored in s */ |
|
51 |
extern const int res = 1E4; /* Number of iteration steps per s */ |
|
52 |
extern const int red = 1E2; /* Number of iterations steps not saved */ |
|
53 |
extern const double dt = 1E3/res; /* Duration of a time step in ms */ |
|
54 |
extern const double h = sqrt(dt); /* Square root of dt for SRK iteration */ |
Sep 13, 2016
Major cleanup and code modernization
|
|
|
105 |
/******************************************************************************/ |
|
106 |
/* Create MATLAB data containers */ |
|
107 |
/******************************************************************************/ |
|
108 |
mxArray* GetMexArray(int N, int M) { |
|
109 |
mxArray* Array = mxCreateDoubleMatrix(0, 0, mxREAL); |
|
110 |
mxSetM(Array, N); |
|
111 |
mxSetN(Array, M); |
|
112 |
mxSetData(Array, mxMalloc(sizeof(double)*M*N)); |
|
113 |
return Array; |