Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable names #208

Closed
matbesancon opened this issue Oct 27, 2022 · 2 comments · Fixed by #209
Closed

Variable names #208

matbesancon opened this issue Oct 27, 2022 · 2 comments · Fixed by #209

Comments

@matbesancon
Copy link
Contributor

From the C interface, columns in Cbc seem to have variable names, not sure they can be set after creation though.
In any case, when the problem is created with copy_to, names could be passed as well

@odow
Copy link
Member

odow commented Oct 27, 2022

Is there a need for this? I think I punted because we always use Cbc with a cache, and that stores the names. Supporting names is really only needed for solvers in direct-mode.

Methods are here:

function Cbc_setColName(model, iColumn, name)
ccall((:Cbc_setColName, libcbcsolver), Cvoid, (Ptr{Cbc_Model}, Cint, Cstring), model, iColumn, name)
end
function Cbc_setRowName(model, iRow, name)
ccall((:Cbc_setRowName, libcbcsolver), Cvoid, (Ptr{Cbc_Model}, Cint, Cstring), model, iRow, name)
end

function Cbc_getRowName(model, iRow, name, maxLength)
ccall((:Cbc_getRowName, libcbcsolver), Cvoid, (Ptr{Cbc_Model}, Cint, Cstring, Cint), model, iRow, name, maxLength)
end
function Cbc_getColName(model, iColumn, name, maxLength)
ccall((:Cbc_getColName, libcbcsolver), Cvoid, (Ptr{Cbc_Model}, Cint, Cstring, Cint), model, iColumn, name, maxLength)
end

@matbesancon
Copy link
Contributor Author

the use case is solving instances loaded from a file with Cbc, it would be useful to have access to the names (and have them set at copy_to time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants