Commit 836b227c authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing STD lib bug in tnlIndexedSet.

parent a4e4c70a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -96,8 +96,9 @@ void tnlConstSharedArray< Element, Device, Index > :: bind( const Array& array,
                                                            IndexType index,
                                                            IndexType size )
{
   tnlStaticAssert( Array::DeviceType::DeviceType == DeviceType::DeviceType,
                    "Attempt to bind arrays between different devices." );
   // TODO: This does not work for static arrays.
   //tnlStaticAssert( Array::DeviceType::DeviceType == DeviceType::DeviceType,
   //                 "Attempt to bind arrays between different devices." );
   this->data = &( array. getData()[ index ] );
   if( ! size )
      this->size = array. getSize();
+6 −0
Original line number Diff line number Diff line
@@ -54,6 +54,12 @@ class tnlIndexedSet

   struct DataWithIndex
   {
      // This constructor is here only because of bug in g++, we might fix it later.
      // http://stackoverflow.com/questions/22357887/comparing-two-mapiterators-why-does-it-need-the-copy-constructor-of-stdpair
      DataWithIndex(){};
      
      DataWithIndex( const DataWithIndex& d ) : data( d.data ), index( d.index) {}
      
      explicit DataWithIndex( const Element data) : data( data ) {}

      DataWithIndex( const Element data,
+7 −0
Original line number Diff line number Diff line
@@ -266,6 +266,13 @@ class tnlMeshStorageLayer< ConfigTag,
      this->vertices.setElement( entityIndex, entity );
   }

   VertexType& getEntity( DimensionsTraits,
                          const GlobalIndexType entityIndex )
   {
      return this->vertices[ entityIndex ];
   }

   
   const VertexType& getEntity( DimensionsTraits,
                                const GlobalIndexType entityIndex ) const
   {
+1 −1
Original line number Diff line number Diff line
@@ -331,7 +331,7 @@ Index tnlGrid< 2, Real, Device, Index >::getFaceNextToCell( const IndexType& cel
              cerr << " cellIndex = " << cellIndex
                   << " nx = " << nx
                   << " ny = " << ny
                   << " this->getNumberOfCells() = " << ( this->template getNumberOfCells< 1, 1 >() )
                   << " this->getNumberOfCells() = " << ( this->getNumberOfCells() )
                   << " this->getName() " << this->getName(); );
   return result;
}
+10 −1
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ class tnlMeshEntity
{
   public:
      
      // TODO: This is only because of STD lib bug in tnlIndexedSet
      tnlMeshEntity( const tnlMeshEntity& entyti ) {}
      tnlMeshEntity() {}

   static tnlString getType()
   {
      return tnlString( "tnlMesh< " ) +
@@ -296,6 +300,11 @@ class tnlMeshEntity< ConfigTag, tnlMeshVertexTag >
{
   public:

      // TODO: This is only because of STD lib bug in tnlIndexedSet
      tnlMeshEntity( const tnlMeshEntity& entyti ) {}
      tnlMeshEntity() {}

      
   static tnlString getType()
   {
      return tnlString( "tnlMesh< " ) +
@@ -453,7 +462,7 @@ ostream& operator <<( ostream& str, const tnlMeshEntity< ConfigTag, EntityTag >&

/****
 * This tells the compiler that theMeshEntity is a type with a dynamic memory allocation.
 * It is necessary for the loading and the saving of the mesh enities arrays.
 * It is necessary for the loading and the saving of the mesh entities arrays.
 */
template< typename ConfigTag,
          typename EntityTag >
Loading