extern crate doc_comment;
doc_comment::doctest!("../README.md");
pub use scip_sys as ffi;
pub mod constraint;
pub mod model;
pub mod retcode;
pub mod solution;
pub mod status;
pub mod variable;
#[macro_export]
macro_rules! scip_call {
($res:expr) => {
let res = unsafe { $res };
let retcode = $crate::retcode::Retcode::from(res);
if retcode != $crate::retcode::Retcode::Okay {
return Err(retcode);
}
};
}
#[macro_export]
macro_rules! scip_call_panic {
($res:expr) => {
let res = unsafe { $res };
let retcode = $crate::retcode::Retcode::from(res);
if retcode != $crate::retcode::Retcode::Okay {
panic!("SCIP call failed with retcode {:?}", retcode);
}
};
}
#[macro_export]
macro_rules! scip_call_expect {
($res:expr, $msg:expr) => {
let res = unsafe { $res };
let retcode = $crate::retcode::Retcode::from(res);
if retcode != $crate::retcode::Retcode::Okay {
panic!("{} - SCIP call failed with retcode {:?}", $msg, retcode);
}
};
}