IndexToCoordinates

The engine.
Post Reply
nikkne
Posts: 19
Joined: Tue Mar 18, 2008 8:03 pm

IndexToCoordinates

Post by nikkne »

Hi,
I'm encountering something really strange. According to the documentation, IndexToCoordinates() should convert flat index to coordinates, for a given DSL_Dmatrix. When I try this:

Code: Select all

   std::cout << "MI4 " << kam.GetNumberOfDimensions() << std::endl;
   std::cout << "MI4 " << kam.GetSize() << std::endl;
   kam.IndexToCoordinates(0, coords);
   PrintCoords(coords);
I get that kam has 6 dimensions, and its size is 3, while coords is empty. I'm printing coords using loop which goes up to NumItems().

What am I doing wrong?[/code]
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: IndexToCoordinates

Post by shooltz[BayesFusion] »

I believe you were hit by a serious bug in the SMILE API design. DSL_intArray (and other DSL_xxxArrays) has NumItems and GetSize, which can report different values. In your case, DSL_intArray::GetSize is the method to call.

Don't ask why it was design this way - nobody knows :)
Post Reply