Minggu, 15 April 2012
PGM-class and MRF parameter learning
Kamis, 05 Januari 2012
When and why it is safe to cast floor/ceil result to integer
double floor ( double x );
float floor ( float x ); // C++ only
- Why would the floor function return anything other than integer?
- What is the most correct way to cast the output to integer?
double a;
int intRes = int(floor(a)); // use static_cast if you don't like brevity
std::cout << std::showbase << std::hex
<< int(float(1 << 23)) << " " << int(float(1 << 24)) << std::endl
<< int(float(1 << 23) + 1) << " " << int(float(1 << 24) + 1) << std::endl;The output is:
0x800000 0x1000000
0x800001 0x1000000
Kamis, 16 September 2010
LidarK 2.0 released
The second major release of GML LidarK is now available. It reflects our 3-year experience on 3D data processing. The description from the project page:
The LidarK library provides an open-source framework for processing multidimensional point data such as 3D LIDAR scans. It allows building a spatial index for performing fast search queries of different kinds. Although it is intended to be used for LIDAR scans, it can be helpful for a wide range of problems that require spatial data processing.
The API has been enriched with various features in this release. Indeed, it became more consistent and logical. New ways to access data (i.e. various iterators) are implemented. One can now find k nearest neighbours for any point, not just for one that belongs to the index. Since the data structure is a container, we've decided to parametrize it with template parameter. This decision is controversive: one does not need to cast tuples any more, but the code became clumsier and less portable, unfortunately.
The C++/MATLAB code is licensed free of charge for academic use. You can download it here.