Skip to content

Commit

Permalink
Warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Aug 22, 2011
1 parent cc4c0a8 commit aa4de69
Show file tree
Hide file tree
Showing 27 changed files with 93 additions and 52 deletions.
3 changes: 2 additions & 1 deletion src/shogun/base/Parameter.h
Expand Up @@ -18,6 +18,7 @@

namespace shogun
{
/** Parameter */
struct TParameter
{
/** explicit constructor
Expand Down Expand Up @@ -75,7 +76,7 @@ struct TParameter
const char* prefix);
};

/* Must not be an CSGObject to prevent a recursive call of
/** Must not be an CSGObject to prevent a recursive call of
* constructors.
*/
class Parameter
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/base/class_list.h
Expand Up @@ -17,7 +17,7 @@ namespace shogun {
class CSGObject;

/** new shogun serializable
* @param serializable_name
* @param sgserializable_name
* @param generic
*/
CSGObject* new_sgserializable(const char* sgserializable_name,
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/LaRank.h
Expand Up @@ -302,8 +302,8 @@ namespace shogun
#endif // DOXYGEN_SHOULD_SKIP_THIS


/*
** MACHINE: the main thing, which is trained.
/**
* MACHINE: the main thing, which is trained.
*/
class CLaRank: public CMultiClassSVM
{
Expand Down
14 changes: 14 additions & 0 deletions src/shogun/classifier/svm/gpm.h
Expand Up @@ -30,6 +30,20 @@

namespace shogun
{
/** gpm solver
* @param Solver
* @param Projector
* @param n
* @param A
* @param b
* @param c
* @param e
* @param iy
* @param x
* @param tol
* @param ls
* @param proj
*/
int32_t gpm_solver(
int32_t Solver, int32_t Projector, int32_t n, float32_t *A, float64_t *b,
float64_t c, float64_t e, int32_t *iy, float64_t *x, float64_t tol,
Expand Down
6 changes: 3 additions & 3 deletions src/shogun/classifier/svm/libqp.h
Expand Up @@ -34,7 +34,7 @@ namespace shogun
#define LIBQP_MAX(A,B) ((A) < (B) ? (B) : (A))
#define LIBQP_ABS(A) ((A) < 0 ? -(A) : (A))

/* QP solver return value */
/** QP solver return value */
typedef struct {
/** number of iterations */
uint32_t nIter;
Expand All @@ -51,7 +51,7 @@ typedef struct {
4 ... eps-KKT conditions satisfied */
} libqp_state_T;

/* QP solver for tasks with simplex constraints */
/** QP solver for tasks with simplex constraints */
libqp_state_T libqp_splx_solver(const float64_t* (*get_col)(uint32_t),
float64_t *diag_H,
float64_t *f,
Expand All @@ -66,7 +66,7 @@ libqp_state_T libqp_splx_solver(const float64_t* (*get_col)(uint32_t),
float64_t QP_TH,
void (*print_state)(libqp_state_T state));

/* Generalized SMO algorithm */
/** Generalized SMO algorithm */
libqp_state_T libqp_gsmo_solver(const float64_t* (*get_col)(uint32_t),
float64_t *diag_H,
float64_t *f,
Expand Down
3 changes: 1 addition & 2 deletions src/shogun/classifier/svm/pr_loqo.h
Expand Up @@ -46,7 +46,7 @@ namespace shogun
* for Quadratic Programming
*/

/*
/**
* n : number of primal variables
* m : number of constraints (typically 1)
* h_x : dot product matrix (n.n)
Expand All @@ -73,7 +73,6 @@ namespace shogun
* restart : 1 if restart desired
*
*/

int32_t pr_loqo(
int32_t n, int32_t m, float64_t c[], float64_t h_x[], float64_t a[],
float64_t b[], float64_t l[], float64_t u[], float64_t primal[],
Expand Down
1 change: 1 addition & 0 deletions src/shogun/distributions/PositionalPWM.h
Expand Up @@ -18,6 +18,7 @@

namespace shogun
{
/** Positional PWM */
class CPositionalPWM : public CDistribution
{
public:
Expand Down
1 change: 1 addition & 0 deletions src/shogun/io/SerializableAsciiFile.h
Expand Up @@ -30,6 +30,7 @@

namespace shogun
{
/** serializable ascii file */
class CSerializableAsciiFile :public CSerializableFile
{
friend class SerializableAsciiReader00;
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/io/SerializableFile.h
Expand Up @@ -20,9 +20,11 @@ namespace shogun
{
class CSGObject;

/** serializable file */
class CSerializableFile :public CSGObject
{
public:
/** serializable reader */
struct TSerializableReader :public CSGObject {

/* ******************************************************** */
Expand Down
1 change: 1 addition & 0 deletions src/shogun/kernel/ScatterKernelNormalizer.h
Expand Up @@ -19,6 +19,7 @@

namespace shogun
{
/** scatter kernel normalizer */
class CScatterKernelNormalizer: public CKernelNormalizer
{

Expand Down
1 change: 1 addition & 0 deletions src/shogun/kernel/SpectrumRBFKernel.h
Expand Up @@ -27,6 +27,7 @@
namespace shogun
{

/** spectrum rbf kernel */
class CSpectrumRBFKernel: public CStringKernel<char>
{
public:
Expand Down
1 change: 1 addition & 0 deletions src/shogun/kernel/WeightedDegreeRBFKernel.h
Expand Up @@ -8,6 +8,7 @@
namespace shogun
{

/** weighted degree RBF kernel */
class CWeightedDegreeRBFKernel: public CDotKernel
{
public:
Expand Down
4 changes: 3 additions & 1 deletion src/shogun/lib/DataType.h
Expand Up @@ -184,6 +184,7 @@ template<class T> class SGMatrix
bool do_free;
};

/** shogun n-dimensional array */
template<class T> class SGNDArray
{
public:
Expand All @@ -207,6 +208,7 @@ template<class T> class SGNDArray
index_t num_dims;
};

/** shogun string */
template<class T> struct SGString
{
public:
Expand Down Expand Up @@ -494,7 +496,7 @@ enum EPrimitiveType
};
#endif

/* Datatypes that shogun supports. */
/** Datatypes that shogun supports. */
struct TSGDataType
{
/** container type */
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/lib/GCArray.h
Expand Up @@ -16,6 +16,7 @@

namespace shogun
{
define IGNORE_IN_CLASSLIST
/** @brief Template class GCArray implements a garbage collecting static array
*
* This array is meant to be used for Shogun Objects (CSGObject) only, as it
Expand All @@ -24,8 +25,7 @@ namespace shogun
* elements).
*
* */
#define IGNORE_IN_CLASSLIST
IGNORE_IN_CLASSLIST template <class T> class CGCArray : public CSGObject
#IGNORE_IN_CLASSLIST template <class T> class CGCArray : public CSGObject
{
public:
/** default constructor */
Expand Down
1 change: 1 addition & 0 deletions src/shogun/lib/HashSet.h
Expand Up @@ -19,6 +19,7 @@
namespace shogun
{

/** hashset node */
struct HashSetNode
{
/** key of node */
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/lib/Trie.h
Expand Up @@ -134,6 +134,7 @@ struct TreeParseInfo {

template <class Trie> class CTrie;

#define IGNORE_IN_CLASSLIST
/** @brief Template class Trie implements a suffix trie, i.e. a tree in which all
* suffixes up to a certain length are stored.
*
Expand All @@ -152,7 +153,6 @@ template <class Trie> class CTrie;
* may save a lot of memory on higher degree tries.
*
*/
#define IGNORE_IN_CLASSLIST
IGNORE_IN_CLASSLIST template <class Trie> class CTrie : public CSGObject
{
public:
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/mathematics/lapack.h
Expand Up @@ -60,6 +60,7 @@ int clapack_dgetrs(const CBLAS_ORDER Order, const CBLAS_TRANSPOSE Transpose,

namespace shogun
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
void wrap_dsyev(char jobz, char uplo, int n, double *a, int lda,
double *w, int *info);
void wrap_dgesvd(char jobu, char jobvt, int m, int n, double *a, int lda,
Expand All @@ -71,6 +72,7 @@ void wrap_dsyevr(char jobz, char uplo, int n, double *a, int lda, int il, int iu
double *eigenvalues, double *eigenvectors, int *info);
void wrap_dsygvx(int itype, char jobz, char uplo, int n, double *a, int lda, double *b,
int ldb, int il, int iu, double *eigenvalues, double *eigenvectors, int *info);
#endif
}

// only MKL, ACML and Mac OS vector library provide a header file for the lapack routines
Expand Down
3 changes: 2 additions & 1 deletion src/shogun/preprocessor/DimensionReductionPreprocessor.h
Expand Up @@ -97,7 +97,8 @@ class CDimensionReductionPreprocessor: public CSimplePreprocessor<float64_t>
}

public:


/** const indicating target dimensionality should be determined automagically */
static const int32_t AUTO_TARGET_DIM = -1;

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/preprocessor/HessianLocallyLinearEmbedding.h
Expand Up @@ -65,7 +65,7 @@ class CHessianLocallyLinearEmbedding: public CLocallyLinearEmbedding
virtual SGMatrix<float64_t> apply_to_feature_matrix(CFeatures* features);

/** apply preprocessor to feature vector, not supported
* @vector
* @param vector
*/
virtual SGVector<float64_t> apply_to_feature_vector(SGVector<float64_t> vector);

Expand Down
4 changes: 2 additions & 2 deletions src/shogun/preprocessor/KernelPCA.h
Expand Up @@ -34,10 +34,10 @@ class CKernelPCA: public CDimensionReductionPreprocessor
CKernelPCA();

/** constructor
*
* @param thresh threshold
* @param k kernel to be used
*/
CKernelPCA(CKernel* k);

virtual ~CKernelPCA();

/// initialize preprocessor from features
Expand Down
12 changes: 6 additions & 6 deletions src/shogun/preprocessor/LaplacianEigenmaps.h
Expand Up @@ -56,7 +56,7 @@ class CLaplacianEigenmaps: public CDimensionReductionPreprocessor
virtual ~CLaplacianEigenmaps();

/** init
* @param data feature vectors for preproc
* @param features
*/
virtual bool init(CFeatures* features);

Expand All @@ -65,18 +65,18 @@ class CLaplacianEigenmaps: public CDimensionReductionPreprocessor
*/
virtual void cleanup();

/** apply preproc to feature matrix
*
/** apply preprocessor to feature matrix
* @param features
*/
virtual SGMatrix<float64_t> apply_to_feature_matrix(CFeatures* features);

/** apply preproc to feature vector
*
* @param vector
*/
virtual SGVector<float64_t> apply_to_feature_vector(SGVector<float64_t> vector);

/** setter for K parameter
* @param k k
* @param k k value
*/
void inline set_k(int32_t k)
{
Expand All @@ -92,7 +92,7 @@ class CLaplacianEigenmaps: public CDimensionReductionPreprocessor
}

/** setter for TAU parameter
* @param tau tau
* @param tau tau value
*/
void inline set_tau(float64_t tau)
{
Expand Down
6 changes: 5 additions & 1 deletion src/shogun/preprocessor/PCA.h
Expand Up @@ -22,10 +22,14 @@

namespace shogun
{
/** mode of pca */
enum EPCAMode
{
/** cut by threshold */
THRESHOLD,
/** variance explained */
VARIANCE_EXPLAINED,
/** keep fixed number of features */
FIXED_NUMBER
};

Expand All @@ -47,7 +51,7 @@ class CPCA: public CDimensionReductionPreprocessor

/** constructor
* @param do_whitening do whitening
* @param type of cutoff
* @param mode mode of pca
* @param thresh threshold
*/
CPCA(bool do_whitening=false, EPCAMode mode=FIXED_NUMBER, float64_t thresh=1e-6);
Expand Down
53 changes: 26 additions & 27 deletions src/shogun/preprocessor/RandomFourierGaussPreproc.h
Expand Up @@ -20,34 +20,33 @@
#include <shogun/preprocessor/SimplePreprocessor.h>

namespace shogun {
/** @brief Preprocessor CRandomFourierGaussPreproc
* implements Random Fourier Features for the Gauss kernel a la Ali Rahimi and Ben Recht Nips2007
* after preprocessing the features using them in a linear kernel approximates a gaussian kernel
*
* approximation quality depends on dimension of feature space, NOT on number of data.
*
* effectively it requires two parameters for initialization: (A) the dimension of the input features stored in
* dim_input_space
* (B) the dimension of the output feature space
*
* in order to make it work there are two ways:
* (1) if you have already previously computed random fourier features which you want to use together with
* newly computed ones, then you have to take the random coefficients from the previous computation and provide them
* via void set_randomcoefficients(...) for the new computation
* this case is important for example if you compute separately features on training and testing data in two feature objects
*
* in this case you have to set
* 1a) void set_randomcoefficients(...)
*
* (2) if you compute random fourier features from scratch
* in this case you have to set
* 2a) set_kernelwidth(...)
* 2b) void set_dim_feature_space(const int32_t dim);
* 2c) set_dim_input_space(const int32_t dim);
* 2d) init_randomcoefficients() or apply_to_feature_matrix(...)
*/
class CRandomFourierGaussPreproc: public CSimplePreprocessor<float64_t> {
/** @brief Preprocessor CRandomFourierGaussPreproc
* implements Random Fourier Features for the Gauss kernel a la Ali Rahimi and Ben Recht Nips2007
* after preprocessing the features using them in a linear kernel approximates a gaussian kernel
*
* approximation quality depends on dimension of feature space, NOT on number of data.
*
* effectively it requires two parameters for initialization: (A) the dimension of the input features stored in
* dim_input_space
* (B) the dimension of the output feature space
*
* in order to make it work there are two ways:
* (1) if you have already previously computed random fourier features which you want to use together with
* newly computed ones, then you have to take the random coefficients from the previous computation and provide them
* via void set_randomcoefficients(...) for the new computation
* this case is important for example if you compute separately features on training and testing data in two feature objects
*
* in this case you have to set
* 1a) void set_randomcoefficients(...)
*
* (2) if you compute random fourier features from scratch
* in this case you have to set
* 2a) set_kernelwidth(...)
* 2b) void set_dim_feature_space(const int32_t dim);
* 2c) set_dim_input_space(const int32_t dim);
* 2d) init_randomcoefficients() or apply_to_feature_matrix(...)
*/

public:
/** default constructor */
CRandomFourierGaussPreproc();
Expand Down

0 comments on commit aa4de69

Please sign in to comment.