/usr/include/shogun/optimization/liblinear/tron.h is in libshogun-dev 3.2.0-7.3build4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | #ifndef _CTron_H
#define _CTron_H
#include <shogun/lib/config.h>
#include <shogun/base/SGObject.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace shogun
{
/** class function */
class function
{
public:
/** fun
*
* abstract base method
*
* @param w w
* @return something floaty
*/
virtual float64_t fun(float64_t *w) = 0 ;
/** grad
*
* abstract base method
*
* @param w w
* @param g g
*/
virtual void grad(float64_t *w, float64_t *g) = 0 ;
/** Hv
*
* abstract base method
*
* @param s s
* @param Hs hs
*/
virtual void Hv(float64_t *s, float64_t *Hs) = 0 ;
/** get nr variable
*
* abstract base method
*
* @return something inty
*/
virtual int32_t get_nr_variable() = 0 ;
virtual ~function(){}
};
#endif // DOXYGEN_SHOULD_SKIP_THIS
/** @brief class Tron */
class CTron : public CSGObject
{
public:
CTron() { }
/** constructor
*
* @param fun_obj object of class function
* @param eps eps
* @param max_iter max iter
*/
CTron(
const function *fun_obj, float64_t eps = 0.1, int32_t max_iter = 1000);
virtual ~CTron();
/** tron
*
* @param w w
* @param max_train_time maximum training time
*/
void tron(float64_t *w, float64_t max_train_time);
/** @return object name */
virtual const char* get_name() const { return "Tron"; }
private:
int32_t trcg(float64_t delta, double* g, double* s, double* r);
float64_t norm_inf(int32_t n, float64_t *x);
float64_t eps;
int32_t max_iter;
function *fun_obj;
};
}
#endif
|