]> ruin.nu Git - germs.git/blob - src/misc.h
Added more doxygen documentation
[germs.git] / src / misc.h
1 /***************************************************************************
2  *   Copyright (C) 2006 by Michael Andreen                                 *
3  *   andreen@student.chalmers.se                                           *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA          *
19  ***************************************************************************/
20
21 #ifndef __MISC_H__
22 #define __MISC_H__
23
24 /**
25  * The type we use for genes, has to be a signed integer type.
26  */
27 typedef int Gene;
28
29 /**
30  * Simple struct for components. Holds the indexes, the first and last genes
31  * + information if the component is unoriented.
32  */
33 struct Component{
34         Component(int b = 0,int e = 0,int s = 0,size_t i1 = 0, size_t i2 = 0):begin(b),end(e),sign(s),i1(i1), i2(i2){}
35         bool operator==(const Component& c){
36                 return begin == c.begin && end == c.end && sign == c.sign && i1 == c.i1 && i2 == c.i2;
37         }
38         int begin;
39         int end;
40         int sign;
41         size_t i1;
42         size_t i2;
43 };
44
45 #endif