Loading src/core/arrays/tnlStaticArray.h +8 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,8 @@ class tnlStaticArray bool load( tnlFile& file); void sort(); protected: Element data[ Size ]; Loading Loading @@ -166,6 +168,8 @@ class tnlStaticArray< 1, Element > bool load( tnlFile& file); void sort(); protected: Element data[ size ]; }; Loading Loading @@ -261,6 +265,8 @@ class tnlStaticArray< 2, Element > bool load( tnlFile& file); void sort(); protected: Element data[ size ]; }; Loading Loading @@ -368,6 +374,8 @@ class tnlStaticArray< 3, Element > bool load( tnlFile& file); void sort(); protected: Element data[ size ]; Loading src/implementation/core/arrays/tnlStaticArray1D_impl.h +5 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,11 @@ bool tnlStaticArray< 1, Element >::load( tnlFile& file) return true; } template< typename Element > void tnlStaticArray< 1, Element >::sort() { } #ifdef TEMPLATE_EXPLICIT_INSTANTIATION extern template class tnlStaticArray< 1, char >; Loading src/implementation/core/arrays/tnlStaticArray2D_impl.h +7 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,13 @@ bool tnlStaticArray< 2, Element >::load( tnlFile& file) return true; } template< typename Element > void tnlStaticArray< 2, Element >::sort() { if( data[ 0 ] > data[ 1 ] ) Swap( data[ 0 ], data[ 1 ] ); } #ifdef TEMPLATE_EXPLICIT_INSTANTIATION extern template class tnlStaticArray< 2, char >; Loading src/implementation/core/arrays/tnlStaticArray3D_impl.h +14 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,20 @@ bool tnlStaticArray< 3, Element >::load( tnlFile& file) return true; } template< typename Element > void tnlStaticArray< 3, Element >::sort() { /**** * Bubble sort on three elements */ if( data[ 0 ] > data[ 1 ] ) Swap( data[ 0 ], data[ 1 ] ); if( data[ 1 ] > data[ 2 ] ) Swap( data[ 1 ], data[2 ] ); if( data[ 0 ] > data[ 1 ] ) Swap( data[ 0 ], data[ 1 ] ); } #ifdef TEMPLATE_EXPLICIT_INSTANTIATION extern template class tnlStaticArray< 3, char >; Loading src/implementation/core/arrays/tnlStaticArray_impl.h +14 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,20 @@ bool tnlStaticArray< Size, Element >::load( tnlFile& file) return true; } template< int Size, typename Element > void tnlStaticArray< Size, Element >::sort() { /**** * We assume that the array data is small and so * may sort it with the bubble sort. */ for( int k = Size - 1; k > 0; k--) for( int i = 0; i < k; i++ ) if( data[ i ] > data[ i+1 ] ) Swap( data[ i ], data[ i+1 ] ); } template< int Size, typename Element > ostream& operator << ( ostream& str, const tnlStaticArray< Size, Element >& a ) { Loading Loading
src/core/arrays/tnlStaticArray.h +8 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,8 @@ class tnlStaticArray bool load( tnlFile& file); void sort(); protected: Element data[ Size ]; Loading Loading @@ -166,6 +168,8 @@ class tnlStaticArray< 1, Element > bool load( tnlFile& file); void sort(); protected: Element data[ size ]; }; Loading Loading @@ -261,6 +265,8 @@ class tnlStaticArray< 2, Element > bool load( tnlFile& file); void sort(); protected: Element data[ size ]; }; Loading Loading @@ -368,6 +374,8 @@ class tnlStaticArray< 3, Element > bool load( tnlFile& file); void sort(); protected: Element data[ size ]; Loading
src/implementation/core/arrays/tnlStaticArray1D_impl.h +5 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,11 @@ bool tnlStaticArray< 1, Element >::load( tnlFile& file) return true; } template< typename Element > void tnlStaticArray< 1, Element >::sort() { } #ifdef TEMPLATE_EXPLICIT_INSTANTIATION extern template class tnlStaticArray< 1, char >; Loading
src/implementation/core/arrays/tnlStaticArray2D_impl.h +7 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,13 @@ bool tnlStaticArray< 2, Element >::load( tnlFile& file) return true; } template< typename Element > void tnlStaticArray< 2, Element >::sort() { if( data[ 0 ] > data[ 1 ] ) Swap( data[ 0 ], data[ 1 ] ); } #ifdef TEMPLATE_EXPLICIT_INSTANTIATION extern template class tnlStaticArray< 2, char >; Loading
src/implementation/core/arrays/tnlStaticArray3D_impl.h +14 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,20 @@ bool tnlStaticArray< 3, Element >::load( tnlFile& file) return true; } template< typename Element > void tnlStaticArray< 3, Element >::sort() { /**** * Bubble sort on three elements */ if( data[ 0 ] > data[ 1 ] ) Swap( data[ 0 ], data[ 1 ] ); if( data[ 1 ] > data[ 2 ] ) Swap( data[ 1 ], data[2 ] ); if( data[ 0 ] > data[ 1 ] ) Swap( data[ 0 ], data[ 1 ] ); } #ifdef TEMPLATE_EXPLICIT_INSTANTIATION extern template class tnlStaticArray< 3, char >; Loading
src/implementation/core/arrays/tnlStaticArray_impl.h +14 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,20 @@ bool tnlStaticArray< Size, Element >::load( tnlFile& file) return true; } template< int Size, typename Element > void tnlStaticArray< Size, Element >::sort() { /**** * We assume that the array data is small and so * may sort it with the bubble sort. */ for( int k = Size - 1; k > 0; k--) for( int i = 0; i < k; i++ ) if( data[ i ] > data[ i+1 ] ) Swap( data[ i ], data[ i+1 ] ); } template< int Size, typename Element > ostream& operator << ( ostream& str, const tnlStaticArray< Size, Element >& a ) { Loading