SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SGMatrixList.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 Fernando José Iglesias García
00008  * Copyright (C) 2012 Fernando José Iglesias García
00009  */
00010 
00011 #ifndef __SGMATRIX_LIST_H__
00012 #define __SGMATRIX_LIST_H__
00013 
00014 #include <shogun/lib/SGReferencedData.h>
00015 #include <shogun/lib/SGMatrix.h>
00016 
00017 namespace shogun
00018 {
00019     template<class T> class SGMatrix;
00020 
00022 template<class T> class SGMatrixList : public SGReferencedData
00023 {
00024     public:
00026         SGMatrixList();
00027 
00029         SGMatrixList(SGMatrix<T>* ml, int32_t nmats, bool ref_counting = true);
00030 
00032         SGMatrixList(int32_t nmats, bool ref_counting = true);
00033 
00035         SGMatrixList(SGMatrixList const & orig);
00036 
00038         virtual ~SGMatrixList();
00039 
00047         SGMatrix<T> get_matrix(index_t index) const;
00048 
00056         SGMatrix<T> operator[](index_t index) const;
00057 
00064         void set_matrix(index_t index, const SGMatrix<T> matrix);
00065 
00076         static SGMatrixList<T> split(SGMatrix<T> matrix, int32_t num_components);
00077 
00078     protected:
00080         virtual void copy_data(const SGReferencedData &orig);
00081 
00083         virtual void init_data();
00084 
00086         virtual void free_data();
00087 
00088     public:
00090         SGMatrix<T>* matrix_list;
00091 
00093         int32_t num_matrices;
00094 
00095 }; /* class SGMatrixList */
00096 
00097 } /* namespace shogun */
00098 
00099 #endif /* define __SGMATRIX_LIST_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation