SHOGUN
v3.2.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 CStructuredLabels* labs, 00024 CKernel* kernel) 00025 : CStructuredOutputMachine(model, labs), m_kernel(NULL) 00026 { 00027 set_kernel(kernel); 00028 register_parameters(); 00029 } 00030 00031 CKernelStructuredOutputMachine::~CKernelStructuredOutputMachine() 00032 { 00033 SG_UNREF(m_kernel) 00034 } 00035 00036 void CKernelStructuredOutputMachine::set_kernel(CKernel* k) 00037 { 00038 SG_REF(k); 00039 SG_UNREF(m_kernel); 00040 m_kernel = k; 00041 } 00042 00043 CKernel* CKernelStructuredOutputMachine::get_kernel() const 00044 { 00045 SG_REF(m_kernel); 00046 return m_kernel; 00047 } 00048 00049 void CKernelStructuredOutputMachine::register_parameters() 00050 { 00051 SG_ADD((CSGObject**)&m_kernel, "m_kernel", "The kernel", MS_AVAILABLE); 00052 }