HDIM  1.0.0
Packages for High Dimensional Linear Regression
fos_js.cpp
1 //Explicit Instantiation of X_FOS for Wrappers
2 
3 
4 #include "fos_js.hpp"
5 
6 template class JS_FOS<float>;
7 template class JS_FOS<double>;
8 
9 #ifdef JS_BUILD
10 
11 #include <emscripten/bind.h>
12 using namespace emscripten;
13 
14 
15 EMSCRIPTEN_BINDINGS(stl_wrappers) {
16  register_vector<float>("VectorFloat");
17  register_vector<double>("VectorDouble");
18  register_vector<int>("VectorInt");
19 }
20 
21 // Binding code
22 EMSCRIPTEN_BINDINGS(fos_interface) {
23  class_< JS_FOS<double> >("FOS")
24  .constructor()
25  .function( "Run", &JS_FOS<double>::operator() )
26  .function( "ReturnLambda", &JS_FOS<double>::ReturnLambda )
27  .function( "ReturnIntercept", &JS_FOS<double>::ReturnIntercept )
28  .function( "ReturnOptimIndex", &JS_FOS<double>::ReturnOptimIndex )
29  .function( "ReturnCoefficients", &JS_FOS<double>::ReturnCoefficients )
30  .function( "ReturnSupport", &JS_FOS<double>::ReturnSupport )
31  ;
32 }
33 
34 #endif