Skip to content

Instantly share code, notes, and snippets.

@dzolnai
Last active January 17, 2017 18:17
Show Gist options
  • Save dzolnai/a32c11972124373377c621f160a8b170 to your computer and use it in GitHub Desktop.
Save dzolnai/a32c11972124373377c621f160a8b170 to your computer and use it in GitHub Desktop.
Simplex solver article - gist 2
ScriptC_simplex script = new ScriptC_simplex(renderScript);
ScriptField_Tableau tableau = new ScriptField_Tableau(renderScript, 1);
int rowCount = data.length;
int columnCount = data[0].length;
tableau.set_rows(0, rowCount, false);
tableau.set_columns(0, columnCount, false);
tableau.set_dual_program(0, minimize, false);
tableau.set_matrix(0, data, false);
// Copy all values at once to the allocated memory of the struct.
tableau.copyAll();
script.bind_tableau(tableau);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment