| qub_simulate.h.html | mathcode2html |
| Source file: qub_simulate.h | |
| Converted: Sun Aug 7 2016 at 13:45:52 | |
| This documentation file will not reflect any later changes in the source file. |
$$\phantom{******** If you see this on the webpage then the
browser could not locate *********}$$
$$\phantom{******** jsMath/easy/load.js or the variable root
is set wrong in this file *********}$$
$$\newcommand{\vector}[1]{\left[\begin{array}{c} #1 \end{array}\right]}$$
$$\newenvironment{matrix}{\left[\begin{array}{cccccccccc}} {\end{array}\right]}$$
$$\newcommand{\A}{{\cal A}}$$
$$\newcommand{\W}{{\cal W}}$$
/* Copyright 2008-2011 Research Foundation State University of New York */
/* This file is part of QUB Express. */
/* QUB Express is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* QUB Express is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* You should have received a copy of the GNU General Public License, */
/* named LICENSE.txt, in the QUB Express program directory. If not, see */
/* <http://www.gnu.org/licenses/>. */
#ifndef QUB_SIMULATE_H
#define QUB_SIMULATE_H
#include "qubfast.h"
#ifdef __cplusplus
extern "C" {
#endif
QUBFAST_API int qub_simulate2(double sampling, int nchannel, int nstate, int *start_states, double *P0,
double *K0, double *K1, int *L, int *V,
double base_amp, double base_std, double *exc_amp, double *exc_std,
int *clazz, double *vRev,
int nsample, int nstimulus, int *stim_counts, float **stimuli,
int v_signal,
float *samples, int *states, int *counts,
int seed, StatusCallback pctCB, void *pctObj);
QUBFAST_API int qub_simulate(double sampling, int nchannel, int nstate, int *start_states, double *P0,
double *K0, double *K1, int *L, int *V,
double base_amp, double base_std, double *exc_amp, double *exc_std,
int nsample, int nstimulus, int *stim_counts, float **stimuli,
float *samples, int *states, int *counts,
StatusCallback pctCB, void *pctObj);
/*
Simulates sampled and state-idealized HMM data and returns the number of dwells written into states and counts.
@param sampling: interval between samples, in seconds
@param nchannel: number of identical mechanisms' responses to sum together
@param nstate: number of model states (vertices)
@param start_states: array[nstate] of entry state indices, or -1 to pick fresh. On output, contains exit states.
@param P0: array[Nstate] of entry probabilities, or NULL
@param K0: row-major matrix, nstate x nstate; element (i,j) is the pre-exponential rate constant between states i and j
@param K1: row-major matrix, nstate x nstate; element (i,j) is the exponential rate constant between states i and j
@param L: row-major matrix, nstate x nstate; element (i,j) is the pre-exponential stimulus index, or 0
@param V: row-major matrix, nstate x nstate; element (i,j) is the exponential stimulus index, or 0
@param base_amp: constant baseline offset, amplitude of closed (class 0, black)
@param base_std: baseline std; instrument rather than channel noise
@param exc_amp: array[Nstate] of (state amp) - base_amp
@param exc_std: array[Nstate] of sqrt((state std)**2 - base_std**2)
@param clazz: class index of each state
@param vRev: reversal potential, in mV, of each state; or NULL if (! v_signal)
@param nsample: number of data points to return in samples
@param nstimulus: number of stimulus signals, plus signal 0 which is ignored (so at least 1)
@param stim_counts: number of datapoints in each signal; -1 if it's constant
@param stimuli: array[max(1,stim_counts[i])] of datapoints for each signal
@param v_signal: index of Voltage signal, if exc_amp is to be scaled by 1e-3*(Voltage-vRev)
@param samples: output array[nsample] for data points
@param states: output array[nsample] for idealized state index of each dwell
@param counts: output array[nsample] for number of samples in each dwell
@param seed: random seed; should be different each invocation
@param pctCB: callback pctCB(pctObj, complete), 0.0 <= complete <= 1.0; Return nonzero to stop the simulation.
@param pctObj: data pointer for the callback function, or NULL
*/
#ifdef __cplusplus
}
#endif
#endif