Commit 0acc9358 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Deleting name in tnlObject.

parent 15f22c3b
Loading
Loading
Loading
Loading
+9 −23
Original line number Diff line number Diff line
@@ -36,14 +36,14 @@ tnlArray< Element, Device, Index > :: tnlArray()
{
};

template< typename Element,
/*template< typename Element,
           typename Device,
           typename Index >
tnlArray< Element, Device, Index > :: tnlArray( const tnlString& name )
: size( 0 ), data( 0 )
{
   this -> setName( name );
};
};*/

template< typename Element,
           typename Device,
@@ -88,7 +88,6 @@ bool tnlArray< Element, Device, Index > :: setSize( const Index size )
{
   tnlAssert( size >= 0,
              cerr << "You try to set size of tnlArray to negative value."
                   << "Name: " << this -> getName() << endl
                   << "New size: " << size << endl );
   if( this->size == size ) return true;
   if( this->data )
@@ -101,8 +100,7 @@ bool tnlArray< Element, Device, Index > :: setSize( const Index size )
   if( ! this->data )
   {
      cerr << "I am not able to allocate new array with size "
           << ( double ) this->size * sizeof( ElementType ) / 1.0e9 << " GB for "
           << this->getName() << "." << endl;
           << ( double ) this->size * sizeof( ElementType ) / 1.0e9 << " GB." << endl;
      this -> size = 0;
      return false;
   }
@@ -117,8 +115,6 @@ bool tnlArray< Element, Device, Index > :: setLike( const Array& array )
{
   tnlAssert( array. getSize() >= 0,
              cerr << "You try to set size of tnlArray to negative value."
                   << "Name: " << this -> getName() << endl
                   << "Array name:" << array. getName()
                   << "Array size: " << array. getSize() << endl );
   return setSize( array.getSize() );
};
@@ -157,8 +153,7 @@ template< typename Element,
void tnlArray< Element, Device, Index > :: setElement( const Index i, const Element& x )
{
   tnlAssert( 0 <= i && i < this -> getSize(),
              cerr << "Wrong index for setElement method in tnlArray with name "
                   << this -> getName()
              cerr << "Wrong index for setElement method in tnlArray "
                   << " index is " << i
                   << " and array size is " << this -> getSize() );
   return tnlArrayOperations< Device > :: setMemoryElement( &( this -> data[ i ] ), x );
@@ -170,8 +165,7 @@ template< typename Element,
Element tnlArray< Element, Device, Index > :: getElement( Index i ) const
{
   tnlAssert( 0 <= i && i < this -> getSize(),
              cerr << "Wrong index for getElement method in tnlArray with name "
                   << this -> getName()
              cerr << "Wrong index for getElement method in tnlArray "
                   << " index is " << i
                   << " and array size is " << this -> getSize() );
   return tnlArrayOperations< Device > :: getMemoryElement( & ( this -> data[ i ] ) );
@@ -184,8 +178,7 @@ __cuda_callable__
Element& tnlArray< Element, Device, Index > :: operator[] ( Index i )
{
   tnlAssert( 0 <= i && i < this -> getSize(),
              cerr << "Wrong index for operator[] in tnlArray with name "
                   << this -> getName()
              cerr << "Wrong index for operator[] in tnlArray "
                   << " index is " << i
                   << " and array size is " << this -> getSize() );
   return this->data[ i ];
@@ -198,8 +191,7 @@ __cuda_callable__
const Element& tnlArray< Element, Device, Index > :: operator[] ( Index i ) const
{
   tnlAssert( 0 <= i && i < this -> getSize(),
              cerr << "Wrong index for operator[] in tnlArray with name "
                   << this -> getName()
              cerr << "Wrong index for operator[] in tnlArray "
                   << " index is " << i
                   << " and array size is " << this -> getSize() );
   return this->data[ i ];
@@ -212,9 +204,7 @@ tnlArray< Element, Device, Index >&
   tnlArray< Element, Device, Index > :: operator = ( const tnlArray< Element, Device, Index >& array )
{
   tnlAssert( array. getSize() == this -> getSize(),
           cerr << "Source name: " << array. getName() << endl
                << "Source size: " << array. getSize() << endl
                << "Target name: " << this -> getName() << endl
           cerr << "Source size: " << array. getSize() << endl
                << "Target size: " << this -> getSize() << endl );
   tnlArrayOperations< Device > :: 
   template copyMemory< Element,
@@ -234,9 +224,7 @@ tnlArray< Element, Device, Index >&
   tnlArray< Element, Device, Index > :: operator = ( const Array& array )
{
   tnlAssert( array. getSize() == this -> getSize(),
           cerr << "Source name: " << array. getName() << endl
                << "Source size: " << array. getSize() << endl
                << "Target name: " << this -> getName() << endl
           cerr << "Source size: " << array. getSize() << endl
                << "Target size: " << this -> getSize() << endl );
   tnlArrayOperations< Device,
                       typename Array :: DeviceType > ::
@@ -339,7 +327,6 @@ bool tnlArray< Element, Device, Index > :: save( tnlFile& file ) const
   if( this -> size != 0 && ! tnlArrayIO< Element, Device, Index >::save( file, this -> data, this -> size ) )
   {
      cerr << "I was not able to save " << this->getType()
           << " " << this -> getName()
           << " with size " << this -> getSize() << endl;
      return false;
   }
@@ -372,7 +359,6 @@ bool tnlArray< Element, Device, Index > :: load( tnlFile& file )
      if( ! tnlArrayIO< Element, Device, Index >::load( file, this -> data, this -> size ) )
      {
         cerr << "I was not able to load " << this->getType()
                    << " " << this -> getName()
                    << " with size " << this -> getSize() << endl;
         return false;
      }
+10 −18
Original line number Diff line number Diff line
@@ -23,11 +23,11 @@ tnlMultiArray< 1, Element, Device, Index > :: tnlMultiArray()
{
}

template< typename Element, typename Device, typename Index >
/*template< typename Element, typename Device, typename Index >
tnlMultiArray< 1, Element, Device, Index > :: tnlMultiArray( const tnlString& name )
{
   this -> setName( name );
}
}*/

template< typename Element, typename Device, typename Index >
tnlString tnlMultiArray< 1, Element, Device, Index > :: getType()
@@ -176,10 +176,8 @@ tnlMultiArray< 1, Element, Device, Index >&
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to assign two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   tnlArray< Element, Device, Index > :: operator = ( array );
   return ( *this );
}
@@ -192,10 +190,8 @@ tnlMultiArray< 1, Element, Device, Index >&
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to assign two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   tnlArray< Element, Device, Index > :: operator = ( array );
   return ( *this );
}
@@ -205,14 +201,12 @@ bool tnlMultiArray< 1, Element, Device, Index > :: save( tnlFile& file ) const
{
   if( ! tnlArray< Element, Device, Index > :: save( file ) )
   {
      cerr << "I was not able to write the tnlArray of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to write the tnlArray of tnlMultiArray." << endl;
      return false;
   }
   if( ! dimensions. save( file ) )
   {
      cerr << "I was not able to write the dimensions of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to write the dimensions of tnlMultiArray." << endl;
      return false;
   }
   return true;
@@ -223,14 +217,12 @@ bool tnlMultiArray< 1, Element, Device, Index > :: load( tnlFile& file )
{
   if( ! tnlArray< Element, Device, Index > :: load( file ) )
   {
      cerr << "I was not able to read the tnlArray of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to read the tnlArray of tnlMultiArray." << endl;
      return false;
   }
   if( ! dimensions. load( file ) )
   {
      cerr << "I was not able to read the dimensions of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to read the dimensions of tnlMultiArray." << endl;
      return false;
   }
   return true;
+12 −22
Original line number Diff line number Diff line
@@ -25,11 +25,11 @@ tnlMultiArray< 2, Element, Device, Index > :: tnlMultiArray()
{
}

template< typename Element, typename Device, typename Index >
/*template< typename Element, typename Device, typename Index >
tnlMultiArray< 2, Element, Device, Index > :: tnlMultiArray( const tnlString& name )
{
   this -> setName( name );
}
}*/


template< typename Element, typename Device, typename Index >
@@ -168,10 +168,8 @@ bool tnlMultiArray< 2, Element, Device, Index > :: operator == ( const MultiArra
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to compare two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   return tnlArray< Element, Device, Index > :: operator == ( array );
}

@@ -189,10 +187,8 @@ tnlMultiArray< 2, Element, Device, Index >&
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to assign two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   tnlArray< Element, Device, Index > :: operator = ( array );
   return ( *this );
}
@@ -205,10 +201,8 @@ tnlMultiArray< 2, Element, Device, Index >&
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to assign two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   tnlArray< Element, Device, Index > :: operator = ( array );
   return ( *this );
}
@@ -218,14 +212,12 @@ bool tnlMultiArray< 2, Element, Device, Index > :: save( tnlFile& file ) const
{
   if( ! tnlArray< Element, Device, Index > :: save( file ) )
   {
      cerr << "I was not able to write the tnlArray of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to write the tnlArray of tnlMultiArray." << endl;
      return false;
   }
   if( ! dimensions. save( file ) )
   {
      cerr << "I was not able to write the dimensions of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to write the dimensions of tnlMultiArray." << endl;
      return false;
   }
   return true;
@@ -236,14 +228,12 @@ bool tnlMultiArray< 2, Element, Device, Index > :: load( tnlFile& file )
{
   if( ! tnlArray< Element, Device, Index > :: load( file ) )
   {
      cerr << "I was not able to read the tnlArray of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to read the tnlArray of tnlMultiArray." << endl;
      return false;
   }
   if( ! dimensions. load( file ) )
   {
      cerr << "I was not able to read the dimensions of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to read the dimensions of tnlMultiArray." << endl;
      return false;
   }
   return true;
+12 −22
Original line number Diff line number Diff line
@@ -25,11 +25,11 @@ tnlMultiArray< 3, Element, Device, Index > :: tnlMultiArray()
{
}

template< typename Element, typename Device, typename Index >
/*template< typename Element, typename Device, typename Index >
tnlMultiArray< 3, Element, Device, Index > :: tnlMultiArray( const tnlString& name )
{
   this -> setName( name );
}
}*/

template< typename Element, typename Device, typename Index >
tnlString tnlMultiArray< 3, Element, Device, Index > :: getType()
@@ -191,10 +191,8 @@ bool tnlMultiArray< 3, Element, Device, Index > :: operator == ( const MultiArra
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to compare two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   return tnlArray< Element, Device, Index > :: operator == ( array );
}

@@ -212,10 +210,8 @@ tnlMultiArray< 3, Element, Device, Index >&
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to assign two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   tnlArray< Element, Device, Index > :: operator = ( array );
   return ( *this );
}
@@ -228,10 +224,8 @@ tnlMultiArray< 3, Element, Device, Index >&
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to assign two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   tnlArray< Element, Device, Index > :: operator = ( array );
   return ( *this );
}
@@ -241,14 +235,12 @@ bool tnlMultiArray< 3, Element, Device, Index > :: save( tnlFile& file ) const
{
   if( ! tnlArray< Element, Device, Index > :: save( file ) )
   {
      cerr << "I was not able to write the tnlArray of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to write the tnlArray of tnlMultiArray." << endl;
      return false;
   }
   if( ! dimensions. save( file ) )
   {
      cerr << "I was not able to write the dimensions of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to write the dimensions of tnlMultiArray." << endl;
      return false;
   }
   return true;
@@ -259,14 +251,12 @@ bool tnlMultiArray< 3, Element, Device, Index > :: load( tnlFile& file )
{
   if( ! tnlArray< Element, Device, Index > :: load( file ) )
   {
      cerr << "I was not able to read the tnlArray of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to read the tnlArray of tnlMultiArray." << endl;
      return false;
   }
   if( ! dimensions. load( file ) )
   {
      cerr << "I was not able to read the dimensions of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to read the dimensions of tnlMultiArray." << endl;
      return false;
   }
   return true;
+12 −22
Original line number Diff line number Diff line
@@ -25,11 +25,11 @@ tnlMultiArray< 4, Element, Device, Index > :: tnlMultiArray()
{
}

template< typename Element, typename Device, typename Index >
/*template< typename Element, typename Device, typename Index >
tnlMultiArray< 4, Element, Device, Index > :: tnlMultiArray( const tnlString& name )
{
   this -> setName( name );
}
}*/

template< typename Element, typename Device, typename Index >
tnlString tnlMultiArray< 4, Element, Device, Index > :: getType()
@@ -205,10 +205,8 @@ bool tnlMultiArray< 4, Element, Device, Index > :: operator == ( const MultiArra
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to compare two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   return tnlArray< Element, Device, Index > :: operator == ( array );
}

@@ -226,10 +224,8 @@ tnlMultiArray< 4, Element, Device, Index >&
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to assign two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   tnlArray< Element, Device, Index > :: operator = ( array );
   return ( *this );
}
@@ -242,10 +238,8 @@ tnlMultiArray< 4, Element, Device, Index >&
   // TODO: Static assert on dimensions
   tnlAssert( this -> getDimensions() == array. getDimensions(),
              cerr << "You are attempting to assign two arrays with different dimensions." << endl
                   << "First array name is " << this -> getName()
                   << " dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array is " << array. getName()
                   << " dimensions are ( " << array. getDimensions() << " )" << endl; );
                   << "First array dimensions are ( " << this -> getDimensions() << " )" << endl
                   << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; );
   tnlArray< Element, Device, Index > :: operator = ( array );
   return ( *this );
}
@@ -255,14 +249,12 @@ bool tnlMultiArray< 4, Element, Device, Index > :: save( tnlFile& file ) const
{
   if( ! tnlArray< Element, Device, Index > :: save( file ) )
   {
      cerr << "I was not able to write the tnlArray of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to write the tnlArray of tnlMultiArray." << endl;
      return false;
   }
   if( ! dimensions. save( file ) )
   {
      cerr << "I was not able to write the dimensions of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to write the dimensions of tnlMultiArray." << endl;
      return false;
   }
   return true;
@@ -273,14 +265,12 @@ bool tnlMultiArray< 4, Element, Device, Index > :: load( tnlFile& file )
{
   if( ! tnlArray< Element, Device, Index > :: load( file ) )
   {
      cerr << "I was not able to read the tnlArray of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to read the tnlArray of tnlMultiArray." << endl;
      return false;
   }
   if( ! dimensions. load( file ) )
   {
      cerr << "I was not able to read the dimensions of tnlMultiArray "
           << this -> getName() << endl;
      cerr << "I was not able to read the dimensions of tnlMultiArray." << endl;
      return false;
   }
   return true;
Loading