Loading src/core/arrays/tnlArray_impl.h +9 −23 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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 ) Loading @@ -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; } Loading @@ -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() ); }; Loading Loading @@ -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 ); Loading @@ -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 ] ) ); Loading @@ -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 ]; Loading @@ -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 ]; Loading @@ -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, Loading @@ -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 > :: Loading Loading @@ -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; } Loading Loading @@ -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; } Loading src/core/arrays/tnlMultiArray1D_impl.h +10 −18 Original line number Diff line number Diff line Loading @@ -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() Loading Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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; Loading @@ -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; Loading src/core/arrays/tnlMultiArray2D_impl.h +12 −22 Original line number Diff line number Diff line Loading @@ -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 > Loading Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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; Loading @@ -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; Loading src/core/arrays/tnlMultiArray3D_impl.h +12 −22 Original line number Diff line number Diff line Loading @@ -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() Loading Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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; Loading @@ -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; Loading src/core/arrays/tnlMultiArray4D_impl.h +12 −22 Original line number Diff line number Diff line Loading @@ -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() Loading Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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; Loading @@ -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 Loading
src/core/arrays/tnlArray_impl.h +9 −23 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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 ) Loading @@ -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; } Loading @@ -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() ); }; Loading Loading @@ -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 ); Loading @@ -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 ] ) ); Loading @@ -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 ]; Loading @@ -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 ]; Loading @@ -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, Loading @@ -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 > :: Loading Loading @@ -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; } Loading Loading @@ -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; } Loading
src/core/arrays/tnlMultiArray1D_impl.h +10 −18 Original line number Diff line number Diff line Loading @@ -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() Loading Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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; Loading @@ -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; Loading
src/core/arrays/tnlMultiArray2D_impl.h +12 −22 Original line number Diff line number Diff line Loading @@ -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 > Loading Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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; Loading @@ -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; Loading
src/core/arrays/tnlMultiArray3D_impl.h +12 −22 Original line number Diff line number Diff line Loading @@ -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() Loading Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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; Loading @@ -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; Loading
src/core/arrays/tnlMultiArray4D_impl.h +12 −22 Original line number Diff line number Diff line Loading @@ -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() Loading Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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 ); } Loading @@ -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; Loading @@ -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