Commit b442cfb3 authored by Giovanne Marcelo's avatar Giovanne Marcelo

add high level code

parent 5f91eef2
Pipeline #6351 passed with stage
in 4 minutes and 54 seconds
......@@ -38,8 +38,9 @@ CFLAGS = -std=c99 -g -O3 \
LFLAGS = -lpq -ljansson -lgsl -lgslcblas -lm
INCL = -I./include
SRC = ./src
DEPS = ./include/db_interface.h ./include/log.h ./include/main.h ./include/data_prepare.h ./include/matrix.h
OBJ = db_interface.o log.o matrix.o data_prepare.o main.o
DEPS = ./include/db_interface.h ./include/log.h ./include/main.h ./include/data_prepare.h ./include/matrix.h \
./include/algorithm.h
OBJ = db_interface.o log.o matrix.o data_prepare.o algorithm.o main.o
APP=recommender
all: $(APP)
......
......@@ -3,6 +3,13 @@
#include "matrix.h"
void update_R();
void update_wit();
void update_hjt();
void z();
void s();
void ccd(matrix R, matrix W, matrix H, double lamb, int k, int T);
void ccd_pp(matrix R, matrix W, matrix H, double lamb, int k);
void perform();
#endif
......@@ -10,5 +10,6 @@ typedef gsl_matrix* matrix;
matrix matrix_alloc(long unsigned int rows, long unsigned int cols);
void print_matrix(matrix m);
void matrix_copy(matrix dest, matrix src);
#endif
......@@ -27,9 +27,33 @@
* end for
*/
void ccd(matrix R, matrix W, matrix H, double lamb, int k) {
void update_R() {}
void update_wit() {}
void update_hjt() {}
void z() {}
void s() {}
}
void ccd(matrix R, matrix W, matrix H, double lamb, int k, int T) {
for(int iter = 0; iter < T ; iter++) {
for(int i = 0; i < R->size1 ; i++ ) {
for(int t = 0; t < k; t++) {
z();
update_R();
update_wit();
}
}
for(int j = 0; j < R->size2; j++) {
for(int t = 0; t < k; t++) {
s();
update_R();
update_hjt();
}
}
}
}
/*
* CCD++
......
......@@ -19,3 +19,6 @@ void print_matrix(matrix m) {
puts(" ");
}
}
void matrix_copy(matrix dest, matrix src) {
gsl_matrix_memcpy (dest,src);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment