Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
matrix_chain_example.cc File Reference

Illustrated examples for matrix-chain optimization. More...

#include <iostream>
#include <iomanip>
#include <Matrix_Chain.H>
#include <print_rule.H>
Include dependency graph for matrix_chain_example.cc:

Go to the source code of this file.

Functions

int main ()
 Example driver demonstrating matrix-chain dynamic programming routines.
 

Detailed Description

Illustrated examples for matrix-chain optimization.

Definition in file matrix_chain_example.cc.

Function Documentation

◆ main()

int main ( )

Example driver demonstrating matrix-chain dynamic programming routines.

Runs several predefined scenarios (CLRS reference chain, two-matrix case, a highly asymmetric three-matrix case, uniform square matrices, and a cost-only helper), prints matrix dimensions, minimum multiplication costs, and optimal parenthesizations to stdout.

Returns
int Exit status (0 on success).

Definition at line 105 of file matrix_chain_example.cc.

References Aleph::divide_and_conquer_partition_dp(), Aleph::matrix_chain_min_cost(), and Aleph::print_rule().