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) 2013 Soumyajit De 00008 */ 00009 00010 #ifndef VECTOR_RESULT_H_ 00011 #define VECTOR_RESULT_H_ 00012 00013 #include <shogun/lib/config.h> 00014 #include <shogun/lib/SGVector.h> 00015 #include <shogun/lib/computation/jobresult/JobResult.h> 00016 #include <shogun/base/Parameter.h> 00017 00018 namespace shogun 00019 { 00023 template<class T> class CVectorResult : public CJobResult 00024 { 00026 typedef bool supports_complex128_t; 00027 00028 public: 00030 CVectorResult() 00031 : CJobResult() 00032 { 00033 init(); 00034 } 00035 00039 CVectorResult(SGVector<T> vector_result) 00040 : CJobResult() 00041 { 00042 init(); 00043 00044 m_result = vector_result; 00045 } 00046 00048 virtual ~CVectorResult() 00049 { 00050 } 00051 00053 virtual const char* get_name() const 00054 { 00055 return "VectorResult"; 00056 } 00057 00059 SGVector<T> get_result() const 00060 { 00061 return m_result; 00062 } 00063 00064 protected: 00066 SGVector<T> m_result; 00067 00068 private: 00070 void init() 00071 { 00072 set_generic<T>(); 00073 00074 SG_ADD(&m_result, "vector_result", 00075 "The result vector", MS_NOT_AVAILABLE); 00076 } 00077 }; 00078 } 00079 00080 #endif // VECTOR_RESULT_H_