@@ -33,32 +33,32 @@ class QgsGraphAnalyzer
33
33
%End
34
34
35
35
%MethodCode
36
- QVector< int > treeResult;
37
- QVector< double > costResult;
38
- QgsGraphAnalyzer::dijkstra( a0, a1, a2, &treeResult, &costResult );
36
+ QVector< int > treeResult;
37
+ QVector< double > costResult;
38
+ QgsGraphAnalyzer::dijkstra( a0, a1, a2, &treeResult, &costResult );
39
39
40
- PyObject *l1 = PyList_New( treeResult.size() );
41
- if ( l1 == NULL )
42
- {
43
- return NULL;
44
- }
45
- PyObject *l2 = PyList_New( costResult.size() );
46
- if ( l2 == NULL )
47
- {
48
- return NULL;
49
- }
50
- int i;
51
- for ( i = 0; i < costResult.size(); ++i )
52
- {
53
- PyObject *Int = PyLong_FromLong( treeResult[i] );
54
- PyList_SET_ITEM( l1, i, Int );
55
- PyObject *Float = PyFloat_FromDouble( costResult[i] );
56
- PyList_SET_ITEM( l2, i, Float );
57
- }
40
+ PyObject *l1 = PyList_New( treeResult.size() );
41
+ if ( l1 == NULL )
42
+ {
43
+ return NULL;
44
+ }
45
+ PyObject *l2 = PyList_New( costResult.size() );
46
+ if ( l2 == NULL )
47
+ {
48
+ return NULL;
49
+ }
50
+ int i;
51
+ for ( i = 0; i < costResult.size(); ++i )
52
+ {
53
+ PyObject *Int = PyLong_FromLong( treeResult[i] );
54
+ PyList_SET_ITEM( l1, i, Int );
55
+ PyObject *Float = PyFloat_FromDouble( costResult[i] );
56
+ PyList_SET_ITEM( l2, i, Float );
57
+ }
58
58
59
- sipRes = PyTuple_New( 2 );
60
- PyTuple_SET_ITEM( sipRes, 0, l1 );
61
- PyTuple_SET_ITEM( sipRes, 1, l2 );
59
+ sipRes = PyTuple_New( 2 );
60
+ PyTuple_SET_ITEM( sipRes, 0, l1 );
61
+ PyTuple_SET_ITEM( sipRes, 1, l2 );
62
62
%End
63
63
64
64
static QgsGraph *shortestTree( const QgsGraph *source, int startVertexIdx, int criterionNum );
0 commit comments