diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b14008b81a0a20ad182d651daf2b561b88dedd93..6851150184a1b4c0077b75ed992740f14442e109 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 5ac2823e6035003a69638bb37ed74c9083e85ea1..2399e0b8c3c59abf8756627b9c6339e6c4db4c55 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 0000000000000000000000000000000000000000..7f705ebcd59e2279a84c79ea1aad95f3f3a35990 --- /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 95dd4ce5fe88f253ca7f70dd1ae91b77e61b38a4..c7be27b4585936ad9229b56699edfa93e7cb2e56 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 5ebe8cf9dc2aa3d8eeee2ddf37581a78619f2b30..cba0ee8aa0ff22f6783c83cb6b3c9ada0085c870 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 9b0836c8f84535baf44644441e31326fca7cbf43..0441495b7a4f83568c77176285e87d35a379fa61 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 0000000000000000000000000000000000000000..0434bd445db60115b42b9a939eae64671b6c0ff7 --- /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 9375125b47d7f75403cf4806bde7a6ec2dcceb09..89c18bf540a2c9154a71c9e31855b7c1391db369 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 c4a758810a4f4da326a36ef5dec6a7b8a2e3d217..76aa34e1f7caef738de92d86b735bd23d3bb1b08 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 877cf8d903e4a02f12e23825bb3832baf16e1d22..9195241fb2fa4a87e860e1cac77ff5c42a14b29d 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 38032aa533eb9ecb105e00df9d4152f758c33dc7..0000000000000000000000000000000000000000 --- 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 036d60847d2a6fdbc81263b36b833f37789d6928..0000000000000000000000000000000000000000 --- 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 8013b01c122501d3d464a225400e25b9674873f1..d3ac6430a934c53876072e1e079823a67eeb2daa 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 90f40ff72cd23d748090409e454cf02445af8f09..ce4b4a913532c36528c9962225f4e2552bca1e7b 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 0000000000000000000000000000000000000000..cb8216cc230c3a1ffd6ab36141a0171dd3428d92 --- /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 83e9ac939eeb4547cb4883be76c27b6c48484431..b28bc7b83bab55a143bc0d1ec04c123bd4652f13 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 b3170a5b4671664e5816e4a4f4f9667ad7c26a79..3dcb6626237b22d65886dd4cb1b64bf7044897d9 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 63f3529718a606a3fffa772889c27e8c8a8df689..0000000000000000000000000000000000000000 --- 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 Binary files a/tools/share/.mgrid-view.cfg.desc.swp and /dev/null differ diff --git a/tools/src/.compare-objects.h.swp b/tools/src/.compare-objects.h.swp deleted file mode 100644 index e45564de31a4b2fd3beb3dad2e90683e7e6a4c85..0000000000000000000000000000000000000000 Binary files a/tools/src/.compare-objects.h.swp and /dev/null differ