Skip to content

Commit

Permalink
Make functions inline
Browse files Browse the repository at this point in the history
Since the function definitions might appear across multiple translation
units, they should be defined inline.
  • Loading branch information
cartoonist committed May 1, 2023
1 parent c50ef8c commit 3b68bef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/pairg/heuristics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace pairg
* the target vertex
* @return boolean value (true if reached, false if not)
*/
bool queryReachabilityBFS(const matrixOps::crsMat_t &A, int d_up, matrixOps::lno_t src, matrixOps::lno_t target)
inline bool queryReachabilityBFS(const matrixOps::crsMat_t &A, int d_up, matrixOps::lno_t src, matrixOps::lno_t target)
{
if (src >= A.numRows() || target >= A.numCols()) {
std::cout << "WARNING, pairg::matrixOps::queryValue, query index out of range" << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions include/pairg/reachability.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace pairg
* @brief build adjacency matrix from variaton graph
*/
template< class TCharGraph >
matrixOps::crsMat_t getAdjacencyMatrix(const TCharGraph &cg)
inline matrixOps::crsMat_t getAdjacencyMatrix(const TCharGraph &cg)
{
typename matrixOps::lno_t nrows = cg.numVertices;
typename matrixOps::size_type nnz = cg.numEdges;
Expand Down Expand Up @@ -47,7 +47,7 @@ namespace pairg
* @return validity matrix
* cell (i,j) = 1 iff there is a valid path from v_i to v_j
*/
matrixOps::crsMat_t buildValidPairsMatrix(const matrixOps::crsMat_t &A, int d_low, int d_up)
inline matrixOps::crsMat_t buildValidPairsMatrix(const matrixOps::crsMat_t &A, int d_low, int d_up)
{
pairg::timer T1;
matrixOps::crsMat_t B = matrixOps::addMatrices(A, matrixOps::createIdentityMatrix(A.numRows()));
Expand Down

0 comments on commit 3b68bef

Please sign in to comment.