MKLMultiClassGLPK.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) 2009 Alexander Binder
00008  * Copyright (C) 2009 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef MKLMULTICLASSGLPK_H_
00012 #define MKLMULTICLASSGLPK_H_
00013 
00014 #include <vector>
00015 #include <shogun/base/SGObject.h>
00016 #include <shogun/classifier/mkl/MKLMultiClassOptimizationBase.h>
00017 
00018 #ifdef USE_GLPK
00019 #include <glpk.h>
00020 #endif
00021 
00022 namespace shogun
00023 {
00029 class MKLMultiClassGLPK: public MKLMultiClassOptimizationBase
00030 {
00031 public:
00035     MKLMultiClassGLPK();
00039     virtual ~MKLMultiClassGLPK();
00040 
00047     virtual void setup(const int32_t numkernels2);
00048 
00057     virtual void addconstraint(const ::std::vector<float64_t> & normw2,
00058             const float64_t sumofpositivealphas);
00059 
00065     virtual void computeweights(std::vector<float64_t> & weights2);
00066 
00068     inline virtual const char* get_name() const
00069     {
00070         return "MKLMultiClassGLPK";
00071     }
00072 
00073 protected:
00078     MKLMultiClassGLPK(MKLMultiClassGLPK & gl);
00083     MKLMultiClassGLPK operator=(MKLMultiClassGLPK & gl);
00084 
00085 protected:
00087     int32_t numkernels;
00088 #ifdef USE_GLPK
00089 
00090     glp_prob* linearproblem;
00091 #endif
00092 };
00093 }
00094 
00095 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation