Skip to main content
Ctrl+K
    AMPL Resources
  • AMPL.com
  • AMPL Support Forum
  • AMPL Download Portal
  • AMPL Development Resources
  • AMPL + Python 🐍
  • AMPL on Streamlit Cloud
  • Hands-On Optimization in Python
  • AMPL Model Colaboratory
  • amplpy: Python API
  • More Resources
  • AMPL Books
  • MP: Solver Interface Framework
  • AMPL’s Open-Source Projects
  • Licenses & Pricing
  • AMPL & Solvers pricing
  • Free Academic Licenses
  • Free AMPL Community Edition
  • Social Media
  • LinkedIn
AMPL API 3.0.0 documentation - Home AMPL API 3.0.0 documentation - Home C++ API
  • Introduction
  • Initial Setup
  • Quick Start
  • Class structure
  • C++ API Reference
  • C++ API Examples
  • AMPL APIs
  • AMPL Support Forum
  • AMPL Portal
  • AMPL Homepage
  • AMPL Resources
  • Introduction
  • Initial Setup
  • Quick Start
  • Class structure
  • C++ API Reference
  • C++ API Examples
  • AMPL APIs
  • AMPL Support Forum
  • AMPL Portal
  • AMPL Homepage
  • AMPL Resources
Ctrl+K
AMPL Python Ecosystem AMPL Python Ecosystem AMPL Model Colaboratory
Hands-On Mathematical Optimization with AMPL in Python

Follow us on LinkedIn!

AMPL C++ API#

Contents#

  • Introduction
    • What are AMPL APIs?
    • Who can use AMPL APIs?
    • System requirements
    • About this manual
  • Initial Setup
    • Installation
    • Initial test
    • Development
    • Deployment
  • Quick Start
    • Complete listing
    • Needed headers and AMPL environment creation
    • Load a model from file
    • Solve a problem
    • Get an AMPL entity in the programming environment (get objective value)
    • Modify model data (assign values to parameters)
    • Get numeric values from variables
    • Get arbitrary values via ampl expressions
    • Delete the AMPL object to free the resources
  • Class structure
    • AMPL class
    • Modelling entities classes
    • Relation between entities and data
    • Note on variables suffixes
  • C++ API Reference
    • AMPL classes
    • Algebraic entities classes
    • Exceptions
  • C++ API Examples
    • Example 1: First steps
    • Example 2: Get and set AMPL options
    • Example 3: Get and set data through DataFrames
    • Example 4: Operate with multidimensional data
    • Example 5: Assign all data to a model and solve it
    • Example 6: Build an efficient frontier
    • Example 7: Simple heuristic

next

Introduction

On this page
  • Contents

© Copyright 2013-2026, AMPL Optimization Inc.