Wednesday, April 12, 2006

This Week: April 10 - 16, 2006

Monday: Learn parameter-passing method for dynamic array. We need to force casting in some way, but the function signature is always float* arInput, const int SIZE.

Tuesday: Learn how to read data from binary file and learn how to save binary data to file. In reading, we cannot flush the buffer, just read again and overwrite the old data. In writing, it is much faster to perform large write (write multiple bytes). Moreover, we don't need to flush data. See Convolver class (xConvolve function).

I also learn that casting is a time consuming task. If we can provide compatible variable types, we might want to consider provide one as much as we can. It reduces running time significantly.

Wednesday: I encountered a strange problem. I cannot promote a protected member function to a public one. It causes linking problem in other projects using a library with the promoted function. I have to avoid the problem by deriving the class and build an interface to provide a way to call the protected member as a public one. I did it in VesselTreeUtilities by providing the same function name and signature. To create the function we can do it as follows:

VesselTreeUtilities::init3DArrayFloat( int nNumSlc, int nNumRow, int nNumCol ) {
return CommonCore::init3DArrayFloat( nNumSlc, nNumRow, nNumCol );

No comments: