SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SGMatrixList.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012 Fernando José Iglesias García
8  * Copyright (C) 2012 Fernando José Iglesias García
9  */
10 
11 #ifndef __SGMATRIX_LIST_H__
12 #define __SGMATRIX_LIST_H__
13 
15 #include <shogun/lib/SGMatrix.h>
16 
17 namespace shogun
18 {
19  template<class T> class SGMatrix;
20 
22 template<class T> class SGMatrixList : public SGReferencedData
23 {
24  public:
26  SGMatrixList();
27 
29  SGMatrixList(SGMatrix<T>* ml, int32_t nmats, bool ref_counting = true);
30 
32  SGMatrixList(int32_t nmats, bool ref_counting = true);
33 
35  SGMatrixList(SGMatrixList const & orig);
36 
38  virtual ~SGMatrixList();
39 
47  SGMatrix<T> get_matrix(index_t index) const;
48 
56  SGMatrix<T> operator[](index_t index) const;
57 
64  void set_matrix(index_t index, const SGMatrix<T> matrix);
65 
76  static SGMatrixList<T> split(SGMatrix<T> matrix, int32_t num_components);
77 
78  protected:
80  virtual void copy_data(const SGReferencedData &orig);
81 
83  virtual void init_data();
84 
86  virtual void free_data();
87 
88  public:
91 
93  int32_t num_matrices;
94 
95 }; /* class SGMatrixList */
96 
97 } /* namespace shogun */
98 
99 #endif /* define __SGMATRIX_LIST_H__ */

SHOGUN Machine Learning Toolbox - Documentation