• Page principale
  • Pages associées
  • Modules
  • Classes
  • Fichiers

/tmp/galet/src/type_base.h

Aller à la documentation de ce fichier.
00001 // vim:syntax=cpp.doxygen tw=3 sw=3
00002 /***************************************************************************
00003  *   Copyright (C) 2008 by Brice Boyer                                     *
00004  *   brice.boyer@ens-lyon.org                                              *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  *   This program is distributed in the hope that it will be useful,       *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU General Public License for more details.                          *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this program; if not, write to the                         *
00018  *   Free Software Foundation, Inc.,                                       *
00019  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00020  ***************************************************************************/
00021 
00029 #ifndef __type_base_h
00030 #define __type_base_h 1
00031 
00032 #include <string>                                     // chaînes de caractères
00033 #include <list>                                       // listes
00034 #include <set>
00035 #include <fstream>                                    // manipulation de ficher
00036 #include <sstream>                                    // iostringstream
00037 #include <iomanip>
00038 #include <iostream>
00039 #include <algorithm>                                  // copy,...
00040 #include <utility>                                    // pair
00041 #include <vector>
00042 
00043 
00044 
00047 #ifndef NIVEAU_DEBUG
00048 #define NIVEAU_DEBUG 0                                
00049 #endif
00050 
00051 #define _DEBUG3 (NIVEAU_DEBUG>2)                      
00052 #define _DEBUG2 (NIVEAU_DEBUG>1)                      
00053 #define _DEBUG1 (NIVEAU_DEBUG>0)                      
00054 #define _DEBUG0 (NIVEAU_DEBUG==0)                     
00055 
00056 #if (!_DEBUG0)                                         /* débogage */
00057 
00058    #undef DEBUG
00059    #define DEBUG 1                                    
00060 
00061    #undef NDEBUG
00062    //#define NDEBUG 0                                   //! on débogue
00063 
00064 #else                                                 /* pas de debogage */
00065 
00066    #undef NDEBUG
00067    #define NDEBUG 1                                   
00068 
00069    #undef DEBUG
00070    //#define DEBUG 0                                    //! on ne débogue pas
00071 
00072 #endif
00073 
00074 #include <cassert>
00075 
00076 //#ifndef DEBUG
00077 //#define DEBUG (1)                                     //!< option de débogage (ou -DDEBUG=1 au compilo)
00078 //#endif                                                // sinon, c'est la merde...
00079 
00080 /*** couleur de débogage. ***/
00081 //#if DEBUG
00082 #define _debog       "\033[1;35m>>>\033[0m "                  
00083 #define _ligne       "\033[1;32m+++\033[0m "                  
00084 #define _resul       "\033[1;36m<<<\033[0m "                  
00085 #define _rien        "-"                                      
00086 //#endif
00087 
00088 /*** fin débogage ***/
00089 
00092 #define _ok          "\033[1;34m===\033[0;m "                  
00093 #define _erreur      "\033[1;31m!!!\033[0;m "                  
00094 #define _attention   "\033[1;33mxxx\033[0;m "                  
00095 
00098 //namespace ublas = boost::numeric::ublas;
00099 
00102 typedef unsigned                                         entier_type;               
00103 typedef int                                              relatif_type;              
00104 
00105 typedef std::string                                      etiquette ;                
00106 typedef std::ostringstream                               journal ;                  
00107 
00108 typedef std::set< relatif_type >                         relatif_set;               
00109 typedef std::set< entier_type >                          entier_set;                
00110 
00111 typedef std::list< relatif_type >                        relatif_list;              
00112 typedef std::list< entier_type >                         entier_list;               
00113 
00114 //typedef ublas::vector<relatif_type >                     relatif_vect;              //!< vecteur d'entiers
00115 //typedef ublas::vector<entier_type >                      entier_vect;               //!< vecteur de relatifs
00116 //typedef ublas::matrix<relatif_type, ublas::row_major>    relatif_matrix;               //!< matrice de relatifs
00117 //typedef ublas::vector<relatif_list >                     vect_relatif_list;         //!< vecteur de listes de relatifs
00118 typedef std::vector<relatif_type >                     relatif_vect;              
00119 typedef std::vector<entier_type >                      entier_vect;               
00120 typedef std::vector<relatif_list >                     vect_relatif_list;         
00121 typedef std::vector<relatif_vect >                     relatif_matrix ;           
00122 //typedef ublas::vector<etiquette >                        noms_type;                 //!< vecteur des noms
00123 //typedef ublas::vector<bool >                             evolution_vect;            //!< vrai si evolution possible.
00124 typedef std::vector<etiquette >                        noms_type;                 
00125 typedef std::list<etiquette >                            noms_list;                 
00126 typedef std::vector<bool >                             evolution_vect;            
00127 
00128 typedef std::pair<bool, bool >                            res_regle ;               
00129 
00130 typedef std::pair<entier_type, entier_type >             entier_pair ;              
00131 
00134 
00135       // NOEUD //
00137 
00140 #define MAX_NOEUDS   1024                    
00141 /*** position du n