Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ pub enum Sense {
}

impl Model {
/// Return pointer to underlying HiGHS model
pub fn as_ptr(&self) -> *const c_void{
self.highs.ptr()
}

/// Return mutable pointer to underlying HiGHS model
pub fn as_mut_ptr(&mut self) -> *mut c_void{
self.highs.mut_ptr()
}

/// Set the optimization sense (minimize by default)
pub fn set_sense(&mut self, sense: Sense) {
let ret = unsafe { Highs_changeObjectiveSense(self.highs.mut_ptr(), sense as c_int) };
Expand Down Expand Up @@ -591,6 +601,16 @@ impl HighsPtr {
}

impl SolvedModel {
/// Return pointer to underlying HiGHS model
pub fn as_ptr(&self) -> *const c_void{
self.highs.ptr()
}

/// Return mutable pointer to underlying HiGHS model
pub fn as_mut_ptr(&mut self) -> *mut c_void{
self.highs.mut_ptr()
}

/// The status of the solution. Should be Optimal if everything went well.
pub fn status(&self) -> HighsModelStatus {
let model_status = unsafe { Highs_getModelStatus(self.highs.unsafe_mut_ptr()) };
Expand Down