SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 
14 #include <shogun/lib/config.h>
15 
17 #include <shogun/lib/SGMatrix.h>
18 
19 namespace shogun
20 {
21 
23 template<class T> class SGMatrixList : public SGReferencedData
24 {
25  public:
27  SGMatrixList();
28 
30  SGMatrixList(SGMatrix<T>* ml, int32_t nmats, bool ref_counting = true);
31 
33  SGMatrixList(int32_t nmats, bool ref_counting = true);
34 
36  SGMatrixList(SGMatrixList const & orig);
37 
39  virtual ~SGMatrixList();
40 
48  SGMatrix<T> get_matrix(index_t index) const;
49 
57  SGMatrix<T> operator[](index_t index) const;
58 
65  void set_matrix(index_t index, const SGMatrix<T> matrix);
66 
77  static SGMatrixList<T> split(SGMatrix<T> matrix, int32_t num_components);
78 
79  protected:
81  virtual void copy_data(const SGReferencedData &orig);
82 
84  virtual void init_data();
85 
87  virtual void free_data();
88 
89  public:
92 
94  int32_t num_matrices;
95 
96 }; /* class SGMatrixList */
97 
98 } /* namespace shogun */
99 
100 #endif /* define __SGMATRIX_LIST_H__ */
int32_t index_t
Definition: common.h:62
static SGMatrixList< T > split(SGMatrix< T > matrix, int32_t num_components)
shogun matrix list
Definition: SGMatrixList.h:23
SGMatrix< T > * matrix_list
Definition: SGMatrixList.h:91
shogun matrix
void set_matrix(index_t index, const SGMatrix< T > matrix)
shogun reference count managed data
virtual void init_data()
SGMatrix< T > operator[](index_t index) const
SGMatrix< T > get_matrix(index_t index) const
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual void free_data()
virtual void copy_data(const SGReferencedData &orig)

SHOGUN Machine Learning Toolbox - Documentation