SLIM
1.0
Sparse Linear Methods (SLIM) for top-n recommender systems
|
This file contains all the routines needed for BCLS optimization. More...
#include <slim.h>
Go to the source code of this file.
Macros | |
#define | CS_MAX(a, b) (((a) > (b)) ? (a) : (b)) |
Compute the maximum of two. | |
#define | CS_MIN(a, b) (((a) < (b)) ? (a) : (b)) |
Compute the minimum of two. | |
#define | CS_FLIP(i) (-(i)-2) |
Flip. | |
#define | CS_UNFLIP(i) (((i) < 0) ? CS_FLIP(i) : (i)) |
Unflip. | |
#define | CS_MARKED(w, j) (w [j] < 0) |
Check if marked. | |
#define | CS_MARK(w, j) { w [j] = CS_FLIP (w [j]) ; } |
Mark. | |
#define | CS_CSC(A) (A && (A->nz == -1)) |
CSC. | |
#define | CS_TRIPLET(A) (A && (A->nz >= 0)) |
Triplet. | |
Functions | |
int | call_back (BCLS *ls, void *UsrWrk) |
call_back function, periodically called by BCLS to test if the user wants to exit. This is from BCLS. | |
int | call_back_it (BCLS *ls, void *UsrWrk) |
call_back function, immediately terminate BCLS iterations based on how many iterations it runs | |
int | pretty_printer (void *io_file, char *msg) |
Pretty_printer, this is the print-routine that will be used by BCLS for its output. This is from BCLS. | |
void * | cs_free (void *p) |
Wrapper for free. | |
void * | cs_malloc (int n, size_t size) |
Wrapper for malloc. | |
void * | cs_calloc (int n, size_t size) |
Wrapper for calloc. | |
cs * | cs_spfree (cs *A) |
Free a sparse matrix. | |
cs * | cs_spalloc (int m, int n, int nzmax, int values, int triplet) |
Allocate a sparse matrix (triplet form or compressed-column form) | |
void | dload (const int n, const double alpha, double x[]) |
Load a constant into a vector. | |
int | Aprod (int mode, int m, int n, int nix, int ix[], double x[], double y[], void *UsrWrk) |
Aprod, matrix-vector products. This is from BCLS. | |
void | bcsol (ctrl_t *ctrl, gk_csr_t *AA, double *bb, double *x, worksp *Wrk, double *bl, double *bu, double beta, double *c) |
BCLS learning. This is from BCLS. | |
Variables | |
int | bcls_niters = 0 |
Number of iterations. | |
This file contains all the routines needed for BCLS optimization.
Definition in file bcsol.c.
int Aprod | ( | int | mode, |
int | m, | ||
int | n, | ||
int | nix, | ||
int | ix[], | ||
double | x[], | ||
double | y[], | ||
void * | UsrWrk | ||
) |
Aprod, matrix-vector products. This is from BCLS.
If mode == BCLS_PROD_A (0), compute y <- A *x, with x untouched; and if mode == BCLS_PROD_At (1), compute x <- A'*y, with y untouched.
Definition at line 163 of file bcsol.c.
References worksp::A, worksp::acol, cs_sparse::i, cs_sparse::p, and cs_sparse::x.
Referenced by bcsol().
void bcsol | ( | ctrl_t * | ctrl, |
gk_csr_t * | AA, | ||
double * | bb, | ||
double * | x, | ||
worksp * | Wrk, | ||
double * | bl, | ||
double * | bu, | ||
double | beta, | ||
double * | c | ||
) |
BCLS learning. This is from BCLS.
This is to solve the problem
Definition at line 247 of file bcsol.c.
References Aprod(), bcls_niters, call_back(), call_back_it(), ctrl_t::dbglvl, ctrl_t::max_bcls_niters, ctrl_t::optTol, and pretty_printer().
Referenced by slim_fs_learn(), and slim_learn().