SLIM  1.0
Sparse Linear Methods (SLIM) for top-n recommender systems
 All Data Structures Files Functions Variables Typedefs Macros Pages
proto.h
Go to the documentation of this file.
1 /**************************************************************/
2 /*! \file
3 
4  \brief This file contains all prototypes.
5 */
6 /**************************************************************/
7 
8 
9 #ifndef __PROTO_H__
10 #define __PROTO_H__
11 
12 /* cmd.c */
13 void parse_cmdline(ctrl_t *ctrl, int argc, char * argv[]);
14 
15 /* util.c */
16 ctrl_t * create_ctrl();
17 void free_ctrl(ctrl_t * ctrl);
18 void start_timer(ctimer_t * ctimer);
19 void end_timer(ctimer_t * ctimer);
20 void display_timer(ctimer_t * ctimer, char * msg);
21 int count_nnz(double * array, int narray);
22 void find_topk(double * w, int n, int topk, double * map, int * topk2);
23 void get_column(gk_csr_t * constraint, int i, double * w);
24 
25 /* io.c */
26 gk_csr_t * read_constraint(ctrl_t * ctrl, char * file);
27 void csr_Write(gk_csr_t *mat, char *filename, char * mode,
28  int format, int writevals, int numbering);
29 
30 /* check.c */
31 void check_train_test(ctrl_t * ctrl, gk_csr_t * train, gk_csr_t * test);
32 
33 /* bcsol.c */
34 int call_back( BCLS *ls, void *UsrWrk );
35 int call_back_it( BCLS *ls, void *UsrWrk );
36 int pretty_printer( void *io_file, char *msg );
37 void *cs_free (void *p);
38 void *cs_malloc (int n, size_t size);
39 void *cs_calloc (int n, size_t size);
40 cs *cs_spfree (cs *A);
41 cs *cs_spalloc (int m, int n, int nzmax, int values, int triplet);
42 void dload( const int n, const double alpha, double x[] ) ;
43 int Aprod( int mode, int m, int n, int nix, int ix[],
44  double x[], double y[], void *UsrWrk ) ;
45 void bcsol(ctrl_t * ctrl, gk_csr_t * AA, double * bb, double * x, worksp * Wrk,
46  double * bl, double * bu,
47  double beta, double * c);
48 
49 /* slim_learn.c */
50 void slim_learn(ctrl_t * ctrl, gk_csr_t * train);
51 
52 /* slim_fs_learn.c */
53 void slim_fs_learn(ctrl_t * ctrl, gk_csr_t * A, double * b, double * w, float ** A_colval,
54  worksp * Wrk,
55  double * bl, double * bu,
56  double beta, double * c);
57 
58 /* process.c */
59 void preprocess(ctrl_t * ctrl, gk_csr_t * train, gk_csr_t * test);
60 
61 /* slim_test.c */
62 double * slim_test(ctrl_t * ctrl, gk_csr_t * model,
63  gk_csr_t * train, gk_csr_t * test);
64 int suggest_predict(ctrl_t * ctrl, gk_csr_t * model, int ** iidx,
65  gk_csr_t * train, int u, gk_dkv_t ** rcmd);
66 void slim_predict(ctrl_t * ctrl, gk_csr_t * train, gk_csr_t * test, gk_csr_t * model);
67 
68 #endif