Skip to main content

descent/
lib.rs

1// Copyright 2018 Paul Scott
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9#![feature(test)] // enable benchmarking
10
11//! Modelling interface to non-linear constrained optimisation.
12//!
13//! This module exposes more than the typical user will want to use (so that
14//! other crates such as the `descent_ipopt` crate can interface to it). The
15//! most relevant parts of this module are:
16//!
17//! - [Model](model/trait.Model.html) trait that solvers implement.
18//! - [Var](expr/struct.Var.html) type that represents a model variable.
19//! - [Par](expr/struct.Var.html) type that represents a model parameter.
20//! - [Expression](expr/enum.Expression.html) most general type of expression for
21//!   modelling constraints and objectives.
22//! - [Solution](model/struct.Solution.html) type that stores and enables access
23//!   to a solution.
24//!
25//! If you have nightly rust available, then the "fixed" form expressions that
26//! have their first and second derivatives generated by a procedural macro is
27//! the most performant approach to writing expressions. See the
28//! [fixed](expr/fixed/index.html) sub-module.
29//!
30//! For greater runtime flexibility in constructing of expressions, use the
31//! "dynamic" expressions instead in the [dynam](expr/dynam/index.html)
32//! sub-module.
33//!
34//! Both types of expression can be used with the same model but not in the same
35//! objective value or constriant.
36//!
37//! To get started writing and solving non-linear programs with IPOPT, go
38//! straight to the examples in the `descent_ipopt` crate.
39
40pub mod expr;
41pub mod model;