ADS
Algorithms and Data Structures
Toggle main menu visibility
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
65
namespace
ADS
66
{
67
69
struct
GridSquare
70
{
71
std::size_t
side
= 0;
72
std::size_t
row
= 0;
73
std::size_t
col
= 0;
74
};
75
104
template
<
class
T >
105
GridSquare
largestSquare
(
const
std::vector< std::vector< T > > & A );
106
129
template
<
class
C = std::u
int
64_t ,
class
T >
130
C
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
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::countLatticePaths
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,...
ADS::largestSquare
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
ADS
Definition
ADT.h:96
ADS::GridSquare
a square of a matrix: its side and its upper left cell
Definition
GridPaths.h:70
ADS::GridSquare::row
std::size_t row
the row of the upper left cell
Definition
GridPaths.h:72
ADS::GridSquare::col
std::size_t col
the column of the upper left cell
Definition
GridPaths.h:73
ADS::GridSquare::side
std::size_t side
the side, 0 for none
Definition
GridPaths.h:71
ADS
optimization
GridPaths.h
Generated by
1.17.0