Struct grb::Env

source ·
pub struct Env { /* private fields */ }
Expand description

A Gurobi Environment object.

Models objects created with Model::new will use the default Env. This default Env is thread-local and lazily initialized. Currently, it lasts until the current thread; there is no way to de-allocate it from the current thread.

Implementations§

source§

impl Env

source

pub fn empty() -> Result<EmptyEnv>

Create a new empty and un-started environment.

source

pub fn new(logfilename: &str) -> Result<Env>

Create an environment with log file

Setting logfilename to an empty string will not create a logfile.

source

pub fn get<P: ParamGet<V>, V>(&self, param: P) -> Result<V>

Query the value of a parameter

source

pub fn set<P: ParamSet<V>, V>(&mut self, param: P, value: V) -> Result<()>

Set the value of a parameter

source

pub fn read_params(&mut self, filename: &str) -> Result<()>

Import a set of parameter values from a file

source

pub fn write_params(&self, filename: &str) -> Result<()>

Write the set of parameter values to a file

source

pub fn message(&self, message: &str)

Insert a message into log file.

When message cannot convert to raw C string, a panic is occurred.

Auto Trait Implementations§

§

impl Freeze for Env

§

impl RefUnwindSafe for Env

§

impl !Send for Env

§

impl !Sync for Env

§

impl Unpin for Env

§

impl UnwindSafe for Env

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.