Commit 358d52ff authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Merge branch 'develop' of geraldine.fjfi.cvut.cz:/local/projects/tnl/tnl into develop

parents e659afe8 3c2c5be9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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 );

+17 −0
Original line number Diff line number Diff line
@@ -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 )
{
+4 −4
Original line number Diff line number Diff line
@@ -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__
@@ -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 ) );
+2 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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;
+3 −4
Original line number Diff line number Diff line
@@ -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 );
@@ -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