Created
October 2, 2020 09:35
-
-
Save sverhoeven/d7db19d299bd14ecaa9bc2d20b6029b0 to your computer and use it in GitHub Desktop.
run-cpp-on-web: vega
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <emscripten/bind.h> | |
#include "newtonraphson.hpp" | |
using namespace emscripten; | |
EMSCRIPTEN_BINDINGS(newtonraphson) { | |
class_<NewtonRaphson>("NewtonRaphson") | |
.constructor<float>() | |
.function("solve", &NewtonRaphson::solve) | |
.property("iterations", &NewtonRaphson::iterations) | |
; | |
value_object<Iteration>("Iteration") | |
.field("index", &Iteration::index) | |
.field("x", &Iteration::x) | |
.field("y", &Iteration::y) | |
.field("slope", &Iteration::slope) | |
.field("delta_x", &Iteration::delta_x) | |
; | |
register_vector<Iteration>("vector<Iteration>"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment