# More Samples

## CBC's Samples Directory

The CBC distribution includes a number of `.cpp` sample files. Users are encouraged to use them as starting points for their own CBC projects. The files can be found in the `&cbcsamplesdir;` directory. For the latest information on compiling and running these samples, please see the file `&cbcsamplesdir;INSTALL`. Most of them can be built by

    make DRIVER=name

which produces an executable `testit`. Below is a list of some of the most useful sample files with a short description for each file.

## Basic Samples

Source file | Description
&minimumcpp; | This is a CBC "Hello, world" program. It reads a problem in MPS file format, and solves the problem using simple branch-and-bound.
&sample2cpp; | This is designed to be a file that a user could modify to get a useful driver program for his or her project. In particular, it demonstrates the use of CGL's preprocess functionality. It uses `CbcBranchUser.cpp`, `CbcCompareUser.cpp` and `CbcHeuristicUser.cpp` with corresponding `*.hpp` files.

## Advanced Samples

Source file | Description
&crewcpp; | This sample shows the use of advanced branching and a use of priorities. It uses `CbcCompareUser.cpp` with corresponding `*.hpp` files.
&longthincpp; | This sample shows the advanced use of a solver. It also has coding for a greedy heuristic. The solver is given in `CbcSolver2.hpp` and `CbcSolver2.cpp`. The heuristic is given in `CbcHeuristicGreedy.hpp` and `CbcHeuristicGreedy.cpp`. It uses `CbcBranchUser.cpp` and `CbcCompareUser.cpp` with corresponding `*.hpp` files.
&qmipcpp; | This solves a quadratic MIP. It is to show advanced use of a solver. The solver is given in `ClpQuadInterface.hpp` and `ClpQuadInterface.cpp`. It uses `CbcBranchUser.cpp` and `CbcCompareUser.cpp` with corresponding `*.hpp` files.
&soscpp; | This artificially creates a Special Ordered Set problem.
&lotsizecpp; | This artificially creates a Lot Sizing problem.