The refactoring from issue #85 has to be completed first.
Motivation:
A lot of complicated code is required in fastFM/ffm.pyx to wrap the
c structs cs_di and ffm_param (see fastFM/cff.pxd).
Basically the fastFM-core header fastFM-core/include/ffm.h should be refactored using ADTs [1] (for cs_di and ffm_param) so that the C lib can be call as suggested here.
Overview:
(fastFM-core): Forward declare the struts and provide factory function in order to remove
implementation details from fastFM-core/include/ffm.h (see [0,1] for an example).
(fastFM): Adapt fastFM/ffm.pyx and fastFM/cff.pxd to the new ffm.h header.
1 Refactor C Interface:
[ ] (fastFM-core) Add C constructor for the structs cs_di, ffm_param.
The refactoring from issue #85 has to be completed first.
Motivation:
A lot of complicated code is required in
fastFM/ffm.pyx
to wrap the c structs cs_di and ffm_param (seefastFM/cff.pxd
).Basically the fastFM-core header fastFM-core/include/ffm.h should be refactored using ADTs [1] (for
cs_di
andffm_param
) so that the C lib can be call as suggested here.Overview:
(fastFM-core): Forward declare the struts and provide factory function in order to remove implementation details from fastFM-core/include/ffm.h (see [0,1] for an example).
(fastFM): Adapt
fastFM/ffm.pyx
andfastFM/cff.pxd
to the newffm.h
header.1 Refactor C Interface:
cs_di
,ffm_param
.in
ffm.h
the implementation goes into
ffm.c
2 Use new C Interface:
fastFM/cff.pxd
.fastFM/ffm.pyx
.3 Clean Up
fastFM/cff.pxd
andffm.h
.[0] slide 15 http://www.slideshare.net/StefanusDuToit/cpp-con-2014-hourglass-interfaces-for-c-apis [1] http://inst.eecs.berkeley.edu/~selfpace/studyguide/9C.sg/Output/ADTs.in.C.html