/* Copyright 2003-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 */ /* . */ #ifndef QUB_FINDLOOPS_H #define QUB_FINDLOOPS_H #include "qubfast.h" #ifdef __cplusplus extern "C" { #endif QUBFAST_API int qub_findloops(int Nvertex, int Nedge, int *edges, int *out_loopsizes, int *out_loopstates); /* Finds the fundamental cycles in an undirected graph. Returns the number of cycles. Nvertex: a.k.a. Nstate Nedge: actually twice the number of edges, counting (a, b) and (b, a) in_edges: connected vertex pairs, alternating from0, to0, from1, to1; include both (a, b) and (b, a) out_loopsizes: on exit, the number of states in each fundamental cycle; allocate at least Nedge out_loopstates: on exit, the states in each cycle i are listed starting at out_loopstates[i*Nvertex] See David Colquhoun, Kathryn Dowsland, Marco Beato and Andrew Plested. (2004). How to impose microscopic reversibility in complex reaction mechanisms. (with appendix by Kathryn. A. Dowsland and Frank G. Ball) Biophysical Journal, 86, 3510–3518. begin_html Available here. end_html */ #ifdef __cplusplus } #endif #endif