1 
/* 
2 
* Copyright 20082009 NVIDIA Corporation 
3 
* 
4 
* Licensed under the Apache License, Version 2.0 (the "License"); 
5 
* you may not use this file except in compliance with the License. 
6 
* You may obtain a copy of the License at 
7 
* 
8 
* http://www.apache.org/licenses/LICENSE2.0 
9 
* 
10 
* Unless required by applicable law or agreed to in writing, software 
11 
* distributed under the License is distributed on an "AS IS" BASIS, 
12 
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13 
* See the License for the specific language governing permissions and 
14 
* limitations under the License. 
15 
*/ 
16 

17 
/*! \file connected_components.h 
18 
* \brief Compute the connected components of a graph 
19 
*/ 
20 

21 
#pragma once 
22 

23 
#include <cusp/detail/config.h> 
24 

25 
namespace cusp 
26 
{ 
27 
namespace graph 
28 
{ 
29 
/*! \addtogroup algorithms Algorithms 
30 
* \ingroup algorithms 
31 
* \{ 
32 
*/ 
33 

34 
/*! \p connected_components : Computes the connected components of a graph 
35 
* 
36 
* \param A symmetric matrix that represents a graph 
37 
* \param component each vertex is connected to 
38 
* 
39 
* \tparam Matrix matrix 
40 
* \tparam Array array 
41 
* 
42 
* \see http://en.wikipedia.org/wiki/Connected_component_(graph_theory) 
43 
*/ 
44 
template<typename MatrixType, typename ArrayType> 
45 
size_t connected_components(const MatrixType& G, ArrayType& components); 
46 

47 
/*! \} 
48 
*/ 
49 

50 

51 
} // end namespace graph 
52 
} // end namespace cusp 
53 

54 
#include <cusp/graph/detail/connected_components.inl> 
55 
