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
impl Env
sourcepub fn new_mem_debug(dbgfile: &str) -> Option<Env>
pub fn new_mem_debug(dbgfile: &str) -> Option<Env>
Create a new environment, specifying an output file used for writing memory debugging information.
sourcepub fn task_with_capacity(&self, numcon: i32, numvar: i32) -> Option<Task>
pub fn task_with_capacity(&self, numcon: i32, numvar: i32) -> Option<Task>
Create a new task in this environment with pre-defined capacities.
sourcepub fn axpy(
&self,
n_: i32,
alpha_: f64,
x_: &[f64],
y_: &mut [f64]
) -> Result<(), String>
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
sourcepub fn check_in_all(&mut self) -> Result<(), String>
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
sourcepub fn check_in_license(&mut self, feature_: i32) -> Result<(), String>
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
sourcepub fn check_out_license(&mut self, feature_: i32) -> Result<(), String>
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
sourcepub fn check_version(
&self,
major_: i32,
minor_: i32,
revision_: i32
) -> Result<(), String>
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
sourcepub 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>
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
sourcepub fn dot(
&self,
n_: i32,
x_: &[f64],
y_: &[f64],
xty_: &mut f64
) -> Result<(), String>
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
sourcepub fn echo_intro(&self, longver_: i32) -> Result<(), String>
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
sourcepub fn enable_gar_col_env(&mut self) -> Result<(), String>
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
sourcepub fn expirylicenses(&mut self, expiry_: &mut i64) -> Result<(), String>
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
sourcepub 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>
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
sourcepub fn gemv(
&self,
transa_: i32,
m_: i32,
n_: i32,
alpha_: f64,
a_: &[f64],
x_: &[f64],
beta_: f64,
y_: &mut [f64]
) -> Result<(), String>
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
sourcepub fn link_file_to_stream(
&mut self,
whichstream_: i32,
filename_: &str,
append_: i32
) -> Result<(), String>
pub fn link_file_to_stream( &mut self, whichstream_: i32, filename_: &str, append_: i32 ) -> Result<(), String>
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
sourcepub fn optimize_batch(
&self,
israce_: bool,
maxtime_: f64,
numthreads_: i32,
task_: &[&mut Task],
trmcode_: &mut [i32],
rcode_: &mut [i32]
) -> Result<(), String>
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
sourcepub fn potrf(&self, uplo_: i32, n_: i32, a_: &mut [f64]) -> Result<(), String>
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
sourcepub fn put_license_code(&mut self, code_: &[i32]) -> Result<(), String>
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
sourcepub fn put_license_debug(&mut self, licdebug_: i32) -> Result<(), String>
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
sourcepub fn put_license_path(&mut self, licensepath_: &str) -> Result<(), String>
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
sourcepub fn put_license_wait(&mut self, licwait_: i32) -> Result<(), String>
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
sourcepub fn reset_expiry_licenses(&mut self) -> Result<(), String>
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
sourcepub fn sparse_triangular_solve_dense(
&self,
transposed_: i32,
lnzc_: &[i32],
lptrc_: &[i64],
lsubc_: &[i32],
lvalc_: &[f64],
b_: &mut [f64]
) -> Result<(), String>
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
sourcepub fn syeig(
&self,
uplo_: i32,
n_: i32,
a_: &[f64],
w_: &mut [f64]
) -> Result<(), String>
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
sourcepub fn syevd(
&self,
uplo_: i32,
n_: i32,
a_: &mut [f64],
w_: &mut [f64]
) -> Result<(), String>
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
sourcepub fn syrk(
&self,
uplo_: i32,
trans_: i32,
n_: i32,
k_: i32,
alpha_: f64,
a_: &[f64],
beta_: f64,
c_: &mut [f64]
) -> Result<(), String>
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