ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
MatrixChain.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*--------------------------- File MatrixChain.h ---------------------------*/
3/*--------------------------------------------------------------------------*/
37/*--------------------------------------------------------------------------*/
38/*----------------------------- DEFINITIONS --------------------------------*/
39/*--------------------------------------------------------------------------*/
40
41#ifndef __ADS_MatrixChain
42 #define __ADS_MatrixChain
43/* self-identification: #endif constant */
44
45/*--------------------------------------------------------------------------*/
46/*------------------------------ INCLUDES ----------------------------------*/
47/*--------------------------------------------------------------------------*/
48
49#include "ADS/Contract.h"
50
51#include <algorithm>
52#include <cstddef>
53#include <limits>
54#include <string>
55#include <utility>
56#include <vector>
57
58/*--------------------------------------------------------------------------*/
59/*--------------------------- NAMESPACE ------------------------------------*/
60/*--------------------------------------------------------------------------*/
61
62namespace ADS
63{
64
88inline std::pair< long , std::vector< std::vector< std::size_t > > >
89matrixChain( const std::vector< long > & c );
90
105inline std::string
106parenthesization( const std::vector< std::vector< std::size_t > > & S ,
107 std::size_t i , std::size_t j );
108
109/*--------------------------------------------------------------------------*/
110
111} // end( namespace ADS )
112
113/*--------------------------------------------------------------------------*/
114/*-------------------------- IMPLEMENTATION --------------------------------*/
115/*--------------------------------------------------------------------------*/
116
117#include "ADS/numeric/impl/MatrixChain.tpp"
118
119/*--------------------------------------------------------------------------*/
120
121#endif /* MatrixChain.h included */
122
123/*--------------------------------------------------------------------------*/
124/*------------------------- End File MatrixChain.h -------------------------*/
125/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::pair< long, std::vector< std::vector< std::size_t > > > matrixChain(const std::vector< long > &c)
the least cost and the table of the splits, for the matrices of sizes (the parentesizzazione() of...
std::string parenthesization(const std::vector< std::vector< std::size_t > > &S, std::size_t i, std::size_t j)
the parenthesization of by the splits , e.g., ((A0·A1)·A2) (the stampaPar() of the book)
Definition ADT.h:96