Skip to content

Swift wrapper #5

@hfossli

Description

@hfossli

I am looking into creating a wrapper around this api in Swift. I'm facing some difficult choices.

All variables are created using a solver and the solvers am_Allocf. This makes it hard to create an object oriented model as they are tied to the solver pretty closely. This is seen throughout the API as well. Example:

AM_API int  am_add    (am_Constraint *cons)

To me I now think it is not feasible to create an object oriented swift model around Amoeba unless variables, terms and constraints can be created independently from the solver.

Methods like

AM_API int  am_add    (am_Constraint *cons)

would have to be rewritten to

AM_API int  am_add    (am_Constraint *cons, am_Solver *solver)

This is not a request to change anything. I'm just thinking loudly :) amoeba.lua is not a wrapper, but the whole implementation written in Lua if I understand correctly?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions