SHOGUN
v2.0.0
|
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 Fernando José Iglesias García 00008 * Copyright (C) 2012 Fernando José Iglesias García 00009 */ 00010 00011 #include <shogun/machine/KernelStructuredOutputMachine.h> 00012 00013 using namespace shogun; 00014 00015 CKernelStructuredOutputMachine::CKernelStructuredOutputMachine() 00016 : CStructuredOutputMachine(), m_kernel(NULL) 00017 { 00018 register_parameters(); 00019 } 00020 00021 CKernelStructuredOutputMachine::CKernelStructuredOutputMachine( 00022 CStructuredModel* model, 00023 CLossFunction* loss, 00024 CStructuredLabels* labs, 00025 CKernel* kernel) 00026 : CStructuredOutputMachine(model, loss, labs), m_kernel(NULL) 00027 { 00028 set_kernel(kernel); 00029 register_parameters(); 00030 } 00031 00032 CKernelStructuredOutputMachine::~CKernelStructuredOutputMachine() 00033 { 00034 SG_UNREF(m_kernel) 00035 } 00036 00037 void CKernelStructuredOutputMachine::set_kernel(CKernel* k) 00038 { 00039 SG_REF(k); 00040 SG_UNREF(m_kernel); 00041 m_kernel = k; 00042 } 00043 00044 CKernel* CKernelStructuredOutputMachine::get_kernel() const 00045 { 00046 SG_REF(m_kernel); 00047 return m_kernel; 00048 } 00049 00050 void CKernelStructuredOutputMachine::register_parameters() 00051 { 00052 SG_ADD((CSGObject**)&m_kernel, "m_kernel", "The kernel", MS_AVAILABLE); 00053 }