From a689107757fc80e5db91a4a4ad07a9b7c8053140 Mon Sep 17 00:00:00 2001
From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz>
Date: Sun, 20 Sep 2015 11:43:41 +0200
Subject: [PATCH] Renaming Ellpack network to indexed multimap.

---
 src/CMakeLists.txt                            |   1 -
 src/core/CMakeLists.txt                       |   1 +
 src/core/multimaps/CMakeLists.txt             |  20 +
 .../multimaps/tnlEllpackIndexMultimap.h}      |  46 +--
 .../tnlEllpackIndexMultimapValues.h}          |  24 +-
 .../tnlEllpackIndexMultimapValues_impl.h}     |  30 +-
 .../multimaps/tnlEllpackIndexMultimap_impl.h  | 116 ++++++
 .../tnlMeshSuperentityStorageInitializer.h    |  12 +-
 src/mesh/layers/tnlMeshSuperentityAccessor.h  |  14 +-
 src/mesh/traits/tnlMeshSuperentityTraits.h    |   6 +-
 src/networks/CMakeLists.txt                   |  20 -
 src/networks/tnlEllpackNetwork_impl.h         | 116 ------
 tests/unit-tests/CMakeLists.txt               |   3 +-
 tests/unit-tests/core/CMakeLists.txt          |   1 +
 .../unit-tests/core/multimaps/CMakeLists.txt  |   5 +
 .../tnlEllpackIndexMultimapTest.cpp}          |  12 +-
 .../multimaps/tnlIndexMultimapTester.h}       | 358 +++++++++---------
 tests/unit-tests/networks/CMakeLists.txt      |   5 -
 tools/share/.mgrid-view.cfg.desc.swp          | Bin 12288 -> 0 bytes
 tools/src/.compare-objects.h.swp              | Bin 12288 -> 0 bytes
 20 files changed, 395 insertions(+), 395 deletions(-)
 create mode 100644 src/core/multimaps/CMakeLists.txt
 rename src/{networks/tnlEllpackNetwork.h => core/multimaps/tnlEllpackIndexMultimap.h} (57%)
 rename src/{networks/tnlEllpackNetworkPorts.h => core/multimaps/tnlEllpackIndexMultimapValues.h} (73%)
 rename src/{networks/tnlEllpackNetworkPorts_impl.h => core/multimaps/tnlEllpackIndexMultimapValues_impl.h} (75%)
 create mode 100644 src/core/multimaps/tnlEllpackIndexMultimap_impl.h
 delete mode 100644 src/networks/CMakeLists.txt
 delete mode 100644 src/networks/tnlEllpackNetwork_impl.h
 create mode 100644 tests/unit-tests/core/multimaps/CMakeLists.txt
 rename tests/unit-tests/{networks/tnlEllpackNetworkTest.cpp => core/multimaps/tnlEllpackIndexMultimapTest.cpp} (74%)
 rename tests/unit-tests/{networks/tnlNetworkTester.h => core/multimaps/tnlIndexMultimapTester.h} (75%)
 delete mode 100644 tests/unit-tests/networks/CMakeLists.txt
 delete mode 100644 tools/share/.mgrid-view.cfg.desc.swp
 delete mode 100644 tools/src/.compare-objects.h.swp

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b14008b81a..6851150184 100755
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -5,7 +5,6 @@ ADD_SUBDIRECTORY( core )
 ADD_SUBDIRECTORY( debug )
 ADD_SUBDIRECTORY( matrices )
 ADD_SUBDIRECTORY( mesh )
-ADD_SUBDIRECTORY( networks )
 ADD_SUBDIRECTORY( operators )
 ADD_SUBDIRECTORY( problems )
 ADD_SUBDIRECTORY( solvers )
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 5ac2823e60..2399e0b8c3 100755
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -2,6 +2,7 @@ ADD_SUBDIRECTORY( arrays )
 ADD_SUBDIRECTORY( containers )
 ADD_SUBDIRECTORY( cuda )
 ADD_SUBDIRECTORY( vectors )
+ADD_SUBDIRECTORY( multimaps )
 
 set (headers tnlAssert.h               
              tnlConstants.h
diff --git a/src/core/multimaps/CMakeLists.txt b/src/core/multimaps/CMakeLists.txt
new file mode 100644
index 0000000000..7f705ebcd5
--- /dev/null
+++ b/src/core/multimaps/CMakeLists.txt
@@ -0,0 +1,20 @@
+SET( headers tnlEllpackIndexMultimap.h
+             tnlEllpackIndexMultimap_impl.h
+             tnlEllpackIndexMultimapValues.h
+             tnlEllpackIndexMultimapValues_impl.h )
+
+SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/core/multimaps )
+set( common_SOURCES
+      )       
+
+IF( BUILD_CUDA )
+   set( tnl_core_multimaps_CUDA__SOURCES
+        ${common_SOURCES}      
+        PARENT_SCOPE )
+ENDIF()    
+
+set( tnl_core_multimaps_SOURCES     
+     ${common_SOURCES}
+     PARENT_SCOPE )
+        
+INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/core/multimaps )
\ No newline at end of file
diff --git a/src/networks/tnlEllpackNetwork.h b/src/core/multimaps/tnlEllpackIndexMultimap.h
similarity index 57%
rename from src/networks/tnlEllpackNetwork.h
rename to src/core/multimaps/tnlEllpackIndexMultimap.h
index 95dd4ce5fe..c7be27b458 100644
--- a/src/networks/tnlEllpackNetwork.h
+++ b/src/core/multimaps/tnlEllpackIndexMultimap.h
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          tnlEllpackNetwork.h  -  description
+                          tnlEllpackIndexMultimap.h  -  description
                              -------------------
     begin                : Sep 9, 2015
     copyright            : (C) 2015 by Tomas Oberhuber et al.
@@ -15,58 +15,58 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef TNLELLPACKNETWORK_H
-#define	TNLELLPACKNETWORK_H
+#ifndef TNLELLPACKINDEXMULTIMAP_H
+#define	TNLELLPACKINDEXMULTIMAP_H
 
 #include <core/vectors/tnlVector.h>
 
 template< typename Index = int,
           typename Device = tnlHost >
-class tnlEllpackNetworkPorts;
+class tnlEllpackIndexMultimapValues;
 
 template< typename Index = int,
           typename Device = tnlHost >
-class tnlEllpackNetworkConstPorts;
+class tnlEllpackIndexMultimapConstValues;
 
 template< typename Index = int,
           typename Device = tnlHost >
-class tnlEllpackNetwork
+class tnlEllpackIndexMultimap
 {
    public:
       
-      typedef Device                                                DeviceType;
-      typedef Index                                                 IndexType;
-      typedef tnlEllpackNetworkPorts< IndexType, DeviceType >       PortsType;
-      typedef tnlEllpackNetworkConstPorts< IndexType, DeviceType >  ConstPortsType;
-      typedef tnlVector< IndexType, DeviceType, IndexType >         PortsAllocationVectorType;
+      typedef Device                                                       DeviceType;
+      typedef Index                                                        IndexType;
+      typedef tnlEllpackIndexMultimapValues< IndexType, DeviceType >       ValuesAccessorType;
+      typedef tnlEllpackIndexMultimapConstValues< IndexType, DeviceType >  ConstValuesAccessorType;
+      typedef tnlVector< IndexType, DeviceType, IndexType >                ValuesAllocationVectorType;
             
-      tnlEllpackNetwork();
+      tnlEllpackIndexMultimap();
       
       static tnlString getType();
 
       tnlString getTypeVirtual() const;
       
-      void setDimensions( const IndexType inputs,
-                          const IndexType outputs );
+      void setRanges( const IndexType keysRange,
+                      const IndexType valuesRange );
       
-      const IndexType getInputsCount() const;
+      const IndexType getKeysRange() const;
       
-      const IndexType getOutputsCount() const;
+      const IndexType getValuesRange() const;
       
-      void allocatePorts( const PortsAllocationVectorType& portsCount );
+      void allocate( const ValuesAllocationVectorType& portsCount );
       
-      PortsType getPorts( const IndexType& inputIndex );
+      ValuesAccessorType getValues( const IndexType& inputIndex );
       
-      ConstPortsType getPorts( const IndexType& inputIndex ) const;
+      ConstValuesAccessorType getValues( const IndexType& inputIndex ) const;
       
    protected:
       
-      tnlVector< IndexType, DeviceType, IndexType > ports;
+      tnlVector< IndexType, DeviceType, IndexType > values;
       
-      IndexType inputs, outputs, portsMaxCount;
+      IndexType keysRange, valuesRange, valuesMaxCount;
 };
 
-#include <networks/tnlEllpackNetwork_impl.h>
+#include <core/multimaps/tnlEllpackIndexMultimap_impl.h>
 
-#endif	/* TNLELLPACKNETWORK_H */
+#endif	/* TNLELLPACKINDEXMULTIMAP_H */
 
diff --git a/src/networks/tnlEllpackNetworkPorts.h b/src/core/multimaps/tnlEllpackIndexMultimapValues.h
similarity index 73%
rename from src/networks/tnlEllpackNetworkPorts.h
rename to src/core/multimaps/tnlEllpackIndexMultimapValues.h
index 5ebe8cf9dc..cba0ee8aa0 100644
--- a/src/networks/tnlEllpackNetworkPorts.h
+++ b/src/core/multimaps/tnlEllpackIndexMultimapValues.h
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          tnlEllpackNetworkPorts.h  -  description
+                          tnlEllpackIndexMultimapValues.h  -  description
                              -------------------
     begin                : Sep 10, 2015
     copyright            : (C) 2015 by Tomas Oberhuber et al.
@@ -15,23 +15,23 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef TNLELLPACKNETWORKPORTS_H
-#define	TNLELLPACKNETWORKPORTS_H
+#ifndef TNLELLPACKINDEXMULTIMAPVALUES_H
+#define	TNLELLPACKINDEXMULTIMAPVALUES_H
 
 #include <ostream>
-#include <networks/tnlEllpackNetwork.h>
+#include <core/multimaps/tnlEllpackIndexMultimap.h>
 
 template< typename Index,
           typename Device >
-class tnlEllpackNetworkPorts
+class tnlEllpackIndexMultimapValues
 {
    public:
       
       typedef Device                                     DeviceType;
       typedef Index                                      IndexType;
-      typedef tnlEllpackNetwork< IndexType, DeviceType > NetworkType;
+      typedef tnlEllpackIndexMultimap< IndexType, DeviceType > NetworkType;
       
-      tnlEllpackNetworkPorts();
+      tnlEllpackIndexMultimapValues();
       
       IndexType getPortsCount() const;
       
@@ -48,7 +48,7 @@ class tnlEllpackNetworkPorts
       
    protected:
       
-      tnlEllpackNetworkPorts( IndexType* ports, 
+      tnlEllpackIndexMultimapValues( IndexType* ports, 
                               const IndexType input,
                               const IndexType portsMaxCount );
       
@@ -56,15 +56,15 @@ class tnlEllpackNetworkPorts
       
       IndexType step, portsMaxCount;
       
-      friend tnlEllpackNetwork< IndexType, DeviceType >;
+      friend tnlEllpackIndexMultimap< IndexType, DeviceType >;
 };
 
 template< typename Index,
           typename Device >
-std::ostream& operator << ( std::ostream& str, const tnlEllpackNetworkPorts< Index, Device>& ports );
+std::ostream& operator << ( std::ostream& str, const tnlEllpackIndexMultimapValues< Index, Device>& ports );
 
-#include <networks/tnlEllpackNetworkPorts_impl.h>
+#include <core/multimaps/tnlEllpackIndexMultimapValues_impl.h>
 
 
-#endif	/* TNLELLPACKNETWORKPORTS_H */
+#endif	/* TNLELLPACKINDEXMULTIMAPVALUES_H */
 
diff --git a/src/networks/tnlEllpackNetworkPorts_impl.h b/src/core/multimaps/tnlEllpackIndexMultimapValues_impl.h
similarity index 75%
rename from src/networks/tnlEllpackNetworkPorts_impl.h
rename to src/core/multimaps/tnlEllpackIndexMultimapValues_impl.h
index 9b0836c8f8..0441495b7a 100644
--- a/src/networks/tnlEllpackNetworkPorts_impl.h
+++ b/src/core/multimaps/tnlEllpackIndexMultimapValues_impl.h
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          tnlEllpackNetworkPorts_impl.h  -  description
+                          tnlEllpackIndexMultimapValues_impl.h  -  description
                              -------------------
     begin                : Sep 10, 2015
     copyright            : (C) 2015 by Tomas Oberhuber et al.
@@ -15,23 +15,23 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef TNLELLPACKNETWORKPORTS_IMPL_H
-#define TNLELLPACKNETWORKPORTS_IMPL_H
+#ifndef TNLELLPACKINDEXMULTIMAPVALUES_IMPL_H
+#define TNLELLPACKINDEXMULTIMAPVALUES_IMPL_H
 
-#include "tnlEllpackNetworkPorts.h"
+#include "tnlEllpackIndexMultimapValues.h"
 
 
 template< typename Index,
           typename Device >
-tnlEllpackNetworkPorts< Index, Device >::
-tnlEllpackNetworkPorts()
+tnlEllpackIndexMultimapValues< Index, Device >::
+tnlEllpackIndexMultimapValues()
 {
 }
 
 template< typename Index,
           typename Device >
-tnlEllpackNetworkPorts< Index, Device >::
-tnlEllpackNetworkPorts( IndexType* networkPorts, 
+tnlEllpackIndexMultimapValues< Index, Device >::
+tnlEllpackIndexMultimapValues( IndexType* networkPorts, 
                         const IndexType input,
                         const IndexType portsMaxCount )
 {
@@ -42,7 +42,7 @@ tnlEllpackNetworkPorts( IndexType* networkPorts,
 template< typename Index,
           typename Device >
 Index
-tnlEllpackNetworkPorts< Index, Device >::
+tnlEllpackIndexMultimapValues< Index, Device >::
 getPortsCount() const
 {
    return this->portsMaxCount;
@@ -51,7 +51,7 @@ getPortsCount() const
 template< typename Index,
           typename Device >
 void 
-tnlEllpackNetworkPorts< Index, Device >::
+tnlEllpackIndexMultimapValues< Index, Device >::
 setOutput( const IndexType portIndex,
            const IndexType output )
 {
@@ -61,7 +61,7 @@ setOutput( const IndexType portIndex,
 template< typename Index,
           typename Device >
 Index
-tnlEllpackNetworkPorts< Index, Device >::
+tnlEllpackIndexMultimapValues< Index, Device >::
 getOutput( const IndexType portIndex ) const
 {
    return this->ports[ portIndex ];
@@ -70,7 +70,7 @@ getOutput( const IndexType portIndex ) const
 template< typename Index,
           typename Device >
 Index&
-tnlEllpackNetworkPorts< Index, Device >::
+tnlEllpackIndexMultimapValues< Index, Device >::
 operator[]( const IndexType portIndex )
 {
    return this->ports[ portIndex ];
@@ -79,7 +79,7 @@ operator[]( const IndexType portIndex )
 template< typename Index,
           typename Device >
 const Index&
-tnlEllpackNetworkPorts< Index, Device >::
+tnlEllpackIndexMultimapValues< Index, Device >::
 operator[]( const IndexType portIndex ) const
 {
    return this->ports[ portIndex ];
@@ -88,7 +88,7 @@ operator[]( const IndexType portIndex ) const
 template< typename Index,
           typename Device >
 void
-tnlEllpackNetworkPorts< Index, Device >::
+tnlEllpackIndexMultimapValues< Index, Device >::
 print( std::ostream& str ) const
 {
    if( this->getPortsCount() == 0 )
@@ -104,7 +104,7 @@ print( std::ostream& str ) const
 
 template< typename Index,
           typename Device >
-std::ostream& operator << ( std::ostream& str, const tnlEllpackNetworkPorts< Index, Device>& ports )
+std::ostream& operator << ( std::ostream& str, const tnlEllpackIndexMultimapValues< Index, Device>& ports )
 {
    ports.print( str );
    return str;
diff --git a/src/core/multimaps/tnlEllpackIndexMultimap_impl.h b/src/core/multimaps/tnlEllpackIndexMultimap_impl.h
new file mode 100644
index 0000000000..0434bd445d
--- /dev/null
+++ b/src/core/multimaps/tnlEllpackIndexMultimap_impl.h
@@ -0,0 +1,116 @@
+/***************************************************************************
+                          tnlEllpackIndexMultimap_impl.h  -  description
+                             -------------------
+    begin                : Sep 9, 2015
+    copyright            : (C) 2015 by Tomas Oberhuber et al.
+    email                : tomas.oberhuber@fjfi.cvut.cz
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef TNLELLPACKINDEXMULTIMAP_IMPL_H
+#define	TNLELLPACKINDEXMULTIMAP_IMPL_H
+
+#include <core/multimaps/tnlEllpackIndexMultimap.h>
+#include <core/multimaps/tnlEllpackIndexMultimapValues.h>
+
+
+template< typename Index,
+          typename Device >
+tnlEllpackIndexMultimap< Index, Device >::
+tnlEllpackIndexMultimap()
+:  keysRange( 0 ), valuesRange( 0 ), valuesMaxCount( 0 )
+{
+}
+
+template< typename Index,
+          typename Device >
+tnlString tnlEllpackIndexMultimap< Index, Device > :: getType()
+{
+   return tnlString( "tnlEllpackIndexMultimap< ") +
+          Device :: getDeviceType() +
+          tnlString( ", " ) +
+          tnlString( ::getType< Index >() ) +                    
+          tnlString( " >" );
+}
+
+template< typename Index,
+          typename Device >
+tnlString tnlEllpackIndexMultimap< Index, Device >::getTypeVirtual() const
+{
+   return this->getType();
+}
+
+template< typename Index,
+          typename Device >
+void 
+tnlEllpackIndexMultimap< Index, Device >::
+setRanges( const IndexType inputs,
+               const IndexType outputs )
+{
+   this->keysRange = inputs;
+   this->valuesRange = outputs;
+}
+
+template< typename Index,
+          typename Device >
+const Index
+tnlEllpackIndexMultimap< Index, Device >::
+getKeysRange() const
+{
+   return this->keysRange;
+}
+
+template< typename Index,
+          typename Device >
+const Index
+tnlEllpackIndexMultimap< Index, Device >::
+getValuesRange() const
+{
+   return this->valuesRange;
+}
+
+template< typename Index,
+          typename Device >
+void
+tnlEllpackIndexMultimap< Index, Device >::
+allocate( const ValuesAllocationVectorType& portsCount )
+{
+   tnlAssert( portsCount.getSize() == this->keysRange,
+              cerr << "portsCount.getSize() =  " << portsCount.getSize()
+                   << "this->inputs = " << this->keysRange );
+   this->valuesMaxCount = portsCount.max();
+   
+   tnlAssert( this->valuesMaxCount >= 0 && this->valuesMaxCount <= this->valuesRange, 
+              cerr << "this->portsMaxCount = " << this->valuesMaxCount
+                   << " this->outputs = " << this->valuesRange );
+   this->values.setSize( this->keysRange * this->valuesMaxCount );
+}
+
+template< typename Index,
+          typename Device >
+typename tnlEllpackIndexMultimap< Index, Device >::ValuesAccessorType 
+tnlEllpackIndexMultimap< Index, Device >::
+getValues( const IndexType& inputIndex )
+{
+   return ValuesAccessorType( this->values.getData(), inputIndex, this->valuesMaxCount );
+}
+
+template< typename Index,
+          typename Device >
+typename tnlEllpackIndexMultimap< Index, Device >::ConstValuesAccessorType
+tnlEllpackIndexMultimap< Index, Device >::
+getValues( const IndexType& inputIndex ) const
+{
+   return ConstPortsType( this->values.getData(), inputIndex, this->valuesMaxCount );
+}
+
+#endif	/* TNLELLPACKGRAPH_IMPL_H */
+
diff --git a/src/mesh/initializer/tnlMeshSuperentityStorageInitializer.h b/src/mesh/initializer/tnlMeshSuperentityStorageInitializer.h
index 9375125b47..89c18bf540 100644
--- a/src/mesh/initializer/tnlMeshSuperentityStorageInitializer.h
+++ b/src/mesh/initializer/tnlMeshSuperentityStorageInitializer.h
@@ -105,11 +105,11 @@ class tnlMeshSuperentityStorageInitializerLayer< MeshConfig,
           */
          SuperentityStorageNetwork& superentityStorageNetwork = meshInitializer.template meshSuperentityStorageNetwork< EntityTopology, DimensionsTag >();
          //GlobalIndexType lastEntityIndex( 0 );
-         superentityStorageNetwork.setDimensions(
+         superentityStorageNetwork.setRanges(
             meshInitializer.template meshEntitiesArray< EntityDimensions >().getSize(),
             meshInitializer.template meshEntitiesArray< DimensionsTag >().getSize() );
          lastEntityIndex = 0;
-         typename SuperentityStorageNetwork::PortsAllocationVectorType storageNetworkAllocationVector;
+         typename SuperentityStorageNetwork::ValuesAllocationVectorType storageNetworkAllocationVector;
          storageNetworkAllocationVector.setSize( meshInitializer.template meshEntitiesArray< EntityDimensions >().getSize() );
          storageNetworkAllocationVector.setValue( 0 );
          for( GlobalIndexType i = 0; i < superentityIdsArray.getSize(); i++)
@@ -119,16 +119,16 @@ class tnlMeshSuperentityStorageInitializerLayer< MeshConfig,
             else
                lastEntityIndex++;                           
          }
-         superentityStorageNetwork.allocatePorts( storageNetworkAllocationVector );
+         superentityStorageNetwork.allocate( storageNetworkAllocationVector );
          lastEntityIndex = 0;
          LocalIndexType superentitiesCount( 0 );
-         typename SuperentityStorageNetwork::PortsType superentitiesIndecis = 
-            superentityStorageNetwork.getPorts( lastEntityIndex );
+         typename SuperentityStorageNetwork::ValuesAccessorType superentitiesIndecis = 
+            superentityStorageNetwork.getValues( lastEntityIndex );
          for( GlobalIndexType i = 0; i < superentityIdsArray.getSize(); i++)
          {
             if( indexPairs[ i ].entityIndex != lastEntityIndex )
             {
-               superentitiesIndecis = superentityStorageNetwork.getPorts( ++lastEntityIndex );
+               superentitiesIndecis = superentityStorageNetwork.getValues( ++lastEntityIndex );
                superentitiesCount = 0;
             }
             superentitiesIndecis[ superentitiesCount++ ] =  indexPairs[ i ].superentityIndex;
diff --git a/src/mesh/layers/tnlMeshSuperentityAccessor.h b/src/mesh/layers/tnlMeshSuperentityAccessor.h
index c4a758810a..76aa34e1f7 100644
--- a/src/mesh/layers/tnlMeshSuperentityAccessor.h
+++ b/src/mesh/layers/tnlMeshSuperentityAccessor.h
@@ -18,15 +18,15 @@
 #ifndef TNLMESHSUPERENTITYACCESSOR_H
 #define	TNLMESHSUPERENTITYACCESSOR_H
 
-template< typename NetworkPorts >
+template< typename IndexMultimapValues >
 class tnlMeshSuperentityAccessor
 {
    public:
       
-      typedef typename NetworkPorts::IndexType   GlobalIndexType;
-      typedef typename NetworkPorts::IndexType   LocalIndexType;
+      typedef typename IndexMultimapValues::IndexType   GlobalIndexType;
+      typedef typename IndexMultimapValues::IndexType   LocalIndexType;
       
-      // TODO: Add LocalIndexType to EllpackNetwork
+      // TODO: Add LocalIndexType to EllpackIndexMultimap
            
       LocalIndexType getSupernetitiesCount() const
       {
@@ -61,12 +61,12 @@ class tnlMeshSuperentityAccessor
       
    protected:
       
-      NetworkPorts ports;
+      IndexMultimapValues ports;
       
 };
 
-template< typename NetworkPorts >
-ostream& operator << ( ostream& str, const tnlMeshSuperentityAccessor< NetworkPorts >& superentityAccessor )
+template< typename IndexMultimapValues >
+ostream& operator << ( ostream& str, const tnlMeshSuperentityAccessor< IndexMultimapValues >& superentityAccessor )
 {
    superentityAccessor.print( str );
    return str;
diff --git a/src/mesh/traits/tnlMeshSuperentityTraits.h b/src/mesh/traits/tnlMeshSuperentityTraits.h
index 877cf8d903..9195241fb2 100644
--- a/src/mesh/traits/tnlMeshSuperentityTraits.h
+++ b/src/mesh/traits/tnlMeshSuperentityTraits.h
@@ -25,7 +25,7 @@
 #include <mesh/config/tnlMeshConfigBase.h>
 #include <mesh/topologies/tnlMeshEntityTopology.h>
 #include <mesh/traits/tnlMeshEntityTraits.h>
-#include <networks/tnlEllpackNetwork.h>
+#include <core/multimaps/tnlEllpackIndexMultimap.h>
 #include <mesh/layers/tnlMeshSuperentityAccessor.h>
 
 template< typename MeshConfig,
@@ -52,8 +52,8 @@ class tnlMeshSuperentityTraits
     */
    typedef tnlArray< GlobalIndexType, tnlHost, LocalIndexType >             StorageArrayType;
    
-   typedef tnlEllpackNetwork< GlobalIndexType, tnlHost >                        StorageNetworkType;
-   typedef tnlMeshSuperentityAccessor< typename StorageNetworkType::PortsType > SuperentityAccessorType;
+   typedef tnlEllpackIndexMultimap< GlobalIndexType, tnlHost >                        StorageNetworkType;
+   typedef tnlMeshSuperentityAccessor< typename StorageNetworkType::ValuesAccessorType > SuperentityAccessorType;
    
    /****
     * Type for passing the superentities indecis by the getSuperentitiesIndices()
diff --git a/src/networks/CMakeLists.txt b/src/networks/CMakeLists.txt
deleted file mode 100644
index 38032aa533..0000000000
--- a/src/networks/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-SET( headers tnlEllpackNetwork.h
-             tnlEllpackNetwork_impl.h
-             tnlEllpackNetworkPorts.h
-             tnlEllpackNetworkPorts_impl.h )
-
-SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/networks )
-set( common_SOURCES
-      )       
-
-IF( BUILD_CUDA )
-   set( tnl_networks_CUDA__SOURCES
-        ${common_SOURCES}      
-        PARENT_SCOPE )
-ENDIF()    
-
-set( tnl_networks_SOURCES     
-     ${common_SOURCES}
-     PARENT_SCOPE )
-        
-INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/networks )
\ No newline at end of file
diff --git a/src/networks/tnlEllpackNetwork_impl.h b/src/networks/tnlEllpackNetwork_impl.h
deleted file mode 100644
index 036d60847d..0000000000
--- a/src/networks/tnlEllpackNetwork_impl.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/***************************************************************************
-                          tnlEllpackNetwork_impl.h  -  description
-                             -------------------
-    begin                : Sep 9, 2015
-    copyright            : (C) 2015 by Tomas Oberhuber et al.
-    email                : tomas.oberhuber@fjfi.cvut.cz
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- ***************************************************************************/
-
-#ifndef TNLELLPACKNETWORK_IMPL_H
-#define	TNLELLPACKNETWORK_IMPL_H
-
-#include <networks/tnlEllpackNetwork.h>
-#include <networks/tnlEllpackNetworkPorts.h>
-
-
-template< typename Index,
-          typename Device >
-tnlEllpackNetwork< Index, Device >::
-tnlEllpackNetwork()
-:  inputs( 0 ), outputs( 0 ), portsMaxCount( 0 )
-{
-}
-
-template< typename Index,
-          typename Device >
-tnlString tnlEllpackNetwork< Index, Device > :: getType()
-{
-   return tnlString( "tnlEllpackNetwork< ") +
-          Device :: getDeviceType() +
-          tnlString( ", " ) +
-          tnlString( ::getType< Index >() ) +                    
-          tnlString( " >" );
-}
-
-template< typename Index,
-          typename Device >
-tnlString tnlEllpackNetwork< Index, Device >::getTypeVirtual() const
-{
-   return this->getType();
-}
-
-template< typename Index,
-          typename Device >
-void 
-tnlEllpackNetwork< Index, Device >::
-setDimensions( const IndexType inputs,
-               const IndexType outputs )
-{
-   this->inputs = inputs;
-   this->outputs = outputs;
-}
-
-template< typename Index,
-          typename Device >
-const Index
-tnlEllpackNetwork< Index, Device >::
-getInputsCount() const
-{
-   return this->inputs;
-}
-
-template< typename Index,
-          typename Device >
-const Index
-tnlEllpackNetwork< Index, Device >::
-getOutputsCount() const
-{
-   return this->outputs;
-}
-
-template< typename Index,
-          typename Device >
-void
-tnlEllpackNetwork< Index, Device >::
-allocatePorts( const PortsAllocationVectorType& portsCount )
-{
-   tnlAssert( portsCount.getSize() == this->inputs,
-              cerr << "portsCount.getSize() =  " << portsCount.getSize()
-                   << "this->inputs = " << this->inputs );
-   this->portsMaxCount = portsCount.max();
-   
-   tnlAssert( this->portsMaxCount >= 0 && this->portsMaxCount <= this->outputs, 
-              cerr << "this->portsMaxCount = " << this->portsMaxCount
-                   << " this->outputs = " << this->outputs );
-   this->ports.setSize( this->inputs * this->portsMaxCount );
-}
-
-template< typename Index,
-          typename Device >
-typename tnlEllpackNetwork< Index, Device >::PortsType 
-tnlEllpackNetwork< Index, Device >::
-getPorts( const IndexType& inputIndex )
-{
-   return PortsType( this->ports.getData(), inputIndex, this->portsMaxCount );
-}
-
-template< typename Index,
-          typename Device >
-typename tnlEllpackNetwork< Index, Device >::ConstPortsType
-tnlEllpackNetwork< Index, Device >::
-getPorts( const IndexType& inputIndex ) const
-{
-   return ConstPortsType( this->ports.getData(), inputIndex, this->portsMaxCount );
-}
-
-#endif	/* TNLELLPACKGRAPH_IMPL_H */
-
diff --git a/tests/unit-tests/CMakeLists.txt b/tests/unit-tests/CMakeLists.txt
index 8013b01c12..d3ac6430a9 100755
--- a/tests/unit-tests/CMakeLists.txt
+++ b/tests/unit-tests/CMakeLists.txt
@@ -1,5 +1,4 @@
 ADD_SUBDIRECTORY( core )
-ADD_SUBDIRECTORY( networks )
 ADD_SUBDIRECTORY( matrices )
 ADD_SUBDIRECTORY( mesh )
 ADD_SUBDIRECTORY( operators )
@@ -16,7 +15,7 @@ ADD_TEST( core/vectors/tnlVectorOperationsTest${mpiExt}${debugExt} ${EXECUTABLE_
 ADD_TEST( core/vectors/tnlVectorTest${mpiExt}${debugExt} ${EXECUTABLE_OUTPUT_PATH}/tnlVectorTest${mpiExt}${debugExt} )
 ADD_TEST( core/vectors/tnlStaticVectorTest${mpiExt}${debugExt} ${EXECUTABLE_OUTPUT_PATH}/tnlStaticVectorTest${mpiExt}${debugExt} )
 
-ADD_TEST( networks/tnlEllpackNetworkTest{mpiExt}${debugExt} ${EXECUTABLE_OUTPUT_PATH}/tnlEllpackNetworTest${mpiExt}${debugExt} )
+ADD_TEST( core/multimaps/tnlEllpackIndexMultimapTest{mpiExt}${debugExt} ${EXECUTABLE_OUTPUT_PATH}/tnlEllpackIndexMultimapTest${mpiExt}${debugExt} )
 
 ADD_TEST( matrices/tnlDenseMatrixTest${mpiExt}${debugExt} ${EXECUTABLE_OUTPUT_PATH}/tnlDenseMatrixTest${mpiExt}${debugExt} )
 ADD_TEST( matrices/tnlTridiagonalMatrixTest${mpiExt}${debugExt} ${EXECUTABLE_OUTPUT_PATH}/tnlTridiagonalMatrixTest${mpiExt}${debugExt} )
diff --git a/tests/unit-tests/core/CMakeLists.txt b/tests/unit-tests/core/CMakeLists.txt
index 90f40ff72c..ce4b4a9135 100755
--- a/tests/unit-tests/core/CMakeLists.txt
+++ b/tests/unit-tests/core/CMakeLists.txt
@@ -1,6 +1,7 @@
 ADD_SUBDIRECTORY( arrays )
 ADD_SUBDIRECTORY( cuda )
 ADD_SUBDIRECTORY( vectors )
+ADD_SUBDIRECTORY( multimaps )
 
 set( headers tnlFileTester.h
              tnlStringTester.h
diff --git a/tests/unit-tests/core/multimaps/CMakeLists.txt b/tests/unit-tests/core/multimaps/CMakeLists.txt
new file mode 100644
index 0000000000..cb8216cc23
--- /dev/null
+++ b/tests/unit-tests/core/multimaps/CMakeLists.txt
@@ -0,0 +1,5 @@
+set( headers tnlIndexMultimapTester.h )
+
+ADD_EXECUTABLE( tnlEllpackIndexMultimapTest${mpiExt}${debugExt} ${headers} tnlEllpackIndexMultimapTest.cpp )
+TARGET_LINK_LIBRARIES( tnlEllpackIndexMultimapTest${mpiExt}${debugExt} ${CPPUNIT_LIBRARIES}
+                                                              tnl${mpiExt}${debugExt}-0.1 )
\ No newline at end of file
diff --git a/tests/unit-tests/networks/tnlEllpackNetworkTest.cpp b/tests/unit-tests/core/multimaps/tnlEllpackIndexMultimapTest.cpp
similarity index 74%
rename from tests/unit-tests/networks/tnlEllpackNetworkTest.cpp
rename to tests/unit-tests/core/multimaps/tnlEllpackIndexMultimapTest.cpp
index 83e9ac939e..b28bc7b83b 100644
--- a/tests/unit-tests/networks/tnlEllpackNetworkTest.cpp
+++ b/tests/unit-tests/core/multimaps/tnlEllpackIndexMultimapTest.cpp
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          tnlEllpackNetworkTest.cpp  -  description
+                          tnlEllpackIndexMultimapTest.cpp  -  description
                              -------------------
     begin                : Sep 10, 2015
     copyright            : (C) 2015 by Tomas Oberhuber
@@ -19,15 +19,15 @@
 #include <core/tnlHost.h>
 #include <cstdlib>
 
-#include <networks/tnlEllpackNetwork.h>
-#include "tnlNetworkTester.h"
-#include "../tnlUnitTestStarter.h"
+#include <core/multimaps/tnlEllpackIndexMultimap.h>
+#include "tnlIndexMultimapTester.h"
+#include "../../tnlUnitTestStarter.h"
 
 int main( int argc, char* argv[] )
 {
 #ifdef HAVE_CPPUNIT
-   if( ! tnlUnitTestStarter :: run< tnlNetworkTester< tnlEllpackNetwork< int, tnlHost > > >() ||
-       ! tnlUnitTestStarter :: run< tnlNetworkTester< tnlEllpackNetwork< long int, tnlHost > > >() 
+   if( ! tnlUnitTestStarter :: run< tnlIndexMultimapTester< tnlEllpackIndexMultimap< int, tnlHost > > >() ||
+       ! tnlUnitTestStarter :: run< tnlIndexMultimapTester< tnlEllpackIndexMultimap< long int, tnlHost > > >() 
        )
      return EXIT_FAILURE;
    return EXIT_SUCCESS;
diff --git a/tests/unit-tests/networks/tnlNetworkTester.h b/tests/unit-tests/core/multimaps/tnlIndexMultimapTester.h
similarity index 75%
rename from tests/unit-tests/networks/tnlNetworkTester.h
rename to tests/unit-tests/core/multimaps/tnlIndexMultimapTester.h
index b3170a5b46..3dcb662623 100644
--- a/tests/unit-tests/networks/tnlNetworkTester.h
+++ b/tests/unit-tests/core/multimaps/tnlIndexMultimapTester.h
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          tnlNetworkTester.h  -  description
+                          tnlIndexMultimapTester.h  -  description
                              -------------------
     begin                : Sep 10, 2015
     copyright            : (C) 2015 by Tomas Oberhuber
@@ -15,16 +15,16 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef TNLSPARSENETWORKTESTER_H_
-#define TNLSPARSENETWORKTESTER_H_
+#ifndef TNLINDEXMULTIMAPTESTER_H_
+#define TNLINDEXMULTIMAPTESTER_H_
 
-template< typename Network,
+template< typename Multimap,
           typename TestSetup >
-class tnlNetworkTesterNetworkSetter
+class tnlIndexMultimapTesterSetter
 {
    public:
 
-   static bool setup( Network& graph )
+   static bool setup( Multimap& multimap )
    {
       return true;
    }
@@ -40,118 +40,118 @@ class tnlNetworkTesterNetworkSetter
 #include <core/vectors/tnlVector.h>
 
 #ifdef HAVE_CUDA
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setElementFastTestCudaKernel( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setElementFastTestCudaKernel( IndexMultimapType* graph,
                                                                      bool* testResult );
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setElementFast_DiagonalNetworkTestCudaKernel( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setElementFast_DiagonalIndexMultimapTestCudaKernel( IndexMultimapType* graph,
                                                                                     bool* testResult );
 
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setElementFast_DenseNetworkTestCudaKernel1( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setElementFast_DenseIndexMultimapTestCudaKernel1( IndexMultimapType* graph,
                                                                                   bool* testResult );
 
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setElementFast_DenseNetworkTestCudaKernel2( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setElementFast_DenseIndexMultimapTestCudaKernel2( IndexMultimapType* graph,
                                                                                   bool* testResult );
 
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setElementFast_LowerTriangularNetworkTestCudaKernel1( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setElementFast_LowerTriangularIndexMultimapTestCudaKernel1( IndexMultimapType* graph,
                                                                                             bool* testResult );
 
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setElementFast_LowerTriangularNetworkTestCudaKernel2( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setElementFast_LowerTriangularIndexMultimapTestCudaKernel2( IndexMultimapType* graph,
                                                                                             bool* testResult );
 
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setRowFast_DiagonalNetworkTestCudaKernel( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setRowFast_DiagonalIndexMultimapTestCudaKernel( IndexMultimapType* graph,
                                                                                 bool* testResult );
 
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setRowFast_DenseNetworkTestCudaKernel1( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setRowFast_DenseIndexMultimapTestCudaKernel1( IndexMultimapType* graph,
                                                                               bool* testResult );
 
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setRowFast_DenseNetworkTestCudaKernel2( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setRowFast_DenseIndexMultimapTestCudaKernel2( IndexMultimapType* graph,
                                                                               bool* testResult );
 
-template< typename NetworkType >
-__global__ void tnlNetworkTester__setRowFast_LowerTriangularNetworkTestCudaKernel( NetworkType* graph,
+template< typename IndexMultimapType >
+__global__ void tnlIndexMultimapTester__setRowFast_LowerTriangularIndexMultimapTestCudaKernel( IndexMultimapType* graph,
                                                                                        bool* testResult );
 
 #endif
 
-class tnlNetworkTestDefaultSetup
+class tnlIndexMultimapTestDefaultSetup
 {};
 
-template< typename Network,
-          typename NetworkSetup = tnlNetworkTestDefaultSetup >
-class tnlNetworkTester : public CppUnit :: TestCase
+template< typename IndexMultimap,
+          typename IndexMultimapSetup = tnlIndexMultimapTestDefaultSetup >
+class tnlIndexMultimapTester : public CppUnit :: TestCase
 {
    public:
-      typedef Network                                                    NetworkType;
-      typedef typename Network::DeviceType                               DeviceType;
-      typedef typename Network::IndexType                                IndexType;
-      typedef tnlNetworkTester< NetworkType, NetworkSetup >              TesterType;
-      typedef tnlNetworkTesterNetworkSetter< NetworkType, NetworkSetup > NetworkSetter;
+      typedef IndexMultimap                                                    IndexMultimapType;
+      typedef typename IndexMultimap::DeviceType                               DeviceType;
+      typedef typename IndexMultimap::IndexType                                IndexType;
+      typedef tnlIndexMultimapTester< IndexMultimapType, IndexMultimapSetup >              TesterType;
+      typedef tnlIndexMultimapTesterSetter< IndexMultimapType, IndexMultimapSetup > IndexMultimapSetter;
       typedef typename CppUnit::TestCaller< TesterType >                 TestCallerType;
       
-      typedef typename NetworkType::PortsAllocationVectorType  PortsAllocationVectorType;
-      typedef typename NetworkType::PortsType                  PortsType; 
+      typedef typename IndexMultimapType::ValuesAllocationVectorType  ValuesAllocationVectorType;
+      typedef typename IndexMultimapType::ValuesAccessorType                  ValuesAccessorType; 
 
-      tnlNetworkTester(){};
+      tnlIndexMultimapTester(){};
 
       virtual
-      ~tnlNetworkTester(){};
+      ~tnlIndexMultimapTester(){};
 
       static CppUnit :: Test* suite()
       {
-         tnlString testSuiteName( "tnlNetworkTester< " );
-         testSuiteName += NetworkType::getType() + " >";
+         tnlString testSuiteName( "tnlIndexMultimapTester< " );
+         testSuiteName += IndexMultimapType::getType() + " >";
 
          CppUnit :: TestSuite* suiteOfTests = new CppUnit :: TestSuite( testSuiteName.getString() );
          CppUnit :: TestResult result;
 
-         suiteOfTests->addTest( new TestCallerType( "setDimensionsTest", &TesterType::setDimensionsTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setRangesTest", &TesterType::setRangesTest ) );
          //suiteOfTests->addTest( new TestCallerType( "setLikeTest", &TesterType::setLikeTest ) );
          suiteOfTests->addTest( new TestCallerType( "setElementTest", &TesterType::setElementTest ) );
          /*suiteOfTests->addTest( new TestCallerType( "setElementFastTest", &TesterType::setElementFastTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setElement_DiagonalNetworkTest", &TesterType::setElement_DiagonalNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setElementFast_DiagonalNetworkTest", &TesterType::setElementFast_DiagonalNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setElement_DenseNetworkTest", &TesterType::setElement_DenseNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setElementFast_DenseNetworkTest", &TesterType::setElementFast_DenseNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setElement_LowerTriangularNetworkTest", &TesterType::setElement_LowerTriangularNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setElementFast_LowerTriangularNetworkTest", &TesterType::setElementFast_LowerTriangularNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setRow_DiagonalNetworkTest", &TesterType::setRow_DiagonalNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setRowFast_DiagonalNetworkTest", &TesterType::setRowFast_DiagonalNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setRow_DenseNetworkTest", &TesterType::setRow_DenseNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setRowFast_DenseNetworkTest", &TesterType::setRowFast_DenseNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setRow_LowerTriangularNetworkTest", &TesterType::setRow_LowerTriangularNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "setRowFast_LowerTriangularNetworkTest", &TesterType::setRowFast_LowerTriangularNetworkTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setElement_DiagonalIndexMultimapTest", &TesterType::setElement_DiagonalIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setElementFast_DiagonalIndexMultimapTest", &TesterType::setElementFast_DiagonalIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setElement_DenseIndexMultimapTest", &TesterType::setElement_DenseIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setElementFast_DenseIndexMultimapTest", &TesterType::setElementFast_DenseIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setElement_LowerTriangularIndexMultimapTest", &TesterType::setElement_LowerTriangularIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setElementFast_LowerTriangularIndexMultimapTest", &TesterType::setElementFast_LowerTriangularIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setRow_DiagonalIndexMultimapTest", &TesterType::setRow_DiagonalIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setRowFast_DiagonalIndexMultimapTest", &TesterType::setRowFast_DiagonalIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setRow_DenseIndexMultimapTest", &TesterType::setRow_DenseIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setRowFast_DenseIndexMultimapTest", &TesterType::setRowFast_DenseIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setRow_LowerTriangularIndexMultimapTest", &TesterType::setRow_LowerTriangularIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "setRowFast_LowerTriangularIndexMultimapTest", &TesterType::setRowFast_LowerTriangularIndexMultimapTest ) );
          suiteOfTests->addTest( new TestCallerType( "addElementTest", &TesterType::addElementTest ) );
-         suiteOfTests->addTest( new TestCallerType( "vectorProduct_DiagonalNetworkTest", &TesterType::vectorProduct_DiagonalNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "vectorProduct_DenseNetworkTest", &TesterType::vectorProduct_DenseNetworkTest ) );
-         suiteOfTests->addTest( new TestCallerType( "vectorProduct_LowerTriangularNetworkTest", &TesterType::vectorProduct_LowerTriangularNetworkTest ) );
+         suiteOfTests->addTest( new TestCallerType( "vectorProduct_DiagonalIndexMultimapTest", &TesterType::vectorProduct_DiagonalIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "vectorProduct_DenseIndexMultimapTest", &TesterType::vectorProduct_DenseIndexMultimapTest ) );
+         suiteOfTests->addTest( new TestCallerType( "vectorProduct_LowerTriangularIndexMultimapTest", &TesterType::vectorProduct_LowerTriangularIndexMultimapTest ) );
          /*suiteOfTests -> addTest( new TestCallerType( "graphTranspositionTest", &TesterType::graphTranspositionTest ) );
-         suiteOfTests -> addTest( new TestCallerType( "addNetworkTest", &TesterType::addNetworkTest ) );*/
+         suiteOfTests -> addTest( new TestCallerType( "addIndexMultimapTest", &TesterType::addIndexMultimapTest ) );*/
 
          return suiteOfTests;
       }
 
-      void setDimensionsTest()
+      void setRangesTest()
       {
-         NetworkType n;
-         NetworkSetter::setup( n );
-         n.setDimensions( 10, 10 );
-         CPPUNIT_ASSERT( n.getInputsCount() == 10 );
-         CPPUNIT_ASSERT( n.getOutputsCount() == 10 );
+         IndexMultimapType n;
+         IndexMultimapSetter::setup( n );
+         n.setRanges( 10, 10 );
+         CPPUNIT_ASSERT( n.getKeysRange() == 10 );
+         CPPUNIT_ASSERT( n.getValuesRange() == 10 );
       }
 
       /*void setLikeTest()
       {
-         NetworkType m1, m2;
-         NetworkSetter::setup( m1 );
-         NetworkSetter::setup( m2 );
+         IndexMultimapType m1, m2;
+         IndexMultimapSetter::setup( m1 );
+         IndexMultimapSetter::setup( m2 );
          m1.setDimensions( 10, 10 );
          IndexVector rowLengths;
          rowLengths.setSize( m1.getRows() );
@@ -166,16 +166,16 @@ class tnlNetworkTester : public CppUnit :: TestCase
        */
       void setElementTest()
       {
-         NetworkType n;
-         NetworkSetter::setup( n );
-         n.setDimensions( 10, 10 );
+         IndexMultimapType n;
+         IndexMultimapSetter::setup( n );
+         n.setRanges( 10, 10 );
          
-         PortsAllocationVectorType portsAllocationVector;
-         portsAllocationVector.setSize( n.getInputsCount() );
+         ValuesAllocationVectorType portsAllocationVector;
+         portsAllocationVector.setSize( n.getKeysRange() );
          portsAllocationVector.setValue( 7 );
-         n.allocatePorts( portsAllocationVector );
+         n.allocate( portsAllocationVector );
 
-         PortsType p = n.getPorts( 0 );
+         ValuesAccessorType p = n.getValues( 0 );
          for( int i = 0; i < 7; i++ )
          {
             p.setOutput( i, i );
@@ -191,8 +191,8 @@ class tnlNetworkTester : public CppUnit :: TestCase
 
    void setElementFastTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -209,12 +209,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::getDevice() == tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
-         tnlNetworkTester__setElementFastTestCudaKernel< NetworkType >
+         tnlIndexMultimapTester__setElementFastTestCudaKernel< IndexMultimapType >
                                                             <<< cudaGridSize, cudaBlockSize >>>
                                                             ( kernel_graph,
                                                               kernel_testResult );
@@ -229,10 +229,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
          CPPUNIT_ASSERT( m.getElement( 0, i ) == i );
    }
 
-   void setElement_DiagonalNetworkTest()
+   void setElement_DiagonalIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -254,10 +254,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
       }
    }
 
-   void setElementFast_DiagonalNetworkTest()
+   void setElementFast_DiagonalIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -272,12 +272,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
-         tnlNetworkTester__setElementFast_DiagonalNetworkTestCudaKernel< NetworkType >
+         tnlIndexMultimapTester__setElementFast_DiagonalIndexMultimapTestCudaKernel< IndexMultimapType >
                                                                            <<< cudaGridSize, cudaBlockSize >>>
                                                                            ( kernel_graph,
                                                                              kernel_testResult );
@@ -300,10 +300,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
       }
    }
 
-   void setElement_DenseNetworkTest()
+   void setElement_DenseIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -335,10 +335,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
             CPPUNIT_ASSERT( m.getElement( i, j ) == i+j );
    }
 
-   void setElementFast_DenseNetworkTest()
+   void setElementFast_DenseIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -356,12 +356,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
-         tnlNetworkTester__setElementFast_DenseNetworkTestCudaKernel1< NetworkType >
+         tnlIndexMultimapTester__setElementFast_DenseIndexMultimapTestCudaKernel1< IndexMultimapType >
                                                                          <<< cudaGridSize, cudaBlockSize >>>
                                                                          ( kernel_graph,
                                                                            kernel_testResult );
@@ -391,12 +391,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
-         tnlNetworkTester__setElementFast_DenseNetworkTestCudaKernel2< NetworkType >
+         tnlIndexMultimapTester__setElementFast_DenseIndexMultimapTestCudaKernel2< IndexMultimapType >
                                                                          <<< cudaGridSize, cudaBlockSize >>>
                                                                          ( kernel_graph,
                                                                            kernel_testResult );
@@ -413,10 +413,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
    }
 
 
-   void setElement_LowerTriangularNetworkTest()
+   void setElement_LowerTriangularIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -450,10 +450,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
                CPPUNIT_ASSERT( m.getElement( i, j ) == 0 );
    }
 
-   void setElementFast_LowerTriangularNetworkTest()
+   void setElementFast_LowerTriangularIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -470,12 +470,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
-         tnlNetworkTester__setElementFast_LowerTriangularNetworkTestCudaKernel1< NetworkType >
+         tnlIndexMultimapTester__setElementFast_LowerTriangularIndexMultimapTestCudaKernel1< IndexMultimapType >
                                                                                    <<< cudaGridSize, cudaBlockSize >>>
                                                                                    ( kernel_graph,
                                                                                      kernel_testResult );
@@ -505,12 +505,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
-         tnlNetworkTester__setElementFast_LowerTriangularNetworkTestCudaKernel2< NetworkType >
+         tnlIndexMultimapTester__setElementFast_LowerTriangularIndexMultimapTestCudaKernel2< IndexMultimapType >
                                                                                    <<< cudaGridSize, cudaBlockSize >>>
                                                                                    ( kernel_graph,
                                                                                      kernel_testResult );
@@ -532,8 +532,8 @@ class tnlNetworkTester : public CppUnit :: TestCase
 
    void addElementTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -560,10 +560,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
    /****
     * Set row tests
     */
-   void setRow_DiagonalNetworkTest()
+   void setRow_DiagonalIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -591,10 +591,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
       }
    }
 
-   void setRowFast_DiagonalNetworkTest()
+   void setRowFast_DiagonalIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -616,13 +616,13 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
          int sharedMemory = 100 * ( sizeof( IndexType ) + sizeof( RealType ) );
-         tnlNetworkTester__setRowFast_DiagonalNetworkTestCudaKernel< NetworkType >
+         tnlIndexMultimapTester__setRowFast_DiagonalIndexMultimapTestCudaKernel< IndexMultimapType >
                                                                        <<< cudaGridSize, cudaBlockSize, sharedMemory >>>
                                                                        ( kernel_graph,
                                                                          kernel_testResult );
@@ -645,10 +645,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
       }
    }
 
-   void setRow_DenseNetworkTest()
+   void setRow_DenseIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -692,10 +692,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
             CPPUNIT_ASSERT( m.getElement( i, j ) == i+j );
    }
 
-   void setRowFast_DenseNetworkTest()
+   void setRowFast_DenseIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -723,13 +723,13 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
          int sharedMemory = 100 * ( sizeof( IndexType ) + sizeof( RealType ) );
-         tnlNetworkTester__setRowFast_DenseNetworkTestCudaKernel1< NetworkType >
+         tnlIndexMultimapTester__setRowFast_DenseIndexMultimapTestCudaKernel1< IndexMultimapType >
                                                                         <<< cudaGridSize, cudaBlockSize, sharedMemory >>>
                                                                         ( kernel_graph,
                                                                           kernel_testResult );
@@ -763,13 +763,13 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
          int sharedMemory = 100 * ( sizeof( IndexType ) + sizeof( RealType ) );
-         tnlNetworkTester__setRowFast_DenseNetworkTestCudaKernel2< NetworkType >
+         tnlIndexMultimapTester__setRowFast_DenseIndexMultimapTestCudaKernel2< IndexMultimapType >
                                                                      <<< cudaGridSize, cudaBlockSize, sharedMemory >>>
                                                                      ( kernel_graph,
                                                                        kernel_testResult );
@@ -785,10 +785,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
             CPPUNIT_ASSERT( m.getElement( i, j ) == i+j );
    }
 
-   void setRow_LowerTriangularNetworkTest()
+   void setRow_LowerTriangularIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -835,10 +835,10 @@ class tnlNetworkTester : public CppUnit :: TestCase
                CPPUNIT_ASSERT( m.getElement( i, j ) == 0 );
    }
 
-   void setRowFast_LowerTriangularNetworkTest()
+   void setRowFast_LowerTriangularIndexMultimapTest()
    {
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( 10, 10 );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -864,13 +864,13 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
          int sharedMemory = 100 * ( sizeof( IndexType ) + sizeof( RealType ) );
-         tnlNetworkTester__setRowFast_LowerTriangularNetworkTestCudaKernel< NetworkType >
+         tnlIndexMultimapTester__setRowFast_LowerTriangularIndexMultimapTestCudaKernel< IndexMultimapType >
                                                                               <<< cudaGridSize, cudaBlockSize, sharedMemory >>>
                                                                               ( kernel_graph,
                                                                                 kernel_testResult );
@@ -904,13 +904,13 @@ class tnlNetworkTester : public CppUnit :: TestCase
       if( DeviceType::DeviceType == ( int ) tnlCudaDevice )
       {
 #ifdef HAVE_CUDA
-         NetworkType* kernel_graph = tnlCuda::passToDevice( m );
+         IndexMultimapType* kernel_graph = tnlCuda::passToDevice( m );
          bool testResult( true );
          bool* kernel_testResult = tnlCuda::passToDevice( testResult );
          checkCudaDevice;
          dim3 cudaBlockSize( 256 ), cudaGridSize( 1 );
          int sharedMemory = 100 * ( sizeof( IndexType ) + sizeof( RealType ) );
-         tnlNetworkTester__setRowFast_LowerTriangularNetworkTestCudaKernel< NetworkType >
+         tnlIndexMultimapTester__setRowFast_LowerTriangularIndexMultimapTestCudaKernel< IndexMultimapType >
                                                                               <<< cudaGridSize, cudaBlockSize, sharedMemory >>>
                                                                               ( kernel_graph,
                                                                                 kernel_testResult );
@@ -930,14 +930,14 @@ class tnlNetworkTester : public CppUnit :: TestCase
    }
 
 
-   void vectorProduct_DiagonalNetworkTest()
+   void vectorProduct_DiagonalIndexMultimapTest()
    {
       const int size = 10;
       VectorType v, w;
       v.setSize( size );
       w.setSize( size );
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( size, size );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -954,14 +954,14 @@ class tnlNetworkTester : public CppUnit :: TestCase
          CPPUNIT_ASSERT( w.getElement( i ) == i*i );
    }
 
-   void vectorProduct_DenseNetworkTest()
+   void vectorProduct_DenseIndexMultimapTest()
    {
       const int size = 10;
       VectorType v, w;
       v.setSize( size );
       w.setSize( size );
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( size, size );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -979,14 +979,14 @@ class tnlNetworkTester : public CppUnit :: TestCase
          CPPUNIT_ASSERT( w.getElement( i ) == i*size );
    }
 
-   void vectorProduct_LowerTriangularNetworkTest()
+   void vectorProduct_LowerTriangularIndexMultimapTest()
    {
       const int size = 10;
       VectorType v, w;
       v.setSize( size );
       w.setSize( size );
-      NetworkType m;
-      NetworkSetter::setup( m );
+      IndexMultimapType m;
+      IndexMultimapSetter::setup( m );
       m.setDimensions( size, size );
       IndexVector rowLengths;
       rowLengths.setSize( m.getRows() );
@@ -1005,7 +1005,7 @@ class tnlNetworkTester : public CppUnit :: TestCase
    }
 
 
-   void addNetworkTest()
+   void addIndexMultimapTest()
    {
    }
 
@@ -1017,8 +1017,8 @@ class tnlNetworkTester : public CppUnit :: TestCase
 };
 
 #ifdef HAVE_CUDA
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setElementFastTestCudaKernel( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setElementFastTestCudaKernel( IndexMultimapType* graph,
                                                                         bool* testResult )
    {
       if( threadIdx.x == 0 )
@@ -1031,19 +1031,19 @@ class tnlNetworkTester : public CppUnit :: TestCase
       }
    }
 
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setElementFast_DiagonalNetworkTestCudaKernel( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setElementFast_DiagonalIndexMultimapTestCudaKernel( IndexMultimapType* graph,
                                                                                        bool* testResult )
    {
       if( threadIdx.x < graph->getRows() )
          graph->setElementFast( threadIdx.x, threadIdx.x, threadIdx.x );
    }
 
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setElementFast_DenseNetworkTestCudaKernel1( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setElementFast_DenseIndexMultimapTestCudaKernel1( IndexMultimapType* graph,
                                                                                      bool* testResult )
    {
-      const typename NetworkType::IndexType i = threadIdx.x;
+      const typename IndexMultimapType::IndexType i = threadIdx.x;
       if( i < graph->getRows() )
       {
          graph->setElementFast( i, i, i );
@@ -1052,11 +1052,11 @@ class tnlNetworkTester : public CppUnit :: TestCase
       }
    }
 
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setElementFast_DenseNetworkTestCudaKernel2( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setElementFast_DenseIndexMultimapTestCudaKernel2( IndexMultimapType* graph,
                                                                                      bool* testResult )
    {
-      const typename NetworkType::IndexType i = threadIdx.x;
+      const typename IndexMultimapType::IndexType i = threadIdx.x;
       if( i < graph->getRows() )
       {
          for( int j = graph->getColumns() -1; j >= 0; j-- )
@@ -1064,11 +1064,11 @@ class tnlNetworkTester : public CppUnit :: TestCase
       }
    }
 
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setElementFast_LowerTriangularNetworkTestCudaKernel1( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setElementFast_LowerTriangularIndexMultimapTestCudaKernel1( IndexMultimapType* graph,
                                                                                                bool* testResult )
    {
-      const typename NetworkType::IndexType i = threadIdx.x;
+      const typename IndexMultimapType::IndexType i = threadIdx.x;
       if( i < graph->getRows() )
       {
          for( int j = 0; j <= i; j++ )
@@ -1076,11 +1076,11 @@ class tnlNetworkTester : public CppUnit :: TestCase
       }
    }
 
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setElementFast_LowerTriangularNetworkTestCudaKernel2( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setElementFast_LowerTriangularIndexMultimapTestCudaKernel2( IndexMultimapType* graph,
                                                                                                bool* testResult )
    {
-      const typename NetworkType::IndexType i = threadIdx.x;
+      const typename IndexMultimapType::IndexType i = threadIdx.x;
       if( i < graph->getRows() )
       {
          for( int j = i; j >= 0; j-- )
@@ -1091,12 +1091,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
    /****
     * Set row tests kernels
     */
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setRowFast_DiagonalNetworkTestCudaKernel( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setRowFast_DiagonalIndexMultimapTestCudaKernel( IndexMultimapType* graph,
                                                                                    bool* testResult )
    {
-      typedef typename NetworkType::RealType RealType;
-      typedef typename NetworkType::IndexType IndexType;
+      typedef typename IndexMultimapType::RealType RealType;
+      typedef typename IndexMultimapType::IndexType IndexType;
 
       const IndexType row = threadIdx.x;
       if( row >= graph->getRows() )
@@ -1112,12 +1112,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       graph->setRowFast( row, &columnIndexes[ row ], values, 1 );
    }
 
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setRowFast_DenseNetworkTestCudaKernel1( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setRowFast_DenseIndexMultimapTestCudaKernel1( IndexMultimapType* graph,
                                                                                  bool* testResult )
    {
-      typedef typename NetworkType::RealType RealType;
-      typedef typename NetworkType::IndexType IndexType;
+      typedef typename IndexMultimapType::RealType RealType;
+      typedef typename IndexMultimapType::IndexType IndexType;
 
       const IndexType row = threadIdx.x;
       if( row >= graph->getRows() )
@@ -1139,12 +1139,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       graph->setRowFast( row, columnIndexes, values, 10 );
    }
 
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setRowFast_DenseNetworkTestCudaKernel2( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setRowFast_DenseIndexMultimapTestCudaKernel2( IndexMultimapType* graph,
                                                                                  bool* testResult )
    {
-      typedef typename NetworkType::RealType RealType;
-      typedef typename NetworkType::IndexType IndexType;
+      typedef typename IndexMultimapType::RealType RealType;
+      typedef typename IndexMultimapType::IndexType IndexType;
 
       const IndexType row = threadIdx.x;
       if( row >= graph->getRows() )
@@ -1163,12 +1163,12 @@ class tnlNetworkTester : public CppUnit :: TestCase
       graph->setRowFast( row, columnIndexes, values, 10 );
    }
 
-   template< typename NetworkType >
-   __global__ void tnlNetworkTester__setRowFast_LowerTriangularNetworkTestCudaKernel( NetworkType* graph,
+   template< typename IndexMultimapType >
+   __global__ void tnlIndexMultimapTester__setRowFast_LowerTriangularIndexMultimapTestCudaKernel( IndexMultimapType* graph,
                                                                                           bool* testResult )
    {
-      typedef typename NetworkType::RealType RealType;
-      typedef typename NetworkType::IndexType IndexType;
+      typedef typename IndexMultimapType::RealType RealType;
+      typedef typename IndexMultimapType::IndexType IndexType;
 
       const IndexType row = threadIdx.x;
       if( row >= graph->getRows() )
@@ -1192,4 +1192,4 @@ class tnlNetworkTester : public CppUnit :: TestCase
 
 #endif
 
-#endif /* TNLSPARSEMATRIXTESTER_H_ */
+#endif /* TNLINDEXMULTIMAPTESTER_H_ */
diff --git a/tests/unit-tests/networks/CMakeLists.txt b/tests/unit-tests/networks/CMakeLists.txt
deleted file mode 100644
index 63f3529718..0000000000
--- a/tests/unit-tests/networks/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set( headers tnlNetworkTester.h )
-
-ADD_EXECUTABLE( tnlEllpackNetworkTest${mpiExt}${debugExt} ${headers} tnlEllpackNetworkTest.cpp )
-TARGET_LINK_LIBRARIES( tnlEllpackNetworkTest${mpiExt}${debugExt} ${CPPUNIT_LIBRARIES}
-                                                              tnl${mpiExt}${debugExt}-0.1 )
\ No newline at end of file
diff --git a/tools/share/.mgrid-view.cfg.desc.swp b/tools/share/.mgrid-view.cfg.desc.swp
deleted file mode 100644
index 1e92d50bb94c0c0389ccabfd84c4cca5de9d7338..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 12288
zcmeI&KX21O6aerm>PP{>!uT4NRH~hX4j?fAVhW<_1OhCCF80|z>3lZ#Cuxe{6IA^?
zEFi?hw_!qz@Xm2iQA)$YQoWO266M`{Isaa!#FOE(@jl#%M-10B#!ik8A8&s4?Db8?
z>WMI=$A^$RXO&Hq)>XsboU<pS-v4em(7qZ}nauOZ)wQzGFy0&3k{dCo3L~><D#a{L
z^CHfKP1m%gGzpNvIsxzU=<XKVyFD7->TSb~>rdBJP@V)xfCNZ@1W14cNPq-L;DQOb
zW`q62Yr2GS8Dpahe4<4HBtQZrKmsH{0wh2JBtQZrKmsIiK?Hcl*nEqzj~L<q|L_~Y
zkE@J*$M}MAg7E-j6XWX@#*Q)WV|>H?pSrpap_Ud2kN^pg011!)36KB@kN^pgz<(5Y
zx0^gPg|CEm7Q(I4Moy$IK<dUj;5viayYMpOj>oU=F#xd6ge{9iluIR|yfzhg{od5c
z-VP)Oi<*#vMJk3zT*E{_p?#xjw+pzn>t_U4U{kI{e-saQ@Du)A$-Y-kHfj#8#C~3<
zPS)6L4uzZw4R|X!-eTT0liG<wnC0n?A}f!?seZ{zXy2*xw%g(&&aR!W)V}!V+QXIF
z=YOwN(mKEcwGc{7g^HBa!Y+@UJn1&HIj{m}H7jLW!b~a^R5Qb8y1R;Hx79H%8lIkx
gJ-eozemhy)-wp#w#_jhZ474qI%L-Hb2F3^M7tyoqS^xk5

diff --git a/tools/src/.compare-objects.h.swp b/tools/src/.compare-objects.h.swp
deleted file mode 100644
index e45564de31a4b2fd3beb3dad2e90683e7e6a4c85..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 12288
zcmeI2OHUI~6vr>P@_`y%YYsFLsBNb$MiB^VFjV6M6G2x7=W&N#n7OyPGb5B3H!l4O
zZgk@ZFwwBp51`S{V8o4X*z38aR9c`ku?s`aN&eHBIgdH_H#3{gaq<st-hoTG0z*5=
z*u(Se*2e2YY{OwpIb4?$+!$XQTULQBy*2@L*Rw`JYgy@~sA9X^ie+HMN(GS>Y1eX9
zSg|$FDrb?qag;0XUzH+=01?=iKoa}e(LOd(EaX!I{c!r!+`cIkKm>>Y5g-CYfCvx)
zB0vO)z`-IAS9;iQTv9LU9IB@-{2?O(M1Tko0U|&IhyW2F0z`la5CI}U1P%xR8^7CM
zIn3C1l==Q|{sVY>g0U4;3Du8UKhD@1Y6-Q7I)nP$$Jle!MbwXDjJ-t7pn6aYwSE+1
zP@homQSVSMP>)g9Py?u5)Yl`7eL=lJJw-i2O`^`Ceqm2P>%Dz5{gDv?B0vO)01+Sp
zM1Tl%NFbHs(i1*o&}3mr3vcB51b8ZO0uGadfKfizT)G^F$6LZTqXr?gSLUVCVP+41
zP;Bom?CN%vjAGcOrKFf)4o--|)aG#L5bPaV$n3ht;{UhC=9b#7u_e^3F(srMBp!ze
zbHl9AY;)yFba>nsk|UzpAnm*vq>ZB+nBYrv?KsaM-959gTGIpeF9+$(VncQeRh4K^
zl~^b_47RL7V8>j;6RsmXmFwUt^<r_E!?flc?khiD#zAA4R*Cd%Q+XV?K!2kw6hZl5
zGHwf(%ZO({>Ds00#Y7C4iwPzM`w641gwowPC~?WP9l$+&vxK`<1MCPY=1f%P9ynEi
zda>EEK#x`n+71DCebZ%B?{eG_0N0kFxhJAn3nz&=U;{XJZDCiT!Uy1Qu?~QA5RztA
z_a2QjzL#CBhEEzA4{Z^&u4D`vW9C;QzAEi7=dRYmT~(=Su~3e;r;NeS)G!qD`OD^Z
z%&PF?s}E~1(-?g>u?}Ala(j~5AFCx<`BAHIfwelDj<Y+hO~UpOcryVHkOlB~<Z4lS
J1G;-x{s4R4u6+Oi

-- 
GitLab