Commit e26da6af authored by Libor's avatar Libor
Browse files

Modified template parameters

parent d2010a03
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
echo
echo
echo "Add integration to tnl library -- that means: templates for"
echo "Real, Index and Device types. Add Values class to store "
echo "Device types. Add updateTree method. Add Values class to store "
echo "interpoled values in each node. Compare speed with original"
echo "VDB. Implement on CUDA. Implement 3D version (should be trivial)."
echo
+2 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@

#include "tnlBitmask.h"

template< unsigned size >
template< unsigned Size >
class tnlBitmaskArray
{
public:
@@ -19,7 +19,7 @@ public:
    ~tnlBitmaskArray();

private:
    tnlBitmask* bitmaskArray[ size ];
    tnlBitmask* bitmaskArray[ Size ];
    unsigned length;
};

+13 −13
Original line number Diff line number Diff line
@@ -5,35 +5,35 @@
#include "tnlBitmask.h"
#include "tnlBitmaskArray.h"

template< unsigned size >
tnlBitmaskArray< size >::tnlBitmaskArray()
template< unsigned Size >
tnlBitmaskArray< Size >::tnlBitmaskArray()
{
    this->length = size;
    this->length = Size;
}

template< unsigned size >
unsigned tnlBitmaskArray< size >::getSize()
template< unsigned Size >
unsigned tnlBitmaskArray< Size >::getSize()
{
    return this->length;
}

template< unsigned size >
void tnlBitmaskArray< size >::setIthBitmask( unsigned i,
template< unsigned Size >
void tnlBitmaskArray< Size >::setIthBitmask( unsigned i,
                                             tnlBitmask bitmask )
{
    assert( i < size );
    assert( i < Size );
    this->bitmaskArray[ i ] = new tnlBitmask( bitmask );
}

template< unsigned size >
tnlBitmask* tnlBitmaskArray< size >::getIthBitmask( unsigned i )
template< unsigned Size >
tnlBitmask* tnlBitmaskArray< Size >::getIthBitmask( unsigned i )
{
    assert( i < size );
    assert( i < Size );
    return this->bitmaskArray[ i ];
}

template< unsigned size >
tnlBitmaskArray< size >::~tnlBitmaskArray()
template< unsigned Size >
tnlBitmaskArray< Size >::~tnlBitmaskArray()
{
    for( int i = 0; i < this->length; i++ )
        delete this->bitmaskArray[ i ];
+2 −2
Original line number Diff line number Diff line
@@ -39,8 +39,8 @@ void tnlNode< Real, Index, LogX, LogY >::setNode( Index splitX,
                                                  tnlBitmaskArray< LogX * LogY >* bitmaskArray )
{

    Index depthX = splitX * tnlVDBMath::power( LogX, this->level - 1 );
    Index depthY = splitY * tnlVDBMath::power( LogY, this->level - 1 );
    Index depthX = splitX * tnlVDBMath< Index >::power( LogX, this->level - 1 );
    Index depthY = splitY * tnlVDBMath< Index >::power( LogY, this->level - 1 );
    Real stepX = ( Real ) this->area->getLengthX() / depthX;
    Real stepY = ( Real ) this->area->getLengthY() / depthY;
    Real startX = this->X * stepX;
+3 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@

template< typename Real,
          typename Index,
          unsigned size,
          unsigned Size,
          Index LogX,
          Index LogY = LogX >
class tnlRootNode : public tnlNode< Real, Index, LogX, LogY >
@@ -28,8 +28,8 @@ public:
private:
    unsigned nodesX;
    unsigned nodesY;
    tnlBitmaskArray< size >* bitmaskArray;
    tnlNode< Real, Index, LogX, LogY >* children[ size ];
    tnlBitmaskArray< Size >* bitmaskArray;
    tnlNode< Real, Index, LogX, LogY >* children[ Size ];
    unsigned depth;
};

Loading