amplrs 0.1.5

Safe Rust API for AMPL optimization modeling system
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::ffi;

/// A tuple of AMPL variants used to index into multi-dimensional entities.
///
/// Tuples are produced by the AMPL engine (e.g. when iterating instances) and
/// are passed back to API calls that require an instance index.
pub struct Tuple {
    pub raw: *mut ffi::AMPL_TUPLE,
}

impl Tuple {
    /// Wrap an existing raw AMPL tuple pointer. The caller retains ownership.
    pub fn new(raw: *mut ffi::AMPL_TUPLE) -> Self {
        Tuple { raw: raw }
    }
}