13 #ifndef __SGMATRIX_H__
14 #define __SGMATRIX_H__
23 template<
class T>
class SGVector;
27 template<
class T>
class SGMatrix :
public SGReferencedData
54 const int64_t c = col;
77 const int64_t c = i_col;
95 const int64_t c = i_col;
145 T*&
matrix, int32_t& num_feat, int32_t& num_vec);
202 int n,
int il,
int iu);
214 bool transpose_A=
false,
bool transpose_B=
false,
231 float64_t* mat, int32_t cols, int32_t rows);
253 const T*
matrix, int32_t rows, int32_t cols,
254 const char* name=
"matrix",
const char* prefix=
"");
259 const char* prefix=
"");
306 #endif // __SGMATRIX_H__
T & operator[](index_t index)
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_row_vector(index_t row) const
bool equals(SGMatrix< T > &other)
static T * get_row_sum(T *matrix, int32_t m, int32_t n)
void display_matrix(const char *name="matrix") const
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 * get_column_sum(T *matrix, int32_t m, int32_t n)
static SGVector< float64_t > compute_eigenvectors(SGMatrix< float64_t > matrix)
static T * clone_matrix(const T *matrix, int32_t nrows, int32_t ncols)
shogun reference count managed data
static SGMatrix< T > create_identity_matrix(index_t size, T scale)
A File access base class.
bool operator==(SGMatrix< T > &other)
const T & operator[](index_t index) const
static void create_diagonal_matrix(T *matrix, T *v, int32_t size)
const T & operator()(index_t i_row, index_t i_col) const
void remove_column_mean()
static float64_t trace(float64_t *mat, int32_t cols, int32_t rows)
static void inverse(SGMatrix< float64_t > matrix)
inverses square matrix in-place
void compute_few_eigenvectors(double *matrix_, double *&eigenvalues, double *&eigenvectors, int n, int il, int iu)
all of classes and functions are contained in the shogun namespace
static SGMatrix< float64_t > create_centering_matrix(index_t size)
T & operator()(index_t i_row, index_t i_col)
void set_const(T const_elem)
static SGMatrix< T > get_allocated_matrix(index_t num_rows, index_t num_cols, SGMatrix< T > pre_allocated=SGMatrix< T >())
SGVector< T > get_diagonal_vector() const
virtual void copy_data(const SGReferencedData &orig)
T * get_column_vector(index_t col) const
static void center_matrix(T *matrix, int32_t m, int32_t n)