Struct mosek::Env

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

Environment. Defines an environment in which tasks are created. In most cases it is not necessary to create this directly since the tasks can use the default environment.

Implementations§

source§

impl Env

source

pub fn new() -> Option<Env>

Create a new environment

source

pub fn new_mem_debug(dbgfile: &str) -> Option<Env>

Create a new environment, specifying an output file used for writing memory debugging information.

source

pub fn task(&self) -> Option<Task>

Create a new task in this environment

source

pub fn task_with_capacity(&self, numcon: i32, numvar: i32) -> Option<Task>

Create a new task in this environment with pre-defined capacities.

source

pub fn axpy( &self, n_: i32, alpha_: f64, x_: &[f64], y_: &mut [f64] ) -> Result<(), String>

Computes vector addition and multiplication by a scalar.

§Arguments
  • n_ Length of the vectors.
  • alpha_ The scalar that multiplies x.
  • x_ The x vector.
  • y_ The y vector.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.axpy

source

pub fn check_in_all(&mut self) -> Result<(), String>

Check in all unused license features to the license token server.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.checkinall

source

pub fn check_in_license(&mut self, feature_: i32) -> Result<(), String>

Check in a license feature back to the license server ahead of time.

§Arguments
  • feature_ Feature to check in to the license system.

    See Feature

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.checkinlicense

source

pub fn check_out_license(&mut self, feature_: i32) -> Result<(), String>

Check out a license feature from the license server ahead of time.

§Arguments
  • feature_ Feature to check out from the license system.

    See Feature

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.checkoutlicense

source

pub fn check_version( &self, major_: i32, minor_: i32, revision_: i32 ) -> Result<(), String>

Compares a version of the MOSEK DLL with a specified version.

§Arguments
  • major_ Major version number.
  • minor_ Minor version number.
  • revision_ Revision number.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.checkversion

source

pub fn compute_sparse_cholesky( &self, numthreads_: i32, ordermethod_: i32, tolsingular_: f64, anzc_: &[i32], aptrc_: &[i64], asubc_: &[i32], avalc_: &[f64], perm_: &mut Vec<i32>, diag_: &mut Vec<f64>, lnzc_: &mut Vec<i32>, lptrc_: &mut Vec<i64>, lensubnval_: &mut i64, lsubc_: &mut Vec<i32>, lvalc_: &mut Vec<f64> ) -> Result<(), String>

Computes a Cholesky factorization of sparse matrix.

§Arguments
  • numthreads_ The number threads that can be used to do the computation. 0 means the code makes the choice.
  • ordermethod_ If nonzero, then a sparsity preserving ordering will be employed.
  • tolsingular_ A positive parameter controlling when a pivot is declared zero.
  • anzc_ anzc[j] is the number of nonzeros in the jth column of A.
  • aptrc_ aptrc[j] is a pointer to the first element in column j.
  • asubc_ Row indexes for each column stored in increasing order.
  • avalc_ The value corresponding to row indexed stored in asubc.
  • perm_ Permutation array used to specify the permutation matrix P computed by the function.
  • diag_ The diagonal elements of matrix D.
  • lnzc_ lnzc[j] is the number of non zero elements in column j.
  • lptrc_ lptrc[j] is a pointer to the first row index and value in column j.
  • lensubnval_ Number of elements in lsubc and lvalc.
  • lsubc_ Row indexes for each column stored in increasing order.
  • lvalc_ The values corresponding to row indexed stored in lsubc.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.computesparsecholesky

source

pub fn dot( &self, n_: i32, x_: &[f64], y_: &[f64], xty_: &mut f64 ) -> Result<(), String>

Computes the inner product of two vectors.

§Arguments
  • n_ Length of the vectors.
  • x_ The x vector.
  • y_ The y vector.
  • xty_ The result of the inner product.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.dot

source

pub fn echo_intro(&self, longver_: i32) -> Result<(), String>

Prints an intro to message stream.

§Arguments
  • longver_ If non-zero, then the intro is slightly longer.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.echointro

source

pub fn enable_gar_col_env(&mut self) -> Result<(), String>

Enable reference counting for environments.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.enablegarcolenv

source

pub fn expirylicenses(&mut self, expiry_: &mut i64) -> Result<(), String>

Reports when the first license feature expires.

§Arguments
  • expiry_ If nonnegative, then it is the minimum number days to expiry of any feature that has been checked out.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.expirylicenses

source

pub fn gemm( &self, transa_: i32, transb_: i32, m_: i32, n_: i32, k_: i32, alpha_: f64, a_: &[f64], b_: &[f64], beta_: f64, c_: &mut [f64] ) -> Result<(), String>

Performs a dense matrix multiplication.

§Arguments
  • transa_ Indicates whether the matrix A must be transposed.

    See Transpose

  • transb_ Indicates whether the matrix B must be transposed.

    See Transpose

  • m_ Indicates the number of rows of matrix C.

  • n_ Indicates the number of columns of matrix C.

  • k_ Specifies the common dimension along which op(A) and op(B) are multiplied.

  • alpha_ A scalar value multiplying the result of the matrix multiplication.

  • a_ The pointer to the array storing matrix A in a column-major format.

  • b_ The pointer to the array storing matrix B in a column-major format.

  • beta_ A scalar value that multiplies C.

  • c_ The pointer to the array storing matrix C in a column-major format.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.gemm

source

pub fn gemv( &self, transa_: i32, m_: i32, n_: i32, alpha_: f64, a_: &[f64], x_: &[f64], beta_: f64, y_: &mut [f64] ) -> Result<(), String>

Computes dense matrix times a dense vector product.

§Arguments
  • transa_ Indicates whether the matrix A must be transposed.

    See Transpose

  • m_ Specifies the number of rows of the matrix A.

  • n_ Specifies the number of columns of the matrix A.

  • alpha_ A scalar value multiplying the matrix A.

  • a_ A pointer to the array storing matrix A in a column-major format.

  • x_ A pointer to the array storing the vector x.

  • beta_ A scalar value multiplying the vector y.

  • y_ A pointer to the array storing the vector y.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.gemv

Directs all output from a stream to a file.

§Arguments
  • whichstream_ Index of the stream.

    See Streamtype

  • filename_ A valid file name.

  • append_ If this argument is 0 the file will be overwritten, otherwise it will be appended to.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.linkfiletoenvstream

source

pub fn optimize_batch( &self, israce_: bool, maxtime_: f64, numthreads_: i32, task_: &[&mut Task], trmcode_: &mut [i32], rcode_: &mut [i32] ) -> Result<(), String>

Optimize a number of tasks in parallel using a specified number of threads.

§Arguments
  • israce_ If nonzero, then the function is terminated after the first task has been completed.

  • maxtime_ Time limit for the function.

  • numthreads_ Number of threads to be employed.

  • trmcode_ The termination code for each task.

    See Rescode

  • rcode_ The response code for each task.

    See Rescode

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.optimizebatch

source

pub fn potrf(&self, uplo_: i32, n_: i32, a_: &mut [f64]) -> Result<(), String>

Computes a Cholesky factorization of a dense matrix.

§Arguments
  • uplo_ Indicates whether the upper or lower triangular part of the matrix is stored.

    See Uplo

  • n_ Dimension of the symmetric matrix.

  • a_ A symmetric matrix stored in column-major order.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.potrf

source

pub fn put_license_code(&mut self, code_: &[i32]) -> Result<(), String>

Input a runtime license code.

§Arguments
  • code_ A license key string.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.putlicensecode

source

pub fn put_license_debug(&mut self, licdebug_: i32) -> Result<(), String>

Enables debug information for the license system.

§Arguments
  • licdebug_ Enable output of license check-out debug information.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.putlicensedebug

source

pub fn put_license_path(&mut self, licensepath_: &str) -> Result<(), String>

Set the path to the license file.

§Arguments
  • licensepath_ A path specifying where to search for the license.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.putlicensepath

source

pub fn put_license_wait(&mut self, licwait_: i32) -> Result<(), String>

Control whether mosek should wait for an available license if no license is available.

§Arguments
  • licwait_ Enable waiting for a license.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.putlicensewait

source

pub fn reset_expiry_licenses(&mut self) -> Result<(), String>

Reset the license expiry reporting startpoint.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.resetexpirylicenses

source

pub fn sparse_triangular_solve_dense( &self, transposed_: i32, lnzc_: &[i32], lptrc_: &[i64], lsubc_: &[i32], lvalc_: &[f64], b_: &mut [f64] ) -> Result<(), String>

Solves a sparse triangular system of linear equations.

§Arguments
  • transposed_ Controls whether the solve is with L or the transposed L.

    See Transpose

  • lnzc_ lnzc[j] is the number of nonzeros in column j.

  • lptrc_ lptrc[j] is a pointer to the first row index and value in column j.

  • lsubc_ Row indexes for each column stored sequentially.

  • lvalc_ The value corresponding to row indexed stored lsubc.

  • b_ The right-hand side of linear equation system to be solved as a dense vector.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.sparsetriangularsolvedense

source

pub fn syeig( &self, uplo_: i32, n_: i32, a_: &[f64], w_: &mut [f64] ) -> Result<(), String>

Computes all eigenvalues of a symmetric dense matrix.

§Arguments
  • uplo_ Indicates whether the upper or lower triangular part is used.

    See Uplo

  • n_ Dimension of the symmetric input matrix.

  • a_ Input matrix A.

  • w_ Array of length at least n containing the eigenvalues of A.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.syeig

source

pub fn syevd( &self, uplo_: i32, n_: i32, a_: &mut [f64], w_: &mut [f64] ) -> Result<(), String>

Computes all the eigenvalues and eigenvectors of a symmetric dense matrix, and thus its eigenvalue decomposition.

§Arguments
  • uplo_ Indicates whether the upper or lower triangular part is used.

    See Uplo

  • n_ Dimension of the symmetric input matrix.

  • a_ Input matrix A.

  • w_ Array of length at least n containing the eigenvalues of A.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.syevd

source

pub fn syrk( &self, uplo_: i32, trans_: i32, n_: i32, k_: i32, alpha_: f64, a_: &[f64], beta_: f64, c_: &mut [f64] ) -> Result<(), String>

Performs a rank-k update of a symmetric matrix.

§Arguments
  • uplo_ Indicates whether the upper or lower triangular part of C is used.

    See Uplo

  • trans_ Indicates whether the matrix A must be transposed.

    See Transpose

  • n_ Specifies the order of C.

  • k_ Indicates the number of rows or columns of A, and its rank.

  • alpha_ A scalar value multiplying the result of the matrix multiplication.

  • a_ The pointer to the array storing matrix A in a column-major format.

  • beta_ A scalar value that multiplies C.

  • c_ The pointer to the array storing matrix C in a column-major format.

Full documentation: https://docs.mosek.com/latest/capi/alphabetic-functionalities.html#mosek.env.syrk

Trait Implementations§

source§

impl Drop for Env

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

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.