Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by crazy ( 16 years ago )
/*
-----------------------------------------------------------------------------
This source file is part of OSTIS (Open Semantic Technology for Intelligent Systems)
For the latest info, see http://www.ostis.net

Copyright (c) 2010 OSTIS

OSTIS is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

OSTIS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with OSTIS.  If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------------
*/

#include "scp_keynodes.scsy"
#include "wave_find_path_keynodes.scsy"

//
// Процедура поиска числа вершинной связности
//
// @author Vladislav Krasovsky
//
procedure(vertex_test,
[[

 vertex_, edge_;
 "path*";
]], 
[{
 graph,
 arc,arc1,temp_arc,  //временные дуги
 temp_vertex,
 vertex1,vertex2,  //временные вершины
 descr,                 // дескриптор для ожидания завершения выполнения параллельного процесса
 vertexes,              //множество вершин
 edge_iter_arc,
 cur_vertex,
 edges,
 cur_edge,
 count_vertex_connectives,
 checked_vertexes // _непросмотренные вершины
}],
[{
 1_:  in_: graph,   //_gi
 2_:  in_: vertex1,     // _vertex
 3_:  in_: checked_vertexes,
 4_: out_: count_vertex_connectives,   // _conn
 5_: out_: checked_vertexes   // _conn
}])

// Формируем множество ребер
searchSetStr5([
    1_:  fixed_: graph,
    2_: assign_: const_: pos_: arc,
    3_: assign_: temp_vertex,
 4_: assign_: const_: pos_: arc1,
 5_:  fixed_: edge_,
    set3_: assign_: edges
],, return_label)

// Производим итерацию по ребрам
label(iter_next_edge)
searchElStr3([
    1_:  fixed_: edges,
    2_: assign_: edge_iter_arc,
    3_: assign_: cur_edge
],, iter_end_edge)

//ищем конструкцию с нашей вершиной
searchElStr3([
    1_:  fixed_: cur_edge,
    2_: assign_: arc,
    3_: fixed_: vertex1
],, iter_end_edge)

//ищем вторую вершину
searchElStr3([
    1_:  fixed_: cur_edge,
    2_: assign_: arc,
    3_: assign_: vertex2
],, iter_end_edge)

//проверяем эту вершину в списке проверенных вершин
searchElStr3([
    1_:  fixed_: checked_vertexes,
    2_: assign_: arc,
    3_: fixed_: vertex2
],iter_next_edge,)

callReturn([
 1_: fixed_: vertex_test, 
 2_: {[1_: graph, 2_: vertex2, 3_:checked_vertexes,  4_: count_vertex_connectives , 5_:checked_vertexes]}], descr)

label(iter_end_edge)
// удаляем из памяти множество ребер
eraseEl([1_: fixed_: f_: edges])

label(return_label)
return()

end

 

Revise this Paste

Your Name: Code Language: