libeblearntools
/home/rex/ebltrunk/tools/libeblearntools/include/gdb.h
00001 /***************************************************************************
00002  *   Copyright (C) 2009 by Pierre Sermanet   *
00003  *   pierre.sermanet@gmail.com   *
00004  *   All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Redistribution under a license not approved by the Open Source 
00014  *       Initiative (http://www.opensource.org) must display the 
00015  *       following acknowledgement in all advertising material:
00016  *        This product includes software developed at the Courant
00017  *        Institute of Mathematical Sciences (http://cims.nyu.edu).
00018  *     * The names of the authors may not be used to endorse or promote products
00019  *       derived from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
00022  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00023  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00024  * DISCLAIMED. IN NO EVENT SHALL ThE AUTHORS BE LIABLE FOR ANY
00025  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00026  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00027  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00028  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00029  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00030  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  ***************************************************************************/
00032 
00033 #ifndef GDB_H_
00034 #define GDB_H_
00035 
00036 #include "idxops.h"
00037 #ifdef __GUI__
00038 #include "libidxgui.h"
00039 #endif
00040 
00041 using namespace std;
00042 
00043 namespace ebl {
00044 
00046   // instantiations of blas functions, useful for debugging under gdb
00047 
00048   double idx_max_double(idx<double> &m);
00049   double idx_min_double(idx<double> &m);
00050 
00051   float idx_max_float(idx<float> &m);
00052   float idx_min_float(idx<float> &m);
00053 
00054 #ifdef __GUI__
00055 
00056   // instantiations of draw_matrix, useful for debugging under gdb
00057 
00059   void draw_matrix_double(idx<double> &im, unsigned int h0 = 0,
00060                           unsigned int w0 = 0,
00061                           double zoomh = 1.0, double zoomw = 1.0,
00062                           double minv = 0, double maxv = 0);
00063     
00065   void draw_matrix_float(idx<float> &im, unsigned int h0 = 0,
00066                          unsigned int w0 = 0,
00067                          double zoomh = 1.0, double zoomw = 1.0,
00068                          float minv = 0, float maxv = 0);
00069   
00071   void draw_matrix_ubyte(idx<ubyte> &im, unsigned int h0 = 0,
00072                          unsigned int w0 = 0,
00073                          double zoomh = 1.0, double zoomw = 1.0,
00074                          ubyte minv = 0, ubyte maxv = 0);
00075 #endif
00076   
00078   // global idx variables, useful for debugging under gdb
00079   
00080   extern idx<double>    gdb_idx_double1;
00081   extern idx<double>    gdb_idx_double2;
00082   extern idx<float>     gdb_idx_float1;
00083   extern idx<float>     gdb_idx_float2;
00084   extern idx<ubyte>     gdb_idx_ubyte1;
00085   extern idx<ubyte>     gdb_idx_ubyte2;
00086   
00087 } // end namespace ebl
00088 
00089 #endif /* GDB_ */