13 #ifndef __SGMATRIX_H__
14 #define __SGMATRIX_H__
22 template <
class,
int,
int,
int,
int,
int>
class Matrix;
24 template <
class,
int,
class>
class Map;
29 template<
class T>
class SGVector;
33 template<
class T>
class SGMatrix :
public SGReferencedData
60 #ifndef SWIG // SWIG should skip this part
61 #if defined(HAVE_CXX0X) || defined(HAVE_CXX11)
64 template <
typename ST>
using container_type =
SGMatrix<ST>;
66 #endif // define (HAVE_CXX0X) || defined(HAVE_CXX11)
108 #ifndef SWIG // SWIG should skip this part
115 const int64_t c = col;
138 const int64_t c = i_col;
156 const int64_t c = i_col;
230 T*&
matrix, int32_t& num_feat, int32_t& num_vec);
274 int n,
int il,
int iu);
286 bool transpose_A=
false,
bool transpose_B=
false,
303 float64_t* mat, int32_t cols, int32_t rows);
325 const T*
matrix, int32_t rows, int32_t cols,
326 const char* name=
"matrix",
const char* prefix=
"");
331 const char* prefix=
"");
358 #endif // #ifndef SWIG // SWIG should skip this part
379 #endif // __SGMATRIX_H__
void display_matrix(const char *name="matrix") const
Eigen::Map< EigenMatrixXt, 0, Eigen::Stride< 0, 0 > > EigenMatrixXtMap
static void center_matrix(T *matrix, int32_t m, int32_t n)
T & operator()(index_t i_row, index_t i_col)
static T * get_column_sum(T *matrix, int32_t m, int32_t n)
static void create_diagonal_matrix(T *matrix, T *v, int32_t size)
Eigen::Matrix< T,-1,-1, 0,-1,-1 > EigenMatrixXt
const T & operator[](index_t index) const
bool operator==(SGMatrix< T > &other)
static SGMatrix< T > get_allocated_matrix(index_t num_rows, index_t num_cols, SGMatrix< T > pre_allocated=SGMatrix< T >())
static void transpose_matrix(T *&matrix, int32_t &num_feat, int32_t &num_vec)
static float64_t * pinv(float64_t *matrix, int32_t rows, int32_t cols, float64_t *target=NULL)
static T * clone_matrix(const T *matrix, int32_t nrows, int32_t ncols)
static SGMatrix< float64_t > matrix_multiply(SGMatrix< float64_t > A, SGMatrix< float64_t > B, bool transpose_A=false, bool transpose_B=false, float64_t scale=1.0)
SGVector< T > get_diagonal_vector() const
SGMatrix(T *m, index_t nrows, index_t ncols, index_t offset)
void remove_column_mean()
shogun reference count managed data
void compute_few_eigenvectors(double *matrix_, double *&eigenvalues, double *&eigenvectors, int n, int il, int iu)
A File access base class.
T & operator[](index_t index)
T * get_column_vector(index_t col) const
static float64_t trace(float64_t *mat, int32_t cols, int32_t rows)
virtual void copy_data(const SGReferencedData &orig)
all of classes and functions are contained in the shogun namespace
void scale(Matrix A, Matrix B, typename Matrix::Scalar alpha)
static T * get_row_sum(T *matrix, int32_t m, int32_t n)
static void inverse(SGMatrix< float64_t > matrix)
inverses square matrix in-place
bool equals(SGMatrix< T > &other)
SGVector< T > get_row_vector(index_t row) const
void set_const(T const_elem)
static SGMatrix< T > create_identity_matrix(index_t size, T scale)
static SGVector< float64_t > compute_eigenvectors(SGMatrix< float64_t > matrix)
const T & operator()(index_t i_row, index_t i_col) const