KD tree node question

KD tree node question

Hi! My questionis about how to extract leaf information from theIpprKDTreeNode class. I try to do it in the manner that for example PBRT does, but the results are odd and incorrect. I get some negative values which I, honestly, fail to decipher.

I appreciate any help!

void dumpIPPtree( IpprKDTreeNode *pRoot, IpprKDTreeNode *pNode ) {

printf( "FLAG & 0x3 %d FLAG & ~0x3 = %u\n", pNode->flag_k_ofs & 0x3, pNode->flag_k_ofs & ~0x3 );

if( pNode->flag_k_ofs < 0 || (pNode->flag_k_ofs & 0x3)==3 ) {

printf( "COUNT = %u\n", pNode->tree_data.items ); return;

}

printf( "SPLIT = %f\n", pNode->tree_data.split );

dumpIPPtree( pRoot, (IpprKDTreeNode*)((Ipp8u*)pNode + (pNode->flag_k_ofs & ~0x3) + 0) );

dumpIPPtree( pRoot, (IpprKDTreeNode*)((Ipp8u*)pNode + (pNode->flag_k_ofs & ~0x3)) + 1 );

}

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.