ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
GridPaths.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*---------------------------- File GridPaths.h ----------------------------*/
3/*--------------------------------------------------------------------------*/
42/*--------------------------------------------------------------------------*/
43/*----------------------------- DEFINITIONS --------------------------------*/
44/*--------------------------------------------------------------------------*/
45
46#ifndef __ADS_GridPaths
47 #define __ADS_GridPaths
48/* self-identification: #endif constant */
49
50/*--------------------------------------------------------------------------*/
51/*------------------------------ INCLUDES ----------------------------------*/
52/*--------------------------------------------------------------------------*/
53
54#include "ADS/Contract.h"
55
56#include <algorithm>
57#include <cstddef>
58#include <cstdint>
59#include <vector>
60
61/*--------------------------------------------------------------------------*/
62/*--------------------------- NAMESPACE ------------------------------------*/
63/*--------------------------------------------------------------------------*/
64
65namespace ADS
66{
67
70{
71 std::size_t side = 0;
72 std::size_t row = 0;
73 std::size_t col = 0;
74 };
75
104template< class T >
105GridSquare largestSquare( const std::vector< std::vector< T > > & A );
106
129template< class C = std::uint64_t , class T >
130C countLatticePaths( const std::vector< std::vector< T > > & B );
131
132/*--------------------------------------------------------------------------*/
133
134} // end( namespace ADS )
135
136/*--------------------------------------------------------------------------*/
137/*-------------------------- IMPLEMENTATION --------------------------------*/
138/*--------------------------------------------------------------------------*/
139
140#include "ADS/optimization/impl/GridPaths.tpp"
141
142/*--------------------------------------------------------------------------*/
143
144#endif /* GridPaths.h included */
145
146/*--------------------------------------------------------------------------*/
147/*-------------------------- End File GridPaths.h --------------------------*/
148/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
C countLatticePaths(const std::vector< std::vector< T > > &B)
the number of the paths from the upper left to the lower right cell of , each step right or down,...
GridSquare largestSquare(const std::vector< std::vector< T > > &A)
the largest square of nonzero cells of , the first in the order of the rows of its lower right cell
Definition ADT.h:96
a square of a matrix: its side and its upper left cell
Definition GridPaths.h:70
std::size_t row
the row of the upper left cell
Definition GridPaths.h:72
std::size_t col
the column of the upper left cell
Definition GridPaths.h:73
std::size_t side
the side, 0 for none
Definition GridPaths.h:71