RelaxedTreeNodeData.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 2012 Chiyuan Zhang
00008  * Copyright (C) 2012 Chiyuan Zhang
00009  */
00010 
00011 #ifndef RELAXEDTREENODEDATA_H__
00012 #define RELAXEDTREENODEDATA_H__
00013 
00014 #include <shogun/lib/SGVector.h>
00015 
00016 namespace shogun
00017 {
00018 
00020 struct RelaxedTreeNodeData
00021 {
00023     SGVector<int32_t> mu;
00024 
00026     static void print_data(const RelaxedTreeNodeData &data)
00027     {
00028         SG_SPRINT("left=(");
00029         for (int32_t i=0; i < data.mu.vlen; ++i)
00030             if (data.mu[i] == -1 || data.mu[i] == 0)
00031                 SG_SPRINT("%4d", i);
00032         SG_SPRINT("), right=(");
00033         for (int32_t i=0; i < data.mu.vlen; ++i)
00034             if (data.mu[i] == 1 || data.mu[i] == 0)
00035                 SG_SPRINT("%4d", i);
00036         SG_SPRINT(")\n");
00037     }
00038 };
00039 
00040 } /* shogun */ 
00041 
00042 #endif /* end of include guard: RELAXEDTREENODEDATA_H__ */
00043 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation