Skip to content

Commit

Permalink
Replace void foo(void) -> void foo() and finish template .h -> .cpp
Browse files Browse the repository at this point in the history
transition in shogun/features/*
  • Loading branch information
Soeren Sonnenburg committed Sep 19, 2011
1 parent 8adcc9d commit f694cb6
Show file tree
Hide file tree
Showing 152 changed files with 1,854 additions and 1,552 deletions.
10 changes: 5 additions & 5 deletions src/shogun/base/DynArray.h
Expand Up @@ -55,7 +55,7 @@ template <class T> class DynArray
}

/** destructor */
virtual ~DynArray(void)
virtual ~DynArray()
{
if (use_sg_mallocs)
SG_FREE(array);
Expand Down Expand Up @@ -212,7 +212,7 @@ template <class T> class DynArray
/** STD VECTOR compatible. Delete array element at the end
* of array.
*/
inline void pop_back(void)
inline void pop_back()
{
if (get_num_elements() <= 0) return;
delete_element(get_num_elements()-1);
Expand All @@ -223,7 +223,7 @@ template <class T> class DynArray
*
* @return element at the end of array
*/
inline T back(void) const
inline T back() const
{
if (get_num_elements() <= 0) return get_element(0);
return get_element(get_num_elements()-1);
Expand Down Expand Up @@ -326,7 +326,7 @@ template <class T> class DynArray
*
* @return the array
*/
inline T* get_array(void) const
inline T* get_array() const
{
return array;
}
Expand All @@ -347,7 +347,7 @@ template <class T> class DynArray
}

/** clear the array (with zeros) */
inline void clear_array(void)
inline void clear_array()
{
if (last_element_idx >= 0)
memset(array, 0, (last_element_idx+1)*sizeof(T));
Expand Down
8 changes: 4 additions & 4 deletions src/shogun/base/Parameter.cpp
Expand Up @@ -1576,7 +1576,7 @@ TParameter::TParameter(const TSGDataType* datatype, void* parameter,
m_description = strdup(description);
}

TParameter::~TParameter(void)
TParameter::~TParameter()
{
SG_FREE(m_description);
SG_FREE(m_name);
Expand Down Expand Up @@ -1613,7 +1613,7 @@ TParameter::print(const char* prefix)
}

void
TParameter::delete_cont(void)
TParameter::delete_cont()
{
/* In the case, ctype is a struct (not array of a basic type)
* data does not start at m_parameter, since the latter may have
Expand Down Expand Up @@ -2385,12 +2385,12 @@ TParameter::load(CSerializableFile* file, const char* prefix)
return true;
}

Parameter::Parameter(void)
Parameter::Parameter()
{
SG_REF(sg_io);
}

Parameter::~Parameter(void)
Parameter::~Parameter()
{
for (int32_t i=0; i<get_num_parameters(); i++)
delete m_params.get_element(i);
Expand Down
8 changes: 4 additions & 4 deletions src/shogun/base/Parameter.h
Expand Up @@ -61,7 +61,7 @@ struct TParameter

private:
char* new_prefix(const char* s1, const char* s2);
void delete_cont(void);
void delete_cont();
void new_cont(index_t new_len_y, index_t new_len_x);
bool new_sgserial(CSGObject** param, EPrimitiveType generic,
const char* sgserializable_name,
Expand All @@ -85,9 +85,9 @@ class Parameter
{
public:
/** explicit constructor */
explicit Parameter(void);
explicit Parameter();
/** destructor */
virtual ~Parameter(void);
virtual ~Parameter();

/** print
* @param prefix prefix
Expand All @@ -109,7 +109,7 @@ class Parameter
/** getter for number of parameters
* @return number of parameters
*/
inline virtual int32_t get_num_parameters(void)
inline virtual int32_t get_num_parameters()
{
return m_params.get_num_elements();
}
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/GMNPLib.cpp
Expand Up @@ -77,9 +77,9 @@ using namespace shogun;
#define KDELTA(A,B) (A==B)
#define KDELTA4(A1,A2,A3,A4) ((A1==A2)||(A1==A3)||(A1==A4)||(A2==A3)||(A2==A4)||(A3==A4))

CGMNPLib::CGMNPLib(void)
CGMNPLib::CGMNPLib()
{
SG_UNSTABLE("CGMNPLib::CGMNPLib(void)", "\n");
SG_UNSTABLE("CGMNPLib::CGMNPLib()", "\n");

diag_H = NULL;
kernel_columns = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/GMNPLib.h
Expand Up @@ -67,7 +67,7 @@ class CGMNPLib: public CSGObject
{
public:
/** default constructor */
CGMNPLib(void);
CGMNPLib();

/** constructor
*
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/GMNPSVM.cpp
Expand Up @@ -38,7 +38,7 @@ CGMNPSVM::~CGMNPSVM()
}

void
CGMNPSVM::init(void)
CGMNPSVM::init()
{
m_parameters->add_matrix(&m_basealphas,
&m_basealphas_y, &m_basealphas_x,
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/GMNPSVM.h
Expand Up @@ -23,7 +23,7 @@ namespace shogun
*/
class CGMNPSVM : public CMultiClassSVM
{
void init(void);
void init();

public:
/** default constructor */
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/GNPPLib.cpp
Expand Up @@ -30,9 +30,9 @@ using namespace shogun;

#define INDEX(ROW,COL,DIM) ((COL*DIM)+ROW)

CGNPPLib::CGNPPLib(void)
CGNPPLib::CGNPPLib()
{
SG_UNSTABLE("CGNPPLib::CGNPPLib(void)", "\n");
SG_UNSTABLE("CGNPPLib::CGNPPLib()", "\n");

kernel_columns = NULL;
cache_index = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/GNPPLib.h
Expand Up @@ -32,7 +32,7 @@ class CGNPPLib: public CSGObject
{
public:
/** default constructor */
CGNPPLib(void);
CGNPPLib();

/** constructor
*
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/LibLinear.cpp
Expand Up @@ -22,7 +22,7 @@

using namespace shogun;

CLibLinear::CLibLinear(void)
CLibLinear::CLibLinear()
: CLinearMachine()
{
init();
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/LibLinear.h
Expand Up @@ -48,7 +48,7 @@ class CLibLinear : public CLinearMachine
{
public:
/** default constructor */
CLibLinear(void);
CLibLinear();

/** constructor
*
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/MultiClassSVM.cpp
Expand Up @@ -14,7 +14,7 @@

using namespace shogun;

CMultiClassSVM::CMultiClassSVM(void)
CMultiClassSVM::CMultiClassSVM()
: CSVM(0), multiclass_type(ONE_VS_REST), m_num_svms(0), m_svms(NULL)
{
init();
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/QPBSVMLib.cpp
Expand Up @@ -64,9 +64,9 @@ using namespace shogun;

#define INDEX(ROW,COL,DIM) ((COL*DIM)+ROW)

CQPBSVMLib::CQPBSVMLib(void)
CQPBSVMLib::CQPBSVMLib()
{
SG_UNSTABLE("CQPBSVMLib::CQPBSVMLib(void)", "\n");
SG_UNSTABLE("CQPBSVMLib::CQPBSVMLib()", "\n");

m_H=0;
m_dim = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/QPBSVMLib.h
Expand Up @@ -46,7 +46,7 @@ class CQPBSVMLib: public CSGObject
{
public:
/** default constructor */
CQPBSVMLib(void);
CQPBSVMLib();

/** constructor
*
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/SVMLight.cpp
Expand Up @@ -464,10 +464,10 @@ void CSVMLight::svm_learn()
kernel->cache_kernel_row(i);
}
}
(void)compute_index(index,totdoc,index2dnum);
compute_index(index,totdoc,index2dnum);
update_linear_component(docs,label,index2dnum,alpha,a,index2dnum,totdoc,
lin,aicache,NULL);
(void)calculate_svm_model(docs,label,lin,alpha,a,c,
calculate_svm_model(docs,label,lin,alpha,a,c,
index2dnum,index2dnum);
for (i=0;i<totdoc;i++) { /* copy initial alphas */
a[i]=alpha[i];
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/SVMOcas.h
Expand Up @@ -33,7 +33,7 @@ class CSVMOcas : public CLinearMachine
{
public:
/** default constructor */
CSVMOcas(void);
CSVMOcas();

/** constructor
*
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/SVM_linear.cpp
Expand Up @@ -115,7 +115,7 @@ void l2r_lr_fun::grad(double *w, double *g)
g[i] = w[i] + g[i];
}

int l2r_lr_fun::get_nr_variable(void)
int l2r_lr_fun::get_nr_variable()
{
return prob->n;
}
Expand Down Expand Up @@ -243,7 +243,7 @@ void l2r_l2_svc_fun::grad(double *w, double *g)
g[i] = w[i] + 2*g[i];
}

int l2r_l2_svc_fun::get_nr_variable(void)
int l2r_l2_svc_fun::get_nr_variable()
{
return prob->n;
}
Expand Down
6 changes: 3 additions & 3 deletions src/shogun/classifier/svm/SVM_linear.h
Expand Up @@ -144,7 +144,7 @@ class l2loss_svm_fun : public function
*
* @return number of variables
*/
int32_t get_nr_variable(void);
int32_t get_nr_variable();

private:
void Xv(float64_t *v, float64_t *Xv);
Expand Down Expand Up @@ -193,7 +193,7 @@ class l2r_lr_fun : public function
*/
void Hv(float64_t *s, float64_t *Hs);

int32_t get_nr_variable(void);
int32_t get_nr_variable();

private:
void Xv(float64_t *v, float64_t *Xv);
Expand All @@ -215,7 +215,7 @@ class l2r_l2_svc_fun : public function
void grad(double *w, double *g);
void Hv(double *s, double *Hs);

int get_nr_variable(void);
int get_nr_variable();

private:
void Xv(double *v, double *Xv);
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/ScatterSVM.cpp
Expand Up @@ -19,11 +19,11 @@

using namespace shogun;

CScatterSVM::CScatterSVM(void)
CScatterSVM::CScatterSVM()
: CMultiClassSVM(ONE_VS_REST), scatter_type(NO_BIAS_LIBSVM),
model(NULL), norm_wc(NULL), norm_wcw(NULL), rho(0), m_num_classes(0)
{
SG_UNSTABLE("CScatterSVM::CScatterSVM(void)", "\n");
SG_UNSTABLE("CScatterSVM::CScatterSVM()", "\n");
}

CScatterSVM::CScatterSVM(SCATTER_TYPE type)
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/ScatterSVM.h
Expand Up @@ -54,7 +54,7 @@ class CScatterSVM : public CMultiClassSVM
{
public:
/** default constructor */
CScatterSVM(void);
CScatterSVM();

/** constructor */
CScatterSVM(SCATTER_TYPE type);
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/Tron.h
Expand Up @@ -46,9 +46,9 @@ class function
*
* @return something inty
*/
virtual int32_t get_nr_variable(void) = 0 ;
virtual int32_t get_nr_variable() = 0 ;

virtual ~function(void){}
virtual ~function(){}
};
#endif // DOXYGEN_SHOULD_SKIP_THIS

Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/WDSVMOcas.cpp
Expand Up @@ -45,11 +45,11 @@ struct wdocas_thread_params_add
};
#endif // DOXYGEN_SHOULD_SKIP_THIS

CWDSVMOcas::CWDSVMOcas(void)
CWDSVMOcas::CWDSVMOcas()
: CMachine(), use_bias(false), bufsize(3000), C1(1), C2(1),
epsilon(1e-3), method(SVM_OCAS)
{
SG_UNSTABLE("CWDSVMOcas::CWDSVMOcas(void)", "\n");
SG_UNSTABLE("CWDSVMOcas::CWDSVMOcas()", "\n");

w=NULL;
old_w=NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/WDSVMOcas.h
Expand Up @@ -27,7 +27,7 @@ class CWDSVMOcas : public CMachine
{
public:
/** default constructor */
CWDSVMOcas(void);
CWDSVMOcas();

/** constructor
*
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/gpdt.cpp
Expand Up @@ -175,7 +175,7 @@ int32_t prescan_document(char *file, int32_t *lines, int32_t *vlen, int32_t *ll)
/******************************************************************************/
/*** return 1 if problem is single class, 0 if two-class ***/
/******************************************************************************/
int32_t QPproblem::Check2Class(void)
int32_t QPproblem::Check2Class()
{
int32_t i;

Expand Down
4 changes: 2 additions & 2 deletions src/shogun/classifier/svm/gpdtsolve.cpp
Expand Up @@ -119,10 +119,10 @@ class sCache
int32_t DivideMP (int32_t *out, int32_t *in, int32_t n);

/*** Itarations counter ***/
void Iteration(void) { nit++; }
void Iteration() { nit++; }

/*** Cache size control ***/
int32_t CheckCycle(void)
int32_t CheckCycle()
{
int32_t us;
cache_entry *pt = first_free->next;
Expand Down
6 changes: 3 additions & 3 deletions src/shogun/classifier/svm/gpdtsolve.h
Expand Up @@ -99,7 +99,7 @@ class QPproblem : public CSGObject
*
* @return an int
*/
int32_t Check2Class (void);
int32_t Check2Class ();

/** subproblem
*
Expand All @@ -110,7 +110,7 @@ class QPproblem : public CSGObject
void Subproblem (QPproblem &ker, int32_t len, int32_t *perm);

/** PrepMP */
void PrepMP (void);
void PrepMP ();

/** solve gpdt
*
Expand Down Expand Up @@ -158,7 +158,7 @@ class QPproblem : public CSGObject
private:
int32_t Preprocess0 (int32_t *aux, int32_t *sv);
int32_t Preprocess1 (sKernel* KER, int32_t *aux, int32_t *sv);
int32_t optimal (void);
int32_t optimal ();

bool is_zero(int32_t i) { return (alpha[i] < DELTAsv); }
bool is_free(int32_t i)
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/distance/KernelDistance.h
Expand Up @@ -34,7 +34,7 @@ class CKernelDistance: public CDistance
{
public:
/** default constructor */
CKernelDistance(void);
CKernelDistance();

/** constructor
*
Expand Down

0 comments on commit f694cb6

Please sign in to comment.