Skip to content

Commit

Permalink
Revert "modify for Google C++ style"
Browse files Browse the repository at this point in the history
This reverts commit 3363791.
  • Loading branch information
yorkerlin committed Mar 18, 2014
1 parent 51302d0 commit 148aca7
Showing 1 changed file with 57 additions and 59 deletions.
116 changes: 57 additions & 59 deletions src/shogun/machine/gp/LaplacianInferenceMethodWithLBFGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,64 +43,62 @@ namespace shogun {
*/

/** Wrapper class used for the LBFGS minimizer */
class CSharedInfoForLBFGS {
public:
index_t dim;
Eigen::Map<Eigen::MatrixXd>* kernel;
Eigen::Map<Eigen::VectorXd>* mean_f;
CSharedInfoForLBFGS()
:dim(0), kernel(NULL), mean_f(NULL){}
};


class CLaplacianInferenceMethodWithLBFGS: public CLaplacianInferenceMethod {
public:
/** default constructor */
CLaplacianInferenceMethodWithLBFGS();

/** constructor
*
* @param kernel covariance function
* @param features features to use in inference
* @param mean mean function
* @param labels labels of the features
* @param model Likelihood model to use
*/
CLaplacianInferenceMethodWithLBFGS(CKernel* kernel,
CFeatures* features,
CMeanFunction* mean,
CLabels* labels,
CLikelihoodModel* model);

virtual ~CLaplacianInferenceMethodWithLBFGS();

/** returns the name of the inference method
*
* @return name LaplacianWithLBFGS
*/
virtual const char* get_name() const {
return "LaplacianInferenceMethodWithLBFGS";}

protected:
/** update alpha using the LBFGS method*/
virtual void update_alpha();

/** compute the gradient given the current alpha*/
virtual void get_gradient_wrt_alpha(Eigen::Map<Eigen::VectorXd>* alpha,
Eigen::Map<Eigen::VectorXd>* gradient);

/** compute the function value given the current alpha*/
virtual void get_psi_wrt_alpha(Eigen::Map<Eigen::VectorXd>* alpha,
float64_t* psi);

/** variables needed to compute gradient and function value*/
CSharedInfoForLBFGS m_shared;

private:
/** only uses for dimension checking */
void check(int left, int right, int line);
};

} /* namespace shogun */
class CSharedInfoForLBFGS {
public:
index_t dim;
Eigen::Map<Eigen::MatrixXd>* kernel;
Eigen::Map<Eigen::VectorXd>* mean_f;
CSharedInfoForLBFGS()
:dim(0), kernel(NULL), mean_f(NULL){}
};


class CLaplacianInferenceMethodWithLBFGS: public CLaplacianInferenceMethod {
public:
/** default constructor */
CLaplacianInferenceMethodWithLBFGS();

/** constructor
*
* @param kernel covariance function
* @param features features to use in inference
* @param mean mean function
* @param labels labels of the features
* @param model Likelihood model to use
*/
CLaplacianInferenceMethodWithLBFGS(CKernel* kernel,
CFeatures* features,
CMeanFunction* mean,
CLabels* labels,
CLikelihoodModel* model);

virtual ~CLaplacianInferenceMethodWithLBFGS();

/** returns the name of the inference method
*
* @return name LaplacianWithLBFGS
*/
virtual const char* get_name() const { return "LaplacianInferenceMethodWithLBFGS"; }

protected:
/** update alpha using the LBFGS method*/
virtual void update_alpha();

/** compute the gradient given the current alpha*/
virtual void get_gradient_wrt_alpha(Eigen::Map<Eigen::VectorXd>* alpha,
Eigen::Map<Eigen::VectorXd>* gradient);

/** compute the function value given the current alpha*/
virtual void get_psi_wrt_alpha(Eigen::Map<Eigen::VectorXd>* alpha,
float64_t* psi);

/** only uses for dimension check*/
void check(int left, int right, int line);

/** variables needed to compute gradient and function value*/
CSharedInfoForLBFGS m_shared;
};

}
#endif /* HAVE_EIGEN3 */
#endif /* CLAPLACIANINFERENCEMETHODWITHLBFGS_H_ */

0 comments on commit 148aca7

Please sign in to comment.