Участник:VolkovNikita94: различия между версиями

Материал из Алговики
Перейти к навигации Перейти к поиску
(Исправление описания примеров визуализации. Добавлены XML файлы и исходники. Часть XML-файлов не откорректирована, части исходников не хват.)
(Удалил разделы, перенесенные в обсуждение.)
 
(не показаны 22 промежуточные версии этого же участника)
Строка 4: Строка 4:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_001/Example_001.html
 
|url=XML_example_001/Example_001.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 10: Строка 10:
 
<br>
 
<br>
 
Чисто последовательная структура в 2D-представлении (последовательное суммирование)
 
Чисто последовательная структура в 2D-представлении (последовательное суммирование)
 +
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
C++ реализация:
 +
<div class="mw-collapsible-content">
 
<source lang = "c++">
 
<source lang = "c++">
 
int seqSum(const std::vector<int>& _src)
 
int seqSum(const std::vector<int>& _src)
Строка 21: Строка 25:
 
}
 
}
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Кодировка в XML:
 +
<div class="mw-collapsible-content">
 
<source lang = "xml">
 
<source lang = "xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 90: Строка 100:
 
</algograph>
 
</algograph>
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "2">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
 +
<vertex condition = "(j == 1)" type = "0">
 +
<in src = “i – 1, N”></in>
 +
</vertex>
 +
<vertex condition = "(j > 1)" type = "0">
 +
<in src = “i, j - 1”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 95: Строка 130:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_002/Example_002.html
 
|url=XML_example_002/Example_002.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 101: Строка 136:
 
<br>
 
<br>
 
Набор одномерных последовательных структур, независимых между собой - 2D вариант
 
Набор одномерных последовательных структур, независимых между собой - 2D вариант
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
C++ реализация:
 +
<div class="mw-collapsible-content">
 
<source lang = "c++">
 
<source lang = "c++">
 
void seqParSum(const std::vector<std::vector<int> >& _src, std::vector<int>& _res)
 
void seqParSum(const std::vector<std::vector<int> >& _src, std::vector<int>& _res)
Строка 117: Строка 155:
 
}
 
}
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Кодировка в XML:
 +
<div class="mw-collapsible-content">
 
<source lang = "xml">
 
<source lang = "xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 182: Строка 225:
 
</algograph>
 
</algograph>
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "2">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
 +
<vertex condition = "" type = "0">
 +
<in src = “i, j - 1”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 187: Строка 252:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_003/Example_003.html
 
|url=XML_example_003/Example_003.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 193: Строка 258:
 
<br>
 
<br>
 
Двумерная структура со скошенным параллелизмом
 
Двумерная структура со скошенным параллелизмом
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
C++ реализация:
 +
<div class="mw-collapsible-content">
 +
<source lang = "c++">
 +
int accumSum(int** _src, int _nCol, int _nRow)
 +
{
 +
  for (int rowId = 0; rowId < _nRow; ++rowId)
 +
  {
 +
      for (int colId = 0; colId < _nCol; ++colId)
 +
      {
 +
        _src[rowId][colId] += _src[rowId][colId == 0 ? colId : colId - 1];
 +
        _src[rowId][colId] += _src[rowId == 0 ? rowId : rowId - 1][colId];
 +
      }
 +
  }
 +
  return _src[_nRow - 1][_nCol - 1];
 +
}
 +
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Кодировка в XML:
 +
<div class="mw-collapsible-content">
 
<source lang = "xml">
 
<source lang = "xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<algograph version="0.0.1">
 
<algograph version="0.0.1">
<algorithm num_ext_params="1" num_groups="2">
+
  <algorithm num_ext_params="1" num_groups="2">
<ext_param name="n"/>
+
      <ext_param name="n"/>
<group id="0" num_or_parts="1" num_oper="1">
+
      <group id="0" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="1">
+
        <or_part id="0" num_and_parts="1">
<and_part id="0"><![CDATA[]]></and_part>
+
            <and_part id="0"><![CDATA[]]></and_part>
<statement id="0" num_inputs="1">
+
            <statement id="0" num_inputs="1">
<input id="0" num_solutions="0"/>
+
              <input id="0" num_solutions="0"/>
</statement>
+
            </statement>
</or_part>
+
        </or_part>
</group>
+
      </group>
<loop>
+
      <loop>
<loop>
+
        <loop>
<group id="1" num_or_parts="1" num_oper="1">
+
            <group id="1" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="4">
+
              <or_part id="0" num_and_parts="4">
<and_part id="0"><![CDATA[-i1<=-1]]></and_part>
+
                  <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
<and_part id="1"><![CDATA[i1<=n]]></and_part>
+
                  <and_part id="1"><![CDATA[i1<=n]]></and_part>
<and_part id="2"><![CDATA[-i2<=-1]]></and_part>
+
                  <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
<and_part id="3"><![CDATA[i2<=n]]></and_part>
+
                  <and_part id="3"><![CDATA[i2<=n]]></and_part>
<statement id="0" num_inputs="3">
+
                  <statement id="0" num_inputs="3">
<input id="0" num_solutions="0"/>
+
                    <input id="0" num_solutions="0"/>
<input id="1" num_solutions="3">
+
                    <input id="1" num_solutions="3">
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
+
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[i2-n<=0]]></condition>
+
                              <condition><![CDATA[i2-n<=0]]></condition>
<condition><![CDATA[-n+2<=0]]></condition>
+
                              <condition><![CDATA[-n+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                              <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i2+2<=0]]></condition>
+
                              <condition><![CDATA[-i2+2<=0]]></condition>
</altarea>
+
                          </altarea>
<dependency>
+
                          <dependency>
<coordinate><![CDATA[i1]]></coordinate>
+
                              <coordinate><![CDATA[i1]]></coordinate>
<coordinate><![CDATA[i2-1]]></coordinate>
+
                              <coordinate><![CDATA[i2-1]]></coordinate>
</dependency>
+
                          </dependency>
</solution>
+
                        </solution>
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
+
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[i2-n<=0]]></condition>
+
                              <condition><![CDATA[i2-n<=0]]></condition>
<condition><![CDATA[-n+2<=0]]></condition>
+
                              <condition><![CDATA[-n+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[-i1+2<=0]]></condition>
+
                              <condition><![CDATA[-i1+2<=0]]></condition>
<condition><![CDATA[-i2+1<=0]]></condition>
+
                              <condition><![CDATA[-i2+1<=0]]></condition>
</altarea>
+
                          </altarea>
<dependency>
+
                          <dependency>
<coordinate><![CDATA[i1-1]]></coordinate>
+
                              <coordinate><![CDATA[i1-1]]></coordinate>
<coordinate><![CDATA[i2]]></coordinate>
+
                              <coordinate><![CDATA[i2]]></coordinate>
</dependency>
+
                          </dependency>
</solution>
+
                        </solution>
<solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
+
                        <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[-n+1<=0]]></condition>
+
                              <condition><![CDATA[-n+1<=0]]></condition>
<condition><![CDATA[-i2+1<=0]]></condition>
+
                              <condition><![CDATA[-i2+1<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                              <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[i2-1<=0]]></condition>
+
                              <condition><![CDATA[i2-1<=0]]></condition>
<condition><![CDATA[i1-1<=0]]></condition>
+
                              <condition><![CDATA[i1-1<=0]]></condition>
</altarea>
+
                          </altarea>
</solution>
+
                        </solution>
</input>
+
                    </input>
<input id="2" num_solutions="0"/>
+
                    <input id="2" num_solutions="0"/>
</statement>
+
                  </statement>
</or_part>
+
              </or_part>
</group>
+
            </group>
</loop>
+
        </loop>
</loop>
+
      </loop>
</algorithm>
+
  </algorithm>
 
</algograph>
 
</algograph>
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "2">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
 +
<vertex condition = "" type = "0">
 +
<in src = “i, j - 1”></in>
 +
<in src = “i - 1, j”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 267: Строка 377:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_004/Example_004.html
 
|url=XML_example_004/Example_004.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 273: Строка 383:
 
<br>
 
<br>
 
Двумерная структура со скошенным параллелизмом и скошенной передачей данных
 
Двумерная структура со скошенным параллелизмом и скошенной передачей данных
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
C++ реализация:
 +
<div class="mw-collapsible-content">
 +
<source lang = "c++">
 +
int accumSum(int** _src, int _nCol, int _nRow)
 +
{
 +
  for (int rowId = 0; rowId < _nRow; ++rowId)
 +
  {
 +
      for (int colId = 0; colId < _nCol; ++colId)
 +
      {
 +
        _src[rowId][colId] += _src[(rowId == 0 && colId < 2) ? rowId : rowId - 1][(rowId != 0 && colId > 1) ? colId : colId - 2];
 +
        _src[rowId][colId] += _src[rowId == 0 ? rowId : rowId - 1][colId];
 +
      }
 +
  }
 +
  return _src[_nRow - 1][_nCol - 1];
 +
}
 +
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Кодировка в XML:
 +
<div class="mw-collapsible-content">
 
<source lang = "xml">
 
<source lang = "xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<algograph version="0.0.1">
 
<algograph version="0.0.1">
<algorithm num_ext_params="1" num_groups="2">
+
  <algorithm num_ext_params="1" num_groups="2">
<ext_param name="n"/>
+
      <ext_param name="n"/>
<group id="0" num_or_parts="1" num_oper="1">
+
      <group id="0" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="1">
+
        <or_part id="0" num_and_parts="1">
<and_part id="0"><![CDATA[]]></and_part>
+
            <and_part id="0"><![CDATA[]]></and_part>
<statement id="0" num_inputs="1">
+
            <statement id="0" num_inputs="1">
<input id="0" num_solutions="0"/>
+
              <input id="0" num_solutions="0"/>
</statement>
+
            </statement>
</or_part>
+
        </or_part>
</group>
+
      </group>
<loop>
+
      <loop>
<loop>
+
        <loop>
<group id="1" num_or_parts="1" num_oper="1">
+
            <group id="1" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="4">
+
              <or_part id="0" num_and_parts="4">
<and_part id="0"><![CDATA[-i1<=-1]]></and_part>
+
                  <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
<and_part id="1"><![CDATA[i1<=n]]></and_part>
+
                  <and_part id="1"><![CDATA[i1<=n]]></and_part>
<and_part id="2"><![CDATA[-i2<=-1]]></and_part>
+
                  <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
<and_part id="3"><![CDATA[i2<=n]]></and_part>
+
                  <and_part id="3"><![CDATA[i2<=n]]></and_part>
<statement id="0" num_inputs="3">
+
                  <statement id="0" num_inputs="3">
<input id="0" num_solutions="0"/>
+
                    <input id="0" num_solutions="0"/>
<input id="1" num_solutions="3">
+
                    <input id="1" num_solutions="3">
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
+
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[i2-n<=0]]></condition>
+
                              <condition><![CDATA[i2-n<=0]]></condition>
<condition><![CDATA[-n+2<=0]]></condition>
+
                              <condition><![CDATA[-n+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                              <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i2+2<=0]]></condition>
+
                              <condition><![CDATA[-i2+2<=0]]></condition>
</altarea>
+
                          </altarea>
<dependency>
+
                          <dependency>
<coordinate><![CDATA[i1]]></coordinate>
+
                              <coordinate><![CDATA[i1]]></coordinate>
<coordinate><![CDATA[i2-1]]></coordinate>
+
                              <coordinate><![CDATA[i2-1]]></coordinate>
</dependency>
+
                          </dependency>
</solution>
+
                        </solution>
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
+
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[i2-n<=0]]></condition>
+
                              <condition><![CDATA[i2-n<=0]]></condition>
<condition><![CDATA[-n+2<=0]]></condition>
+
                              <condition><![CDATA[-n+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[-i1+3<=0]]></condition>
+
                              <condition><![CDATA[-i1+3<=0]]></condition>
<condition><![CDATA[-i2+2<=0]]></condition>
+
                              <condition><![CDATA[-i2+2<=0]]></condition>
</altarea>
+
                          </altarea>
<dependency>
+
                          <dependency>
<coordinate><![CDATA[i1-2]]></coordinate>
+
                              <coordinate><![CDATA[i1-2]]></coordinate>
<coordinate><![CDATA[i2-1]]></coordinate>
+
                              <coordinate><![CDATA[i2-1]]></coordinate>
</dependency>
+
                          </dependency>
</solution>
+
                        </solution>
<solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
+
                        <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[-n+1<=0]]></condition>
+
                              <condition><![CDATA[-n+1<=0]]></condition>
<condition><![CDATA[-i2+1<=0]]></condition>
+
                              <condition><![CDATA[-i2+1<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                              <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[i2-1<=0]]></condition>
+
                              <condition><![CDATA[i2-1<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
</altarea>
+
                          </altarea>
</solution>
+
                        </solution>
</input>
+
                    </input>
<input id="2" num_solutions="0"/>
+
                    <input id="2" num_solutions="0"/>
</statement>
+
                  </statement>
</or_part>
+
              </or_part>
</group>
+
            </group>
</loop>
+
        </loop>
</loop>
+
      </loop>
</algorithm>
+
  </algorithm>
 
</algograph>
 
</algograph>
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "2">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
 +
<vertex condition = "" type = "0">
 +
<in src = “i, j - 1”></in>
 +
<in src = “i - 2, j - 1”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 347: Строка 502:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_005/Example_005.html
 
|url=XML_example_005/Example_005.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 353: Строка 508:
 
<br>
 
<br>
 
Двумерная структура с квадратным параллелизмом и массовыми рассылками по каждому измерению
 
Двумерная структура с квадратным параллелизмом и массовыми рассылками по каждому измерению
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
C++ реализация:
 +
<div class="mw-collapsible-content">
 +
<source lang = "c++">
 +
int accumSum(int** _src, int _nCol, int _nRow)
 +
{
 +
  for (int rowId = 0; rowId < _nRow; ++rowId)
 +
  {
 +
      for (int colId = 0; colId < _nCol; ++colId)
 +
      {
 +
        _src[rowId][colId] += _src[rowId][colId == 0 ? colId : colId - 1];
 +
        _src[rowId][colId] += _src[rowId == 0 ? rowId : rowId - 1][colId];
 +
        _src[rowId][colId] += _src[rowId][0];
 +
        _src[rowId][colId] += _src[0][colId];
 +
      }
 +
  }
 +
  return _src[_nRow - 1][_nCol - 1];
 +
}
 +
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Кодировка в XML:
 +
<div class="mw-collapsible-content">
 
<source lang = "xml">
 
<source lang = "xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<algograph version="0.0.1">
 
<algograph version="0.0.1">
<algorithm num_ext_params="1" num_groups="2">
+
  <algorithm num_ext_params="1" num_groups="2">
<ext_param name="n"/>
+
      <ext_param name="n"/>
<group id="0" num_or_parts="1" num_oper="1">
+
      <group id="0" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="1">
+
        <or_part id="0" num_and_parts="1">
<and_part id="0"><![CDATA[]]></and_part>
+
            <and_part id="0"><![CDATA[]]></and_part>
<statement id="0" num_inputs="1">
+
            <statement id="0" num_inputs="1">
<input id="0" num_solutions="0"/>
+
              <input id="0" num_solutions="0"/>
</statement>
+
            </statement>
</or_part>
+
        </or_part>
</group>
+
      </group>
<loop>
+
      <loop>
<loop>
+
        <loop>
<group id="1" num_or_parts="1" num_oper="1">
+
            <group id="1" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="4">
+
              <or_part id="0" num_and_parts="4">
<and_part id="0"><![CDATA[-i1<=-1]]></and_part>
+
                  <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
<and_part id="1"><![CDATA[i1<=n]]></and_part>
+
                  <and_part id="1"><![CDATA[i1<=n]]></and_part>
<and_part id="2"><![CDATA[-i2<=-1]]></and_part>
+
                  <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
<and_part id="3"><![CDATA[i2<=n]]></and_part>
+
                  <and_part id="3"><![CDATA[i2<=n]]></and_part>
<statement id="0" num_inputs="3">
+
                  <statement id="0" num_inputs="3">
<input id="0" num_solutions="0"/>
+
                    <input id="0" num_solutions="0"/>
<input id="1" num_solutions="5">
+
                    <input id="1" num_solutions="5">
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
+
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[i2-n<=0]]></condition>
+
                              <condition><![CDATA[i2-n<=0]]></condition>
<condition><![CDATA[-n+2<=0]]></condition>
+
                              <condition><![CDATA[-n+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                              <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i2+2<=0]]></condition>
+
                              <condition><![CDATA[-i2+2<=0]]></condition>
</altarea>
+
                          </altarea>
<dependency>
+
                          <dependency>
<coordinate><![CDATA[i1]]></coordinate>
+
                              <coordinate><![CDATA[i1]]></coordinate>
<coordinate><![CDATA[i2-1]]></coordinate>
+
                              <coordinate><![CDATA[i2-1]]></coordinate>
</dependency>
+
                          </dependency>
</solution>
+
                        </solution>
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
+
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[i2-n<=0]]></condition>
+
                              <condition><![CDATA[i2-n<=0]]></condition>
<condition><![CDATA[-n+2<=0]]></condition>
+
                              <condition><![CDATA[-n+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[-i2+1<=0]]></condition>
+
                              <condition><![CDATA[-i2+1<=0]]></condition>
<condition><![CDATA[-i1+2<=0]]></condition>
+
                              <condition><![CDATA[-i1+2<=0]]></condition>
</altarea>
+
                          </altarea>
<dependency>
+
                          <dependency>
<coordinate><![CDATA[i1-1]]></coordinate>
+
                              <coordinate><![CDATA[i1-1]]></coordinate>
<coordinate><![CDATA[i2]]></coordinate>
+
                              <coordinate><![CDATA[i2]]></coordinate>
</dependency>
+
                          </dependency>
</solution>
+
                        </solution>
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
+
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[i2-n<=0]]></condition>
+
                              <condition><![CDATA[i2-n<=0]]></condition>
<condition><![CDATA[-n+2<=0]]></condition>
+
                              <condition><![CDATA[-n+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                              <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i2+3<=0]]></condition>
+
                              <condition><![CDATA[-i2+3<=0]]></condition>
</altarea>
+
                          </altarea>
<dependency>
+
                          <dependency>
<coordinate><![CDATA[i1]]></coordinate>
+
                              <coordinate><![CDATA[i1]]></coordinate>
<coordinate><![CDATA[1]]></coordinate>
+
                              <coordinate><![CDATA[1]]></coordinate>
</dependency>
+
                          </dependency>
</solution>
+
                        </solution>
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
+
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[i2-n<=0]]></condition>
+
                              <condition><![CDATA[i2-n<=0]]></condition>
<condition><![CDATA[-n+2<=0]]></condition>
+
                              <condition><![CDATA[-n+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[-i2+1<=0]]></condition>
+
                              <condition><![CDATA[-i2+1<=0]]></condition>
<condition><![CDATA[-i1+3<=0]]></condition>
+
                              <condition><![CDATA[-i1+3<=0]]></condition>
</altarea>
+
                          </altarea>
<dependency>
+
                          <dependency>
<coordinate><![CDATA[1]]></coordinate>
+
                              <coordinate><![CDATA[1]]></coordinate>
<coordinate><![CDATA[i2]]></coordinate>
+
                              <coordinate><![CDATA[i2]]></coordinate>
</dependency>
+
                          </dependency>
</solution>
+
                        </solution>
<solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
+
                        <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
<altarea num_conditions="5">
+
                          <altarea num_conditions="5">
<condition><![CDATA[-n+1<=0]]></condition>
+
                              <condition><![CDATA[-n+1<=0]]></condition>
<condition><![CDATA[-i2+1<=0]]></condition>
+
                              <condition><![CDATA[-i2+1<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                              <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[i2-1<=0]]></condition>
+
                              <condition><![CDATA[i2-1<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                              <condition><![CDATA[i1-n<=0]]></condition>
</altarea>
+
                          </altarea>
</solution>
+
                        </solution>
</input>
+
                    </input>
<input id="2" num_solutions="0"/>
+
                    <input id="2" num_solutions="0"/>
</statement>
+
                  </statement>
</or_part>
+
              </or_part>
</group>
+
            </group>
</loop>
+
        </loop>
</loop>
+
      </loop>
</algorithm>
+
  </algorithm>
 
</algograph>
 
</algograph>
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "2">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
<vertex condition = "" type = "0">
 +
<in src = “i, j - 1”></in>
 +
<in src = “i - 1, j”></in>
 +
<in src = “1, j”></in>
 +
<in src = “i, 1”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 453: Строка 656:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_006/Example_006.html
 
|url=XML_example_006/Example_006.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 459: Строка 662:
 
<br>
 
<br>
 
Набор независимых последовательно-параллельных 2D-структур с массовой рассылкой данных в каждой
 
Набор независимых последовательно-параллельных 2D-структур с массовой рассылкой данных в каждой
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
C++ реализация:
 +
<div class="mw-collapsible-content">
 +
<source lang = "c++">
 +
void accumSum(int*** _src, int _nCol, int _nRow, int _nLayer)
 +
{
 +
  for (int layerId = 0; layerId < _nLayer; ++layerId)
 +
  {
 +
      for (int rowId = 0; rowId < _nRow; ++rowId)
 +
      {
 +
        for (int colId = 0; colId < _nCol; ++colId)
 +
        {
 +
            _src[layerId][rowId][colId] += _src[layerId][rowId == 0 ? rowId : rowId - 1][colId == 0 ? colId : 0];
 +
            _src[layerId][rowId][colId] += _src[layerId][rowId == 0 ? rowId : rowId - 1][colId];
 +
        }
 +
      } 
 +
  }
 +
}
 +
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Кодировка в XML:
 +
<div class="mw-collapsible-content">
 
<source lang = "xml">
 
<source lang = "xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<algograph version="0.0.1">
 
<algograph version="0.0.1">
<algorithm num_ext_params="2" num_groups="2">
+
  <algorithm num_ext_params="2" num_groups="2">
<ext_param name="n"/>
+
      <ext_param name="n"/>
<ext_param name="m"/>
+
      <ext_param name="m"/>
<group id="0" num_or_parts="1" num_oper="1">
+
        <group id="0" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="1">
+
        <or_part id="0" num_and_parts="1">
<and_part id="0"><![CDATA[]]></and_part>
+
            <and_part id="0"><![CDATA[]]></and_part>
<statement id="0" num_inputs="1">
+
            <statement id="0" num_inputs="1">
<input id="0" num_solutions="0"/>
+
              <input id="0" num_solutions="0"/>
</statement>
+
            </statement>
</or_part>
+
        </or_part>
</group>
+
      </group>
<loop>
+
      <loop>
<loop>
+
        <loop>
<loop>
+
            <loop>
<group id="1" num_or_parts="1" num_oper="1">
+
              <group id="1" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="6">
+
                  <or_part id="0" num_and_parts="6">
<and_part id="0"><![CDATA[-i1<=-1]]></and_part>
+
                    <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
<and_part id="1"><![CDATA[i1<=n]]></and_part>
+
                    <and_part id="1"><![CDATA[i1<=n]]></and_part>
<and_part id="2"><![CDATA[-i2<=-1]]></and_part>
+
                    <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
<and_part id="3"><![CDATA[i2<=m]]></and_part>
+
                    <and_part id="3"><![CDATA[i2<=m]]></and_part>
<and_part id="4"><![CDATA[i3>=0]]></and_part>
+
                    <and_part id="4"><![CDATA[i3>=0]]></and_part>
<and_part id="5"><![CDATA[i3<=n-1]]></and_part>
+
                    <and_part id="5"><![CDATA[i3<=n-1]]></and_part>
<statement id="0" num_inputs="3">
+
                        <input id="0" num_solutions="0"/>
<input id="0" num_solutions="0"/>
+
                        <input id="1" num_solutions="3">
<input id="1" num_solutions="3">
+
                          <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
+
                              <altarea num_conditions="7">
<altarea num_conditions="7">
+
                                <condition><![CDATA[-m+2<=0]]></condition>
<condition><![CDATA[-m+2<=0]]></condition>
+
                                <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                                <condition><![CDATA[i3-n+1<=0]]></condition>
<condition><![CDATA[i3-n+1<=0]]></condition>
+
                                <condition><![CDATA[-i2+2<=0]]></condition>
<condition><![CDATA[-i2+2<=0]]></condition>
+
                                <condition><![CDATA[i2<=m]]></condition>
<condition><![CDATA[i2<=m]]></condition>
+
                                <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                                <condition><![CDATA[-i3<=0]]></condition>
<condition><![CDATA[-i3<=0]]></condition>
+
                              </altarea>
</altarea>
+
                              <dependency>
<dependency>
+
                                <coordinate><![CDATA[i1]]></coordinate>
<coordinate><![CDATA[i1]]></coordinate>
+
                                <coordinate><![CDATA[i2-1]]></coordinate>
<coordinate><![CDATA[i2-1]]></coordinate>
+
                                <coordinate><![CDATA[i3]]></coordinate>
<coordinate><![CDATA[i3]]></coordinate>
+
                              </dependency>
</dependency>
+
                          </solution>
</solution>
+
                          <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
+
                              <altarea num_conditions="7">
<altarea num_conditions="7">
+
                                <condition><![CDATA[-m+2<=0]]></condition>
<condition><![CDATA[-m+2<=0]]></condition>
+
                                <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                                <condition><![CDATA[i3-n+1<=0]]></condition>
<condition><![CDATA[i3-n+1<=0]]></condition>
+
                                <condition><![CDATA[-i2+2<=0]]></condition>
<condition><![CDATA[-i2+2<=0]]></condition>
+
                                <condition><![CDATA[i2<=m]]></condition>
<condition><![CDATA[i2<=m]]></condition>
+
                                <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                                <condition><![CDATA[-i3<=0]]></condition>
<condition><![CDATA[-i3<=0]]></condition>
+
                              </altarea>
</altarea>
+
                              <dependency>
<dependency>
+
                                <coordinate><![CDATA[1]]></coordinate>
<coordinate><![CDATA[1]]></coordinate>
+
                                <coordinate><![CDATA[i2-1]]></coordinate>
<coordinate><![CDATA[i2-1]]></coordinate>
+
                                <coordinate><![CDATA[i3]]></coordinate>
<coordinate><![CDATA[i3]]></coordinate>
+
                              </dependency>
</dependency>
+
                          </solution>
</solution>
+
                          <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
<solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
+
                              <altarea num_conditions="6">
<altarea num_conditions="6">
+
                                <condition><![CDATA[i2-1<=0]]></condition>
<condition><![CDATA[i2-1<=0]]></condition>
+
                                <condition><![CDATA[i2-1>=0]]></condition>
<condition><![CDATA[i2-1>=0]]></condition>
+
                                <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                                <condition><![CDATA[-i3<=0]]></condition>
<condition><![CDATA[-i3<=0]]></condition>
+
                                <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                                <condition><![CDATA[i3-n+1<=0]]></condition>
<condition><![CDATA[i3-n+1<=0]]></condition>
+
                              </altarea>
</altarea>
+
                          </solution>
</solution>
+
                        </input>
</input>
+
                        <input id="2" num_solutions="0"/>
<input id="2" num_solutions="0"/>
+
                    </statement>
</statement>
+
                  </or_part>
</or_part>
+
              </group>
</group>
+
            </loop>
</loop>
+
        </loop>
</loop>
+
      </loop>
</loop>
+
  </algorithm>
</algorithm>
 
 
</algograph>
 
</algograph>
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "3">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
<arg name = "k" val = "1..N"></arg>
 +
<vertex condition = "" type = "0">
 +
<in src = “i, j – 1, k”></in>
 +
<in src = “1, j - 1, k”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 545: Строка 794:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_007/Example_007.html
 
|url=XML_example_007/Example_007.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 551: Строка 800:
 
<br>
 
<br>
 
Набор одномерных последовательных структур, независимых между собой - 3D вариант
 
Набор одномерных последовательных структур, независимых между собой - 3D вариант
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
C++ реализация:
 +
<div class="mw-collapsible-content">
 +
<source lang = "c++">
 +
void accumSum(int*** _src, int _nCol, int _nRow, int _nLayer)
 +
{
 +
  for (int layerId = 0; layerId < _nLayer; ++layerId)
 +
  {
 +
      for (int rowId = 0; rowId < _nRow; ++rowId)
 +
      {
 +
        for (int colId = 0; colId < _nCol; ++colId)
 +
        {
 +
            _src[layerId][rowId][colId] += _src[layerId][rowId == 0 ? rowId : rowId - 1][colId];
 +
        }
 +
      } 
 +
  }
 +
}
 +
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Кодировка в XML:
 +
<div class="mw-collapsible-content">
 
<source lang = "xml">
 
<source lang = "xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<algograph version="0.0.1">
 
<algograph version="0.0.1">
<algorithm num_ext_params="2" num_groups="2">
+
  <algorithm num_ext_params="2" num_groups="2">
<ext_param name="n"/>
+
      <ext_param name="n"/>
<ext_param name="m"/>
+
      <ext_param name="m"/>
<group id="0" num_or_parts="1" num_oper="1">
+
      <group id="0" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="1">
+
        <or_part id="0" num_and_parts="1">
<and_part id="0"><![CDATA[]]></and_part>
+
            <and_part id="0"><![CDATA[]]></and_part>
<statement id="0" num_inputs="1">
+
            <statement id="0" num_inputs="1">
<input id="0" num_solutions="0"/>
+
              <input id="0" num_solutions="0"/>
</statement>
+
            </statement>
</or_part>
+
        </or_part>
</group>
+
      </group>
<loop>
+
      <loop>
<loop>
+
        <loop>
<loop>
+
            <loop>
<group id="1" num_or_parts="1" num_oper="1">
+
              <group id="1" num_or_parts="1" num_oper="1">
<or_part id="0" num_and_parts="6">
+
                  <or_part id="0" num_and_parts="6">
<and_part id="0"><![CDATA[-i1<=-1]]></and_part>
+
                    <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
<and_part id="1"><![CDATA[i1<=n]]></and_part>
+
                    <and_part id="1"><![CDATA[i1<=n]]></and_part>
<and_part id="2"><![CDATA[-i2<=-1]]></and_part>
+
                    <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
<and_part id="3"><![CDATA[i2<=m]]></and_part>
+
                    <and_part id="3"><![CDATA[i2<=m]]></and_part>
<and_part id="4"><![CDATA[i3>=0]]></and_part>
+
                    <and_part id="4"><![CDATA[i3>=0]]></and_part>
<and_part id="5"><![CDATA[i3<=n-1]]></and_part>
+
                    <and_part id="5"><![CDATA[i3<=n-1]]></and_part>
<statement id="0" num_inputs="3">
+
                    <statement id="0" num_inputs="3">
<input id="0" num_solutions="0"/>
+
                        <input id="0" num_solutions="0"/>
<input id="1" num_solutions="2">
+
                        <input id="1" num_solutions="2">
<solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
+
                          <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
<altarea num_conditions="7">
+
                              <altarea num_conditions="7">
<condition><![CDATA[-m+2<=0]]></condition>
+
                                <condition><![CDATA[-m+2<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                                <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[i3-n+1<=0]]></condition>
+
                                <condition><![CDATA[i3-n+1<=0]]></condition>
<condition><![CDATA[-i2+1<=0]]></condition>
+
                                <condition><![CDATA[-i2+1<=0]]></condition>
<condition><![CDATA[i2+1<=m]]></condition>
+
                                <condition><![CDATA[i2+1<=m]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                                <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i3<=0]]></condition>
+
                                <condition><![CDATA[-i3<=0]]></condition>
</altarea>
+
                              </altarea>
<dependency>
+
                              <dependency>
<coordinate><![CDATA[i1]]></coordinate>
+
                                <coordinate><![CDATA[i1]]></coordinate>
<coordinate><![CDATA[i2+1]]></coordinate>
+
                                <coordinate><![CDATA[i2+1]]></coordinate>
<coordinate><![CDATA[i3]]></coordinate>
+
                                <coordinate><![CDATA[i3]]></coordinate>
</dependency>
+
                              </dependency>
</solution>
+
                          </solution>
<solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
+
                          <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
<altarea num_conditions="6">
+
                              <altarea num_conditions="6">
<condition><![CDATA[i2-m<=0]]></condition>
+
                                <condition><![CDATA[i2-m<=0]]></condition>
<condition><![CDATA[i2-m>=0]]></condition>
+
                                <condition><![CDATA[i2-m>=0]]></condition>
<condition><![CDATA[-i1+1<=0]]></condition>
+
                                <condition><![CDATA[-i1+1<=0]]></condition>
<condition><![CDATA[-i3<=0]]></condition>
+
                                <condition><![CDATA[-i3<=0]]></condition>
<condition><![CDATA[i1-n<=0]]></condition>
+
                                <condition><![CDATA[i1-n<=0]]></condition>
<condition><![CDATA[i3-n+1<=0]]></condition>
+
                                <condition><![CDATA[i3-n+1<=0]]></condition>
</altarea>
+
                              </altarea>
</solution>
+
                          </solution>
</input>
+
                        </input>
<input id="2" num_solutions="0"/>
+
                        <input id="2" num_solutions="0"/>
</statement>
+
                    </statement>
</or_part>
+
                  </or_part>
</group>
+
              </group>
</loop>
+
            </loop>
</loop>
+
        </loop>
</loop>
+
      </loop>
</algorithm>
+
  </algorithm>
 
</algograph>
 
</algograph>
 
</source>
 
</source>
 +
</div>
 +
</div>
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "3">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
<arg name = "k" val = "1..N"></arg>
 +
 +
<vertex condition = "" type = "0">
 +
<in src = “i, j – 1, k”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 621: Строка 916:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_008/Example_008.html
 
|url=XML_example_008/Example_008.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 627: Строка 922:
 
<br>
 
<br>
 
Пример массовой рассылки данных в 2D-структуре
 
Пример массовой рассылки данных в 2D-структуре
</tab>
+
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "2">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..2"></arg>
  
<tab name="Пример 9">
+
<vertex condition = "(j == 1) && (i == 1)" type = "0">
{{#widget:Algoviewer
+
</vertex>
|url=XML_example_009/Example_009.html
+
<vertex condition = "(j > 1)" type = "0">
|width=1300
+
<in src = “1, 1”></in>
|height=800
+
</vertex>
|border=1
+
  </block>
}}
+
</algo>
<br>
+
</source>
Искуственный пример, демонстрирующий элементы визуализации
+
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 643: Строка 949:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_010/Example_010.html
 
|url=XML_example_010/Example_010.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 649: Строка 955:
 
<br>
 
<br>
 
Последовательный набор 3D-структур, содержащих скошенный параллелизм
 
Последовательный набор 3D-структур, содержащих скошенный параллелизм
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block id = "0" dims = "3">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
        <arg name = "k" val = "1..N"></arg>
 +
<vertex condition = "" type = "0">
 +
<in src = "i - 1, j, k"></in>
 +
<in src = "i, j – 1, k"></in>
 +
<in src = "i, j, k - 1"></in>
 +
</vertex>
 +
  </block>
 +
  <block id = "1" dims = "3">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..2"></arg>
 +
        <arg name = "k" val = "1..N"></arg>
 +
<vertex condition = "" type = "0">
 +
<in bsrc = "0" src = "i, j, k"></in>
 +
<in src = "i - 1, j, k"></in>
 +
<in src = "i, j – 1, k"></in>
 +
<in src = "i, j, k - 1"></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 654: Строка 993:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_011/Example_011.html
 
|url=XML_example_011/Example_011.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 660: Строка 999:
 
<br>
 
<br>
 
Пример массовой рассылки данных в 3D-структуре
 
Пример массовой рассылки данных в 3D-структуре
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "3">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
        <arg name = "k" val = "1..2"></arg>
 +
<vertex condition = "(i == 1) && (j == 1) && (k == 1)" type = "0">
 +
</vertex>
 +
<vertex condition = "(i > 1) && (j > 1) && (k > 1)" type = "0">
 +
<in src = “1, 1, 1”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 665: Строка 1026:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_012/Example_012.html
 
|url=XML_example_012/Example_012.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 671: Строка 1032:
 
<br>
 
<br>
 
Пример 3D-структуры с различными видами скошенного параллелизма
 
Пример 3D-структуры с различными видами скошенного параллелизма
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
  </params>
 +
  <block dims = "3">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..N"></arg>
 +
        <arg name = "k" val = "1..2"></arg>
 +
<vertex condition = "k == 1" type = "0">
 +
<in src = “i, j – 1”></in>
 +
<in src = “i - 1, j”></in>
 +
</vertex>
 +
<vertex condition = "k > 1" type = "0">
 +
<in src = “i, j, 1”></in>
 +
<in src = “i, j – 1”></in>
 +
<in src = “i - 1, j - 1”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
Строка 676: Строка 1063:
 
{{#widget:Algoviewer
 
{{#widget:Algoviewer
 
|url=XML_example_013/Example_013.html
 
|url=XML_example_013/Example_013.html
|width=1300
+
|width=1200
 
|height=800
 
|height=800
 
|border=1
 
|border=1
Строка 682: Строка 1069:
 
<br>
 
<br>
 
Последовательно-параллельное перемножение матриц
 
Последовательно-параллельное перемножение матриц
 +
<div class="collapser mw-collapsible mw-collapsed" style="width:1200px; overflow:auto;">
 +
Новая разметка:
 +
<div class="mw-collapsible-content">
 +
<source lang = "xml">
 +
<algo>
 +
  <params>
 +
<param name = "N" type = "int"></param>
 +
<param name = "P" type = "int"></param>
 +
<param name = "Q" type = "int"></param>
 +
  </params>
 +
  <block dims = "3">
 +
<arg name = "i" val = "1..N"></arg>
 +
<arg name = "j" val = "1..P"></arg>
 +
        <arg name = "k" val = "1..Q"></arg>
 +
<vertex condition = "(i > 1) && (j > 1)" type = "0">
 +
<in src = “i, j – 1”></in>
 +
<in src = “i - 1, j”></in>
 +
<in src = “i, j, k -1”></in>
 +
</vertex>
 +
<vertex condition = "(i > 1) || (j > 1)" type = "0">
 +
<in src = “i, j – 1”></in>
 +
<in src = “i - 1, j”></in>
 +
</vertex>
 +
  </block>
 +
</algo>
 +
</source>
 +
</div>
 +
</div>
 
</tab>
 
</tab>
  
 
</tabs>
 
</tabs>

Текущая версия на 20:02, 28 июля 2020


Чисто последовательная структура в 2D-представлении (последовательное суммирование)

C++ реализация:

int seqSum(const std::vector<int>& _src)
{
   int resSum = 0;
   for (int srcId = 0; srcId < _src.size(); ++srcId)
   {
      resSum += _src[srcId];
   }
   return resSum;
}

Кодировка в XML:

<?xml version="1.0" encoding="UTF-8"?>
<algograph version="0.0.1">
   <algorithm num_ext_params="1" num_groups="2">
      <ext_param name="n"/>
      <group id="0" num_or_parts="1" num_oper="1">
         <or_part id="0" num_and_parts="1">
            <and_part id="0"><![CDATA[]]></and_part>
            <statement id="0" num_inputs="1">
               <input id="0" num_solutions="0"/>
            </statement>
         </or_part>
      </group>
      <loop>
         <loop>
            <group id="1" num_or_parts="1" num_oper="1">
               <or_part id="0" num_and_parts="4">
                  <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
                  <and_part id="1"><![CDATA[i1<=n]]></and_part>
                  <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
                  <and_part id="3"><![CDATA[i2<=n]]></and_part>
                  <statement id="0" num_inputs="3">
                     <input id="0" num_solutions="0"/>
                     <input id="1" num_solutions="3">
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[-i2+2<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1]]></coordinate>
                              <coordinate><![CDATA[i2-1]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+2<=0]]></condition>
                              <condition><![CDATA[i2-1<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1-1]]></coordinate>
                              <coordinate><![CDATA[n]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
                           <altarea num_conditions="5">
                              <condition><![CDATA[-n+1<=0]]></condition>
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[i2-1<=0]]></condition>
                              <condition><![CDATA[i1-1<=0]]></condition>
                           </altarea>
                       </solution>
                     </input>
                     <input id="2" num_solutions="0"/>
                  </statement>
               </or_part>
            </group>
         </loop>
      </loop>
   </algorithm>
</algograph>

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "2">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>

	<vertex condition = "(j == 1)" type = "0">
		<in src = “i  1, N”></in>
	</vertex>
	<vertex condition = "(j > 1)" type = "0">
		<in src = “i, j - 1”></in>
	</vertex>
   </block>
</algo>


Набор одномерных последовательных структур, независимых между собой - 2D вариант

C++ реализация:

void seqParSum(const std::vector<std::vector<int> >& _src, std::vector<int>& _res)
{
   if (_src.size() != _res.size())
      return;

   for (int srcGrpId = 0; srcGrpId < _src.size(); ++srcGrpId)
   {
      for (int srcElId = 0; srcElId < _src[srcGrpId].size(); ++srcElId )
      {
         _res[srcGrpId] += _src[srcGrpId][srcElId];
      }
   }
   return;
}

Кодировка в XML:

<?xml version="1.0" encoding="UTF-8"?>
<algograph version="0.0.1">
   <algorithm num_ext_params="1" num_groups="2">
      <ext_param name="n"/>
      <group id="0" num_or_parts="1" num_oper="1">
         <or_part id="0" num_and_parts="1">
            <and_part id="0"><![CDATA[]]></and_part>
            <statement id="0" num_inputs="1">
               <input id="0" num_solutions="0"/>
            </statement>
         </or_part>
      </group>
      <loop>
         <loop>
            <group id="1" num_or_parts="1" num_oper="1">
               <or_part id="0" num_and_parts="4">
                  <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
                  <and_part id="1"><![CDATA[i1<=n]]></and_part>
                  <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
                  <and_part id="3"><![CDATA[i2<=n]]></and_part>
                  <statement id="0" num_inputs="3">
                     <input id="0" num_solutions="0"/>
                     <input id="1" num_solutions="3">
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[-i2+2<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1]]></coordinate>
                              <coordinate><![CDATA[i2-1]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="0">
                           <altarea num_conditions="5">
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+2<=0]]></condition>
                              <condition><![CDATA[i2-1<=0]]></condition>
                           </altarea>
                        </solution>
                        <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
                           <altarea num_conditions="5">
                              <condition><![CDATA[-n+1<=0]]></condition>
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[i2-1<=0]]></condition>
                              <condition><![CDATA[i1-1<=0]]></condition>
                           </altarea>
                        </solution>
                     </input>
                     <input id="2" num_solutions="0"/>
                  </statement>
               </or_part>
            </group>
         </loop>
      </loop>
   </algorithm>
</algograph>

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "2">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>

	<vertex condition = "" type = "0">
		<in src = “i, j - 1”></in>
	</vertex>
   </block>
</algo>


Двумерная структура со скошенным параллелизмом

C++ реализация:

int accumSum(int** _src, int _nCol, int _nRow)
{
   for (int rowId = 0; rowId < _nRow; ++rowId)
   {
      for (int colId = 0; colId < _nCol; ++colId)
      {
         _src[rowId][colId] += _src[rowId][colId == 0 ? colId : colId - 1];
         _src[rowId][colId] += _src[rowId == 0 ? rowId : rowId - 1][colId];
      }
   }
   return _src[_nRow - 1][_nCol - 1];
}

Кодировка в XML:

<?xml version="1.0" encoding="UTF-8"?>
<algograph version="0.0.1">
   <algorithm num_ext_params="1" num_groups="2">
      <ext_param name="n"/>
      <group id="0" num_or_parts="1" num_oper="1">
         <or_part id="0" num_and_parts="1">
            <and_part id="0"><![CDATA[]]></and_part>
            <statement id="0" num_inputs="1">
               <input id="0" num_solutions="0"/>
            </statement>
         </or_part>
      </group>
      <loop>
         <loop>
            <group id="1" num_or_parts="1" num_oper="1">
               <or_part id="0" num_and_parts="4">
                  <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
                  <and_part id="1"><![CDATA[i1<=n]]></and_part>
                  <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
                  <and_part id="3"><![CDATA[i2<=n]]></and_part>
                  <statement id="0" num_inputs="3">
                     <input id="0" num_solutions="0"/>
                     <input id="1" num_solutions="3">
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[-i2+2<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1]]></coordinate>
                              <coordinate><![CDATA[i2-1]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+2<=0]]></condition>
                              <condition><![CDATA[-i2+1<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1-1]]></coordinate>
                              <coordinate><![CDATA[i2]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
                           <altarea num_conditions="5">
                              <condition><![CDATA[-n+1<=0]]></condition>
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[i2-1<=0]]></condition>
                              <condition><![CDATA[i1-1<=0]]></condition>
                           </altarea>
                        </solution>
                     </input>
                     <input id="2" num_solutions="0"/>
                  </statement>
               </or_part>
            </group>
         </loop>
      </loop>
   </algorithm>
</algograph>

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "2">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>

	<vertex condition = "" type = "0">
		<in src = “i, j - 1”></in>
		<in src = “i - 1, j”></in>
	</vertex>
   </block>
</algo>


Двумерная структура со скошенным параллелизмом и скошенной передачей данных

C++ реализация:

int accumSum(int** _src, int _nCol, int _nRow)
{
   for (int rowId = 0; rowId < _nRow; ++rowId)
   {
      for (int colId = 0; colId < _nCol; ++colId)
      {
         _src[rowId][colId] += _src[(rowId == 0 && colId < 2) ? rowId : rowId - 1][(rowId != 0 && colId > 1) ? colId : colId - 2];
         _src[rowId][colId] += _src[rowId == 0 ? rowId : rowId - 1][colId];
      }
   }
   return _src[_nRow - 1][_nCol - 1];
}

Кодировка в XML:

<?xml version="1.0" encoding="UTF-8"?>
<algograph version="0.0.1">
   <algorithm num_ext_params="1" num_groups="2">
      <ext_param name="n"/>
      <group id="0" num_or_parts="1" num_oper="1">
         <or_part id="0" num_and_parts="1">
            <and_part id="0"><![CDATA[]]></and_part>
            <statement id="0" num_inputs="1">
               <input id="0" num_solutions="0"/>
            </statement>
         </or_part>
      </group>
      <loop>
         <loop>
            <group id="1" num_or_parts="1" num_oper="1">
               <or_part id="0" num_and_parts="4">
                  <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
                  <and_part id="1"><![CDATA[i1<=n]]></and_part>
                  <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
                  <and_part id="3"><![CDATA[i2<=n]]></and_part>
                  <statement id="0" num_inputs="3">
                     <input id="0" num_solutions="0"/>
                     <input id="1" num_solutions="3">
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[-i2+2<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1]]></coordinate>
                              <coordinate><![CDATA[i2-1]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+3<=0]]></condition>
                              <condition><![CDATA[-i2+2<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1-2]]></coordinate>
                              <coordinate><![CDATA[i2-1]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
                           <altarea num_conditions="5">
                              <condition><![CDATA[-n+1<=0]]></condition>
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[i2-1<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                           </altarea>
                        </solution>
                     </input>
                     <input id="2" num_solutions="0"/>
                  </statement>
               </or_part>
            </group>
         </loop>
      </loop>
   </algorithm>
</algograph>

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "2">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>

	<vertex condition = "" type = "0">
		<in src = “i, j - 1”></in>
		<in src = “i - 2, j - 1”></in>
	</vertex>
   </block>
</algo>


Двумерная структура с квадратным параллелизмом и массовыми рассылками по каждому измерению

C++ реализация:

int accumSum(int** _src, int _nCol, int _nRow)
{
   for (int rowId = 0; rowId < _nRow; ++rowId)
   {
      for (int colId = 0; colId < _nCol; ++colId)
      {
         _src[rowId][colId] += _src[rowId][colId == 0 ? colId : colId - 1];
         _src[rowId][colId] += _src[rowId == 0 ? rowId : rowId - 1][colId];
         _src[rowId][colId] += _src[rowId][0];
         _src[rowId][colId] += _src[0][colId];
      }
   }
   return _src[_nRow - 1][_nCol - 1];
}

Кодировка в XML:

<?xml version="1.0" encoding="UTF-8"?>
<algograph version="0.0.1">
   <algorithm num_ext_params="1" num_groups="2">
      <ext_param name="n"/>
      <group id="0" num_or_parts="1" num_oper="1">
         <or_part id="0" num_and_parts="1">
            <and_part id="0"><![CDATA[]]></and_part>
            <statement id="0" num_inputs="1">
               <input id="0" num_solutions="0"/>
            </statement>
         </or_part>
      </group>
      <loop>
         <loop>
            <group id="1" num_or_parts="1" num_oper="1">
               <or_part id="0" num_and_parts="4">
                  <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
                  <and_part id="1"><![CDATA[i1<=n]]></and_part>
                  <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
                  <and_part id="3"><![CDATA[i2<=n]]></and_part>
                  <statement id="0" num_inputs="3">
                     <input id="0" num_solutions="0"/>
                     <input id="1" num_solutions="5">
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[-i2+2<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1]]></coordinate>
                              <coordinate><![CDATA[i2-1]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-i1+2<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1-1]]></coordinate>
                              <coordinate><![CDATA[i2]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[-i2+3<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[i1]]></coordinate>
                              <coordinate><![CDATA[1]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="2">
                           <altarea num_conditions="5">
                              <condition><![CDATA[i2-n<=0]]></condition>
                              <condition><![CDATA[-n+2<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-i1+3<=0]]></condition>
                           </altarea>
                           <dependency>
                              <coordinate><![CDATA[1]]></coordinate>
                              <coordinate><![CDATA[i2]]></coordinate>
                           </dependency>
                        </solution>
                        <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
                           <altarea num_conditions="5">
                              <condition><![CDATA[-n+1<=0]]></condition>
                              <condition><![CDATA[-i2+1<=0]]></condition>
                              <condition><![CDATA[-i1+1<=0]]></condition>
                              <condition><![CDATA[i2-1<=0]]></condition>
                              <condition><![CDATA[i1-n<=0]]></condition>
                           </altarea>
                        </solution>
                     </input>
                     <input id="2" num_solutions="0"/>
                  </statement>
               </or_part>
            </group>
         </loop>
      </loop>
   </algorithm>
</algograph>

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "2">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>
	<vertex condition = "" type = "0">
		<in src = “i, j - 1”></in>
		<in src = “i - 1, j”></in>
		<in src = “1, j”></in>
		<in src = “i, 1”></in>
	</vertex>
   </block>
</algo>


Набор независимых последовательно-параллельных 2D-структур с массовой рассылкой данных в каждой

C++ реализация:

void accumSum(int*** _src, int _nCol, int _nRow, int _nLayer)
{
   for (int layerId = 0; layerId < _nLayer; ++layerId)
   {
      for (int rowId = 0; rowId < _nRow; ++rowId)
      {
         for (int colId = 0; colId < _nCol; ++colId)
         {
            _src[layerId][rowId][colId] += _src[layerId][rowId == 0 ? rowId : rowId - 1][colId == 0 ? colId : 0];
            _src[layerId][rowId][colId] += _src[layerId][rowId == 0 ? rowId : rowId - 1][colId];
         }
      }   
   }
}

Кодировка в XML:

<?xml version="1.0" encoding="UTF-8"?>
<algograph version="0.0.1">
   <algorithm num_ext_params="2" num_groups="2">
      <ext_param name="n"/>
      <ext_param name="m"/>
         <group id="0" num_or_parts="1" num_oper="1">
         <or_part id="0" num_and_parts="1">
            <and_part id="0"><![CDATA[]]></and_part>
            <statement id="0" num_inputs="1">
               <input id="0" num_solutions="0"/>
            </statement>
         </or_part>
      </group>
      <loop>
         <loop>
            <loop>
               <group id="1" num_or_parts="1" num_oper="1">
                  <or_part id="0" num_and_parts="6">
                     <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
                     <and_part id="1"><![CDATA[i1<=n]]></and_part>
                     <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
                     <and_part id="3"><![CDATA[i2<=m]]></and_part>
                     <and_part id="4"><![CDATA[i3>=0]]></and_part>
                     <and_part id="5"><![CDATA[i3<=n-1]]></and_part>
                        <input id="0" num_solutions="0"/>
                        <input id="1" num_solutions="3">
                           <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
                              <altarea num_conditions="7">
                                 <condition><![CDATA[-m+2<=0]]></condition>
                                 <condition><![CDATA[i1-n<=0]]></condition>
                                 <condition><![CDATA[i3-n+1<=0]]></condition>
                                 <condition><![CDATA[-i2+2<=0]]></condition>
                                 <condition><![CDATA[i2<=m]]></condition>
                                 <condition><![CDATA[-i1+1<=0]]></condition>
                                 <condition><![CDATA[-i3<=0]]></condition>
                              </altarea>
                              <dependency>
                                 <coordinate><![CDATA[i1]]></coordinate>
                                 <coordinate><![CDATA[i2-1]]></coordinate>
                                 <coordinate><![CDATA[i3]]></coordinate>
                              </dependency>
                           </solution>
                           <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
                              <altarea num_conditions="7">
                                 <condition><![CDATA[-m+2<=0]]></condition>
                                 <condition><![CDATA[i1-n<=0]]></condition>
                                 <condition><![CDATA[i3-n+1<=0]]></condition>
                                 <condition><![CDATA[-i2+2<=0]]></condition>
                                 <condition><![CDATA[i2<=m]]></condition>
                                 <condition><![CDATA[-i1+1<=0]]></condition>
                                 <condition><![CDATA[-i3<=0]]></condition>
                              </altarea>
                              <dependency>
                                 <coordinate><![CDATA[1]]></coordinate>
                                 <coordinate><![CDATA[i2-1]]></coordinate>
                                 <coordinate><![CDATA[i3]]></coordinate>
                              </dependency>
                           </solution>									
                           <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
                              <altarea num_conditions="6">
                                 <condition><![CDATA[i2-1<=0]]></condition>
                                 <condition><![CDATA[i2-1>=0]]></condition>
                                 <condition><![CDATA[-i1+1<=0]]></condition>
                                 <condition><![CDATA[-i3<=0]]></condition>
                                 <condition><![CDATA[i1-n<=0]]></condition>
                                 <condition><![CDATA[i3-n+1<=0]]></condition>
                              </altarea>
                           </solution>
                        </input>
                        <input id="2" num_solutions="0"/>
                     </statement>
                  </or_part>
               </group>
            </loop>
         </loop>
      </loop>
   </algorithm>
</algograph>

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "3">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>
	<arg name = "k" val = "1..N"></arg>
	<vertex condition = "" type = "0">
		<in src = “i, j  1, k”></in>
		<in src = “1, j - 1, k”></in>
	</vertex>
   </block>
</algo>


Набор одномерных последовательных структур, независимых между собой - 3D вариант

C++ реализация:

void accumSum(int*** _src, int _nCol, int _nRow, int _nLayer)
{
   for (int layerId = 0; layerId < _nLayer; ++layerId)
   {
      for (int rowId = 0; rowId < _nRow; ++rowId)
      {
         for (int colId = 0; colId < _nCol; ++colId)
         {
            _src[layerId][rowId][colId] += _src[layerId][rowId == 0 ? rowId : rowId - 1][colId];
         }
      }   
   }
}

Кодировка в XML:

<?xml version="1.0" encoding="UTF-8"?>
<algograph version="0.0.1">
   <algorithm num_ext_params="2" num_groups="2">
      <ext_param name="n"/>
      <ext_param name="m"/>
      <group id="0" num_or_parts="1" num_oper="1">
         <or_part id="0" num_and_parts="1">
            <and_part id="0"><![CDATA[]]></and_part>
            <statement id="0" num_inputs="1">
               <input id="0" num_solutions="0"/>
            </statement>
         </or_part>
      </group>
      <loop>
         <loop>
            <loop>
               <group id="1" num_or_parts="1" num_oper="1">
                  <or_part id="0" num_and_parts="6">
                     <and_part id="0"><![CDATA[-i1<=-1]]></and_part>
                     <and_part id="1"><![CDATA[i1<=n]]></and_part>
                     <and_part id="2"><![CDATA[-i2<=-1]]></and_part>
                     <and_part id="3"><![CDATA[i2<=m]]></and_part>
                     <and_part id="4"><![CDATA[i3>=0]]></and_part>
                     <and_part id="5"><![CDATA[i3<=n-1]]></and_part>
                     <statement id="0" num_inputs="3">
                        <input id="0" num_solutions="0"/>
                        <input id="1" num_solutions="2">
                           <solution num_altareas="1" group_id="1" or_part_id="0" statement_id="0" dimsolut="3">
                              <altarea num_conditions="7">
                                 <condition><![CDATA[-m+2<=0]]></condition>
                                 <condition><![CDATA[i1-n<=0]]></condition>
                                 <condition><![CDATA[i3-n+1<=0]]></condition>
                                 <condition><![CDATA[-i2+1<=0]]></condition>
                                 <condition><![CDATA[i2+1<=m]]></condition>
                                 <condition><![CDATA[-i1+1<=0]]></condition>
                                 <condition><![CDATA[-i3<=0]]></condition>
                              </altarea>
                              <dependency>
                                 <coordinate><![CDATA[i1]]></coordinate>
                                 <coordinate><![CDATA[i2+1]]></coordinate>
                                 <coordinate><![CDATA[i3]]></coordinate>
                              </dependency>
                           </solution>
                           <solution num_altareas="1" group_id="0" or_part_id="0" statement_id="0" dimsolut="0">
                              <altarea num_conditions="6">
                                 <condition><![CDATA[i2-m<=0]]></condition>
                                 <condition><![CDATA[i2-m>=0]]></condition>
                                 <condition><![CDATA[-i1+1<=0]]></condition>
                                 <condition><![CDATA[-i3<=0]]></condition>
                                 <condition><![CDATA[i1-n<=0]]></condition>
                                 <condition><![CDATA[i3-n+1<=0]]></condition>
                              </altarea>
                           </solution>
                        </input>
                        <input id="2" num_solutions="0"/>
                     </statement>
                  </or_part>
               </group>
            </loop>
         </loop>
      </loop>
   </algorithm>
</algograph>

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "3">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>
	<arg name = "k" val = "1..N"></arg>

	<vertex condition = "" type = "0">
		<in src = “i, j  1, k”></in>
	</vertex>
   </block>
</algo>


Пример массовой рассылки данных в 2D-структуре

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "2">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..2"></arg>

	<vertex condition = "(j == 1) && (i == 1)" type = "0">
	</vertex>
	<vertex condition = "(j > 1)" type = "0">
		<in src = “1, 1”></in>
	</vertex>
   </block>
</algo>


Последовательный набор 3D-структур, содержащих скошенный параллелизм

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block id = "0" dims = "3">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>
        <arg name = "k" val = "1..N"></arg>
	<vertex condition = "" type = "0">
		<in src = "i - 1, j, k"></in>
		<in src = "i, j – 1, k"></in>
		<in src = "i, j, k - 1"></in>
	</vertex>
   </block>
   <block id = "1" dims = "3">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..2"></arg>
        <arg name = "k" val = "1..N"></arg>
	<vertex condition = "" type = "0">
		<in bsrc = "0" src = "i, j, k"></in>
		<in src = "i - 1, j, k"></in>
		<in src = "i, j – 1, k"></in>
		<in src = "i, j, k - 1"></in>
	</vertex>
   </block>
</algo>


Пример массовой рассылки данных в 3D-структуре

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "3">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>
        <arg name = "k" val = "1..2"></arg>
	<vertex condition = "(i == 1) && (j == 1) && (k == 1)" type = "0">
	</vertex>
	<vertex condition = "(i > 1) && (j > 1) && (k > 1)" type = "0">
		<in src = “1, 1, 1”></in>
	</vertex>
   </block>
</algo>


Пример 3D-структуры с различными видами скошенного параллелизма

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
   </params>
   <block dims = "3">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..N"></arg>
        <arg name = "k" val = "1..2"></arg>
	<vertex condition = "k == 1" type = "0">
		<in src = “i, j  1”></in>
		<in src = “i - 1, j”></in>
	</vertex>
	<vertex condition = "k > 1" type = "0">
		<in src = “i, j, 1”></in>
		<in src = “i, j  1”></in>
		<in src = “i - 1, j - 1”></in>
	</vertex>
   </block>
</algo>


Последовательно-параллельное перемножение матриц

Новая разметка:

<algo>
   <params>
	<param name = "N" type = "int"></param>
	<param name = "P" type = "int"></param>
	<param name = "Q" type = "int"></param>
   </params>
   <block dims = "3">
	<arg name = "i" val = "1..N"></arg>
	<arg name = "j" val = "1..P"></arg>
        <arg name = "k" val = "1..Q"></arg>
	<vertex condition = "(i > 1) && (j > 1)" type = "0">
		<in src = “i, j  1”></in>
		<in src = “i - 1, j”></in>
		<in src = “i, j, k -1”></in>
	</vertex>
	<vertex condition = "(i > 1) || (j > 1)" type = "0">
		<in src = “i, j  1”></in>
		<in src = “i - 1, j”></in>
	</vertex>
   </block>
</algo>