Loading src/TNL/Containers/List.h +4 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,10 @@ template< class T > class List const List& operator = ( const List& lst ); bool operator == ( const List& lst ) const; bool operator != ( const List& lst ) const; //! Append new data element bool Append( const T& data ); Loading src/TNL/Containers/List_impl.h +17 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,23 @@ const List< T >& List< T >::operator = ( const List& lst ) return( *this ); } template< typename T > bool List< T >::operator == ( const List& lst ) const { if( this->getSize() != lst.getSize() ) return false; for( int i = 0; i < this->getSize(); i++ ) if( (*this)[ i ] != lst[ i ] ) return false; return true; } template< typename T > bool List< T >::operator != ( const List& lst ) const { return ! operator==( lst ); } template< typename T > bool List< T >::Append( const T& data ) { Loading src/TNL/Containers/StaticVector.h +4 −4 Original line number Diff line number Diff line Loading @@ -306,9 +306,9 @@ class StaticVector< 3, Real > : public Containers::StaticArray< 3, Real > ThisType abs() const; }; template< int Size, typename Real > template< int Size, typename Real, typename Scalar > __cuda_callable__ StaticVector< Size, Real > operator * ( const Real& c, const StaticVector< Size, Real >& u ); StaticVector< Size, Real > operator * ( const Scalar& c, const StaticVector< Size, Real >& u ); template< int Size, typename Real > __cuda_callable__ Loading Loading @@ -377,10 +377,10 @@ Real tnlTriangleArea( const StaticVector< 3, Real >& a, StaticVector< 3, Real > u1, u2; u1. x() = b. x() - a. x(); u1. y() = b. y() - a. y(); u1. z() = 0.0; u1. z() = b. z() - a. z(); u2. x() = c. x() - a. x(); u2. y() = c. y() - a. y(); u2. z() = 0; u2. z() = c. z() - a. z(); const StaticVector< 3, Real > v = VectorProduct( u1, u2 ); return 0.5 * ::sqrt( tnlScalarProduct( v, v ) ); Loading src/TNL/Functions/MeshFunctionGnuplotWriter_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ write( const MeshFunctionType& function, { entity.refresh(); typename MeshType::VertexType v = entity.getCenter(); str << v << " " str << v.x() << " " << function.getData().getElement( entity.getIndex() ) << std::endl; } return true; Loading @@ -71,7 +71,7 @@ write( const MeshFunctionType& function, { entity.refresh(); typename MeshType::VertexType v = entity.getCenter(); str << v << " " str << v.x() << " " << function.getData().getElement( entity.getIndex() ) << std::endl; } return true; Loading src/TNL/Object.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ bool parseObjectType( const String& objectType, /**** * Now, we will extract the parameters. * Each parameter can be template, so we must compute and pair * Each parameter can be template, so we must count and pair * '<' with '>'. */ int templateBrackets( 0 ); Loading @@ -201,13 +201,12 @@ bool parseObjectType( const String& objectType, templateBrackets ++; if( ! templateBrackets ) { if( objectType[ i ] == ' ' || objectType[ i ] == ',' || if( objectType[ i ] == ',' || objectType[ i ] == '>' ) { if( buffer != "" ) { if( ! parsedObjectType. Append( buffer ) ) if( ! parsedObjectType. Append( buffer.strip( ' ' ) ) ) return false; buffer. setString( "" ); } Loading Loading
src/TNL/Containers/List.h +4 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,10 @@ template< class T > class List const List& operator = ( const List& lst ); bool operator == ( const List& lst ) const; bool operator != ( const List& lst ) const; //! Append new data element bool Append( const T& data ); Loading
src/TNL/Containers/List_impl.h +17 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,23 @@ const List< T >& List< T >::operator = ( const List& lst ) return( *this ); } template< typename T > bool List< T >::operator == ( const List& lst ) const { if( this->getSize() != lst.getSize() ) return false; for( int i = 0; i < this->getSize(); i++ ) if( (*this)[ i ] != lst[ i ] ) return false; return true; } template< typename T > bool List< T >::operator != ( const List& lst ) const { return ! operator==( lst ); } template< typename T > bool List< T >::Append( const T& data ) { Loading
src/TNL/Containers/StaticVector.h +4 −4 Original line number Diff line number Diff line Loading @@ -306,9 +306,9 @@ class StaticVector< 3, Real > : public Containers::StaticArray< 3, Real > ThisType abs() const; }; template< int Size, typename Real > template< int Size, typename Real, typename Scalar > __cuda_callable__ StaticVector< Size, Real > operator * ( const Real& c, const StaticVector< Size, Real >& u ); StaticVector< Size, Real > operator * ( const Scalar& c, const StaticVector< Size, Real >& u ); template< int Size, typename Real > __cuda_callable__ Loading Loading @@ -377,10 +377,10 @@ Real tnlTriangleArea( const StaticVector< 3, Real >& a, StaticVector< 3, Real > u1, u2; u1. x() = b. x() - a. x(); u1. y() = b. y() - a. y(); u1. z() = 0.0; u1. z() = b. z() - a. z(); u2. x() = c. x() - a. x(); u2. y() = c. y() - a. y(); u2. z() = 0; u2. z() = c. z() - a. z(); const StaticVector< 3, Real > v = VectorProduct( u1, u2 ); return 0.5 * ::sqrt( tnlScalarProduct( v, v ) ); Loading
src/TNL/Functions/MeshFunctionGnuplotWriter_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ write( const MeshFunctionType& function, { entity.refresh(); typename MeshType::VertexType v = entity.getCenter(); str << v << " " str << v.x() << " " << function.getData().getElement( entity.getIndex() ) << std::endl; } return true; Loading @@ -71,7 +71,7 @@ write( const MeshFunctionType& function, { entity.refresh(); typename MeshType::VertexType v = entity.getCenter(); str << v << " " str << v.x() << " " << function.getData().getElement( entity.getIndex() ) << std::endl; } return true; Loading
src/TNL/Object.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ bool parseObjectType( const String& objectType, /**** * Now, we will extract the parameters. * Each parameter can be template, so we must compute and pair * Each parameter can be template, so we must count and pair * '<' with '>'. */ int templateBrackets( 0 ); Loading @@ -201,13 +201,12 @@ bool parseObjectType( const String& objectType, templateBrackets ++; if( ! templateBrackets ) { if( objectType[ i ] == ' ' || objectType[ i ] == ',' || if( objectType[ i ] == ',' || objectType[ i ] == '>' ) { if( buffer != "" ) { if( ! parsedObjectType. Append( buffer ) ) if( ! parsedObjectType. Append( buffer.strip( ' ' ) ) ) return false; buffer. setString( "" ); } Loading