Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Force use of VW_OUT in Core, FileIO, Image, Math

  • Loading branch information...
commit c3bae55b267fa256995271606ea77ee6696c1be9 1 parent 4b93b1e
@zmoratto authored
Showing with 134 additions and 134 deletions.
  1. +4 −4 src/vw/Core/Cache.cc
  2. +4 −4 src/vw/Core/Cache.h
  3. +1 −1  src/vw/Core/Debugging.cc
  4. +1 −1  src/vw/Core/Exception.cc
  5. +3 −3 src/vw/Core/ProgressCallback.cc
  6. +1 −1  src/vw/Core/TemporaryFile.cc
  7. +3 −3 src/vw/Core/ThreadPool.h
  8. +1 −1  src/vw/FileIO/DiskImageResource.cc
  9. +4 −4 src/vw/FileIO/DiskImageResource.h
  10. +8 −8 src/vw/FileIO/DiskImageResourceGDAL.cc
  11. +18 −18 src/vw/FileIO/DiskImageResourceHDF.cc
  12. +2 −2 src/vw/FileIO/DiskImageResourceJPEG.cc
  13. +2 −2 src/vw/FileIO/DiskImageResourceOpenEXR.cc
  14. +2 −2 src/vw/FileIO/DiskImageResourcePDS.cc
  15. +1 −1  src/vw/FileIO/DiskImageResourcePNG.cc
  16. +1 −1  src/vw/FileIO/DiskImageResourceTIFF.cc
  17. +2 −2 src/vw/FileIO/DiskImageView.h
  18. +1 −1  src/vw/FileIO/GdalIO.cc
  19. +2 −2 src/vw/FileIO/JpegIO.cc
  20. +1 −1  src/vw/FileIO/PngIO.cc
  21. +2 −2 src/vw/Image/BlockRasterize.h
  22. +1 −1  src/vw/Image/EdgeExtension.h
  23. +6 −6 src/vw/Image/ImageIO.h
  24. +2 −2 src/vw/Image/ImageResourceView.h
  25. +1 −1  src/vw/Image/ImageView.h
  26. +4 −4 src/vw/Image/Transform.h
  27. +20 −20 src/vw/Math/ConjugateGradient.h
  28. +2 −2 src/vw/Math/EulerAngles.h
  29. +15 −15 src/vw/Math/LevenbergMarquardt.h
  30. +3 −3 src/vw/Math/MatrixSparseSkyline.h
  31. +6 −6 src/vw/Math/NelderMead.h
  32. +7 −7 src/vw/Math/ParticleSwarmOptimization.h
  33. +3 −3 src/vw/Math/RANSAC.h
View
8 src/vw/Core/Cache.cc
@@ -15,15 +15,15 @@
void vw::Cache::allocate( size_t size ) {
while( m_size+size > m_max_size ) {
if( ! m_last_valid ) {
- vw_out(WarningMessage, "console") << "Warning: Cached object (" << size << ") larger than requested maximum cache size (" << m_max_size << "). Current Size = " << m_size << "\n";
- vw_out(WarningMessage, "cache") << "Warning: Cached object (" << size << ") larger than requested maximum cache size (" << m_max_size << "). Current Size = " << m_size << "\n";
+ VW_OUT(WarningMessage, "console") << "Warning: Cached object (" << size << ") larger than requested maximum cache size (" << m_max_size << "). Current Size = " << m_size << "\n";
+ VW_OUT(WarningMessage, "cache") << "Warning: Cached object (" << size << ") larger than requested maximum cache size (" << m_max_size << "). Current Size = " << m_size << "\n";
break;
}
m_last_valid->invalidate();
m_evictions++;
}
m_size += size;
- VW_CACHE_DEBUG( vw_out(DebugMessage, "cache") << "Cache allocated " << size << " bytes (" << m_size << " / " << m_max_size << " used)" << "\n"; )
+ VW_CACHE_DEBUG( VW_OUT(DebugMessage, "cache") << "Cache allocated " << size << " bytes (" << m_size << " / " << m_max_size << " used)" << "\n"; )
}
void vw::Cache::resize( size_t size ) {
@@ -37,7 +37,7 @@ void vw::Cache::resize( size_t size ) {
void vw::Cache::deallocate( size_t size ) {
m_size -= size;
- VW_CACHE_DEBUG( vw_out(DebugMessage, "cache") << "Cache deallocated " << size << " bytes (" << m_size << " / " << m_max_size << " used)" << "\n"; )
+ VW_CACHE_DEBUG( VW_OUT(DebugMessage, "cache") << "Cache deallocated " << size << " bytes (" << m_size << " / " << m_max_size << " used)" << "\n"; )
}
// Move the cache line to the top of the valid list.
View
8 src/vw/Core/Cache.h
@@ -127,7 +127,7 @@ namespace vw {
CacheLine( Cache& cache, GeneratorT const& generator )
: CacheLineBase(cache,core::detail::pointerish(generator)->size()), m_generator(generator), m_generation_count(0)
{
- VW_CACHE_DEBUG( vw_out(DebugMessage, "cache") << "Cache creating CacheLine " << info() << "\n"; )
+ VW_CACHE_DEBUG( VW_OUT(DebugMessage, "cache") << "Cache creating CacheLine " << info() << "\n"; )
Mutex::Lock cache_lock(cache.m_mutex);
CacheLineBase::invalidate();
}
@@ -135,14 +135,14 @@ namespace vw {
virtual ~CacheLine() {
Mutex::Lock cache_lock(cache().m_mutex);
invalidate();
- VW_CACHE_DEBUG( vw_out(DebugMessage, "cache") << "Cache destroying CacheLine " << info() << "\n"; )
+ VW_CACHE_DEBUG( VW_OUT(DebugMessage, "cache") << "Cache destroying CacheLine " << info() << "\n"; )
remove();
}
virtual void invalidate() {
Mutex::Lock line_lock(m_mutex);
if( ! m_value ) return;
- VW_CACHE_DEBUG( vw_out(DebugMessage, "cache") << "Cache invalidating CacheLine " << info() << "\n"; );
+ VW_CACHE_DEBUG( VW_OUT(DebugMessage, "cache") << "Cache invalidating CacheLine " << info() << "\n"; );
CacheLineBase::invalidate();
CacheLineBase::deallocate();
m_value.reset();
@@ -161,7 +161,7 @@ namespace vw {
if( !m_value ) {
m_generation_count++;
hit = false;
- VW_CACHE_DEBUG( vw_out(DebugMessage, "cache") << "Cache generating CacheLine " << info() << "\n"; )
+ VW_CACHE_DEBUG( VW_OUT(DebugMessage, "cache") << "Cache generating CacheLine " << info() << "\n"; )
{
Mutex::Lock cache_lock(cache().m_mutex);
CacheLineBase::allocate();
View
2  src/vw/Core/Debugging.cc
@@ -41,5 +41,5 @@ vw::Timer::~Timer() {
double duration = boost::numeric_cast<double>(end.tv_sec - m_begin.tv_sec);
duration += boost::numeric_cast<double>(end.tv_usec - m_begin.tv_usec)/1.0e6;
#endif
- vw_out(m_level, m_log_namespace) << m_desc << ": " << duration << std::endl;
+ VW_OUT(m_level, m_log_namespace) << m_desc << ": " << duration << std::endl;
}
View
2  src/vw/Core/Exception.cc
@@ -27,7 +27,7 @@ namespace {
#if defined(VW_ENABLE_EXCEPTIONS) && (VW_ENABLE_EXCEPTIONS==1)
e.default_throw();
#else
- vw::vw_out(vw::ErrorMessage) << "Fatal error: " << e.what() << std::endl;
+ vw::VW_OUT(vw::ErrorMessage) << "Fatal error: " << e.what() << std::endl;
#endif
std::abort();
}
View
6 src/vw/Core/ProgressCallback.cc
@@ -37,13 +37,13 @@ void vw::TerminalProgressCallback::print_progress() const {
for( int i=0; i<pi; ++i ) p << "*";
for( int i=m_bar_length; i>pi; --i ) p << ".";
p << "] " << std::setprecision(m_precision) << std::fixed << (m_progress*100.0) << "%";
- vw_out(m_level, m_namespace) << p.str() << std::flush;
+ VW_OUT(m_level, m_namespace) << p.str() << std::flush;
}
}
void vw::TerminalProgressCallback::report_aborted(std::string why) const {
Mutex::Lock lock(m_mutex);
- vw_out(m_level, m_namespace) << " Aborted: " << why << std::endl;
+ VW_OUT(m_level, m_namespace) << " Aborted: " << why << std::endl;
}
void vw::TerminalProgressCallback::report_finished() const {
@@ -52,7 +52,7 @@ void vw::TerminalProgressCallback::report_finished() const {
std::ostringstream p;
for ( uint32 i = 0; i < cbar_length; i++ )
p << "*";
- vw_out(m_level, m_namespace) << "\r" << m_pre_progress_text
+ VW_OUT(m_level, m_namespace) << "\r" << m_pre_progress_text
<< "[" << p.str() << "] Complete!\n";
}
View
2  src/vw/Core/TemporaryFile.cc
@@ -244,7 +244,7 @@ TemporaryFile::~TemporaryFile() {
m_buf.reset();
if (m_delete)
if (::remove(m_filename.c_str()) == -1 && errno != ENOENT)
- vw_out(WarningMessage) << "Failed to remove temporary file " << m_filename << ": " << ::strerror(errno) << std::endl;
+ VW_OUT(WarningMessage) << "Failed to remove temporary file " << m_filename << ": " << ::strerror(errno) << std::endl;
}
const std::string& TemporaryFile::filename() const {return m_filename;}
View
6 src/vw/Core/ThreadPool.h
@@ -81,7 +81,7 @@ namespace vw {
~WorkerThread() {}
void operator()() {
do {
- vw_out(DebugMessage, "thread") << "ThreadPool: running worker thread "
+ VW_OUT(DebugMessage, "thread") << "ThreadPool: running worker thread "
<< m_thread_id << "\n";
(*m_task)();
m_task->signal_finished();
@@ -124,7 +124,7 @@ namespace vw {
// *************************************************************
void worker_thread_complete(int worker_id) {
m_active_workers--;
- vw_out(DebugMessage, "thread") << "ThreadPool: terminating worker thread " << worker_id << ". [ " << m_active_workers << " / " << m_max_workers << " now active ]\n";
+ VW_OUT(DebugMessage, "thread") << "ThreadPool: terminating worker thread " << worker_id << ". [ " << m_active_workers << " / " << m_max_workers << " now active ]\n";
// Erase the worker thread from the list of active threads
VW_ASSERT(worker_id >= 0 && worker_id < int(m_running_threads.size()),
@@ -170,7 +170,7 @@ namespace vw {
boost::shared_ptr<Thread> thread(new Thread(next_worker));
m_running_threads[next_available_thread_id] = thread;
m_active_workers++;
- vw_out(DebugMessage, "thread") << "ThreadPool: creating worker thread " << next_available_thread_id << ". [ " << m_active_workers << " / " << m_max_workers << " now active ]\n";
+ VW_OUT(DebugMessage, "thread") << "ThreadPool: creating worker thread " << next_available_thread_id << ". [ " << m_active_workers << " / " << m_max_workers << " now active ]\n";
}
}
View
2  src/vw/FileIO/DiskImageResource.cc
@@ -211,7 +211,7 @@ vw::DiskImageResource* vw::DiskImageResource::open( std::string const& filename
OpenMapType::iterator i = open_map->find( extension );
if( i != open_map->end() ) {
DiskImageResource* rsrc = i->second( filename );
- vw_out(DebugMessage,"fileio") << "Produce DiskImageResource of type: " << rsrc->type() << "\n";
+ VW_OUT(DebugMessage,"fileio") << "Produce DiskImageResource of type: " << rsrc->type() << "\n";
return rsrc;
}
}
View
8 src/vw/FileIO/DiskImageResource.h
@@ -121,12 +121,12 @@ namespace vw {
template <class PixelT>
void read_image( ImageView<PixelT>& in_image, const std::string &filename ) {
- vw_out(InfoMessage, "fileio") << "\tLoading image: " << filename << "\t";
+ VW_OUT(InfoMessage, "fileio") << "\tLoading image: " << filename << "\t";
// Open the file for reading
DiskImageResource *r = DiskImageResource::open( filename );
- vw_out(InfoMessage, "fileio") << r->cols() << "x" << r->rows() << "x" << r->planes() << " " << r->channels() << " channel(s)\n";
+ VW_OUT(InfoMessage, "fileio") << r->cols() << "x" << r->rows() << "x" << r->planes() << " " << r->channels() << " channel(s)\n";
// Read the data
read_image(in_image, *r);
@@ -154,9 +154,9 @@ namespace vw {
for( unsigned p=0; p<files; ++p ) {
std::string name = filename;
if( files > 1 ) boost::replace_last( name, "*", str( boost::format("%1%") % p ) );
- vw_out(InfoMessage, "fileio") << "\tSaving image: " << name << "\t";
+ VW_OUT(InfoMessage, "fileio") << "\tSaving image: " << name << "\t";
DiskImageResource *r = DiskImageResource::create( name, out_image_format );
- vw_out(InfoMessage, "fileio") << r->cols() << "x" << r->rows() << "x" << r->planes() << " " << r->channels() << " channel(s)\n";
+ VW_OUT(InfoMessage, "fileio") << r->cols() << "x" << r->rows() << "x" << r->planes() << " " << r->channels() << " channel(s)\n";
if ( files > 1 ) {
write_image(*r, select_plane(out_image.impl(),p), SubProgressCallback(progress_callback,float(p)/float(files),float(p+1)/float(files)));
View
16 src/vw/FileIO/DiskImageResourceGDAL.cc
@@ -160,7 +160,7 @@ namespace vw {
for( i = gdal_format_string.begin(); i != gdal_format_string.end() && driver == NULL; i++ )
{
- vw_out(DebugMessage, "fileio") << "Trying to retrieve GDAL Driver with the following type: " << (*i) << std::endl;
+ VW_OUT(DebugMessage, "fileio") << "Trying to retrieve GDAL Driver with the following type: " << (*i) << std::endl;
driver = GetGDALDriverManager()->GetDriverByName((*i).c_str());
if( driver == NULL )
continue;
@@ -170,14 +170,14 @@ namespace vw {
char** metadata = driver->GetMetadata();
if( !CSLFetchBoolean( metadata, GDAL_DCAP_CREATE, FALSE ) )
{
- vw_out(WarningMessage, "fileio") << "GDAL driver " << (*i) << " does not support create." << std::endl;
+ VW_OUT(WarningMessage, "fileio") << "GDAL driver " << (*i) << " does not support create." << std::endl;
driver = NULL;
unsupported_driver = true;
}
}
}
if (!driver)
- vw_out(DebugMessage, "fileio") << "Could not get GDAL driver for filename:" << filename << std::endl;
+ VW_OUT(DebugMessage, "fileio") << "Could not get GDAL driver for filename:" << filename << std::endl;
return std::make_pair(driver, unsupported_driver);
}
@@ -243,18 +243,18 @@ namespace vw {
m_format.cols = dataset->GetRasterXSize();
m_format.rows = dataset->GetRasterYSize();
- vw_out(DebugMessage, "fileio") << "\n\tMetadata description: " << dataset->GetDescription() << std::endl;
+ VW_OUT(DebugMessage, "fileio") << "\n\tMetadata description: " << dataset->GetDescription() << std::endl;
char** metadata = dataset->GetMetadata();
- vw_out(DebugMessage, "fileio") << "\tCount: " << CSLCount(metadata) << std::endl;
+ VW_OUT(DebugMessage, "fileio") << "\tCount: " << CSLCount(metadata) << std::endl;
for (int i = 0; i < CSLCount(metadata); i++) {
- vw_out(DebugMessage, "fileio") << "\t\t" << CSLGetField(metadata,i) << std::endl;
+ VW_OUT(DebugMessage, "fileio") << "\t\t" << CSLGetField(metadata,i) << std::endl;
}
- vw_out(DebugMessage, "fileio") << "\tDriver: " <<
+ VW_OUT(DebugMessage, "fileio") << "\tDriver: " <<
dataset->GetDriver()->GetDescription() <<
dataset->GetDriver()->GetMetadataItem( GDAL_DMD_LONGNAME ) << std::endl;
- vw_out(DebugMessage, "fileio") << "\tSize is " <<
+ VW_OUT(DebugMessage, "fileio") << "\tSize is " <<
dataset->GetRasterXSize() << "x" <<
dataset->GetRasterYSize() << "x" <<
dataset->GetRasterCount() << std::endl;
View
36 src/vw/FileIO/DiskImageResourceHDF.cc
@@ -93,7 +93,7 @@ class vw::DiskImageResourceInfoHDF {
if( SDfileinfo( sd_id, &n_datasets, &n_fileattrs ) == FAIL )
vw_throw( IOErr() << "Unable to read info from HDF file \"" << filename << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "HDF SD file \"" << filename << "\": " << n_datasets << " datasets, " << n_fileattrs << " fileattrs" << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "HDF SD file \"" << filename << "\": " << n_datasets << " datasets, " << n_fileattrs << " fileattrs" << std::endl;
sds_info.resize( n_datasets );
for( ::int32 i=0; i<n_datasets; ++i ) {
@@ -114,17 +114,17 @@ class vw::DiskImageResourceInfoHDF {
sds_info[i].coord = SDiscoordvar( id );
if( sds_info[i].coord )
- vw_out(VerboseDebugMessage, "fileio") << " DIM ";
+ VW_OUT(VerboseDebugMessage, "fileio") << " DIM ";
else
- vw_out(VerboseDebugMessage, "fileio") << " SDS ";
+ VW_OUT(VerboseDebugMessage, "fileio") << " SDS ";
- vw_out(VerboseDebugMessage, "fileio") << i << ": \"" << sds_info[i].name << "\" ";
+ VW_OUT(VerboseDebugMessage, "fileio") << i << ": \"" << sds_info[i].name << "\" ";
for( int j=sds_info[i].rank-1; ; ) {
- vw_out(VerboseDebugMessage, "fileio") << sds_info[i].dim_sizes[j];
+ VW_OUT(VerboseDebugMessage, "fileio") << sds_info[i].dim_sizes[j];
if( j-- == 0 ) break;
- vw_out(VerboseDebugMessage, "fileio") << "x";
+ VW_OUT(VerboseDebugMessage, "fileio") << "x";
}
- vw_out(VerboseDebugMessage, "fileio") << " (data type " << sds_info[i].type << ", " << sds_info[i].n_attrs << " attrs)" << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << " (data type " << sds_info[i].type << ", " << sds_info[i].n_attrs << " attrs)" << std::endl;
if( ! SDiscoordvar( id ) ) {
for( int j=sds_info[i].rank-1; j>=0; --j ) {
@@ -140,7 +140,7 @@ class vw::DiskImageResourceInfoHDF {
// FIXME: We really don't support this yet.
// if( dim_data_type != 0 )
// vw_throw( NoImplErr() << "SDS dimension scales not supported (HDF file \"" << filename << "\")!" );
- vw_out(VerboseDebugMessage, "fileio") << " Dim " << j << ": \"" << dim_name << "\" (size " << dim_size << ", " << dim_n_attrs << " attrs)" << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << " Dim " << j << ": \"" << dim_name << "\" (size " << dim_size << ", " << dim_n_attrs << " attrs)" << std::endl;
}
}
@@ -213,7 +213,7 @@ class vw::DiskImageResourceInfoHDF {
new_format.planes = sds_planes.size();
new_format.pixel_format = VW_PIXEL_SCALAR;
plane_info = new_plane_info;
- vw_out(VerboseDebugMessage, "fileio") << "Configured resource: " << new_format.cols << "x" << new_format.rows << "x" << new_format.planes << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Configured resource: " << new_format.cols << "x" << new_format.rows << "x" << new_format.planes << std::endl;
return new_format;
}
@@ -323,7 +323,7 @@ class vw::DiskImageResourceInfoHDF {
result.resize( count );
status = SDreadattr( sds_id, attr_index, &result[0] );
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
@@ -349,7 +349,7 @@ class vw::DiskImageResourceInfoHDF {
result.resize( count );
status = SDreadattr( sds_id, attr_index, &result[0] );
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
@@ -375,7 +375,7 @@ class vw::DiskImageResourceInfoHDF {
result.resize( count );
status = SDreadattr( sds_id, attr_index, &result[0] );
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
@@ -401,7 +401,7 @@ class vw::DiskImageResourceInfoHDF {
result.resize( count );
status = SDreadattr( sds_id, attr_index, &result[0] );
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
@@ -427,7 +427,7 @@ class vw::DiskImageResourceInfoHDF {
result.resize( count );
status = SDreadattr( sds_id, attr_index, &result[0] );
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
@@ -453,7 +453,7 @@ class vw::DiskImageResourceInfoHDF {
result.resize( count );
status = SDreadattr( sds_id, attr_index, &result[0] );
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
@@ -479,7 +479,7 @@ class vw::DiskImageResourceInfoHDF {
result.resize( count );
status = SDreadattr( sds_id, attr_index, &result[0] );
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
@@ -505,7 +505,7 @@ class vw::DiskImageResourceInfoHDF {
result.resize( count );
status = SDreadattr( sds_id, attr_index, &result[0] );
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
@@ -533,7 +533,7 @@ class vw::DiskImageResourceInfoHDF {
status = SDreadattr( sds_id, attr_index, &result[0] );
if( count>0 && result[count-1]==0 ) result.resize(count-1); // Remove excess trailing zero
if( status == FAIL ) vw_throw( IOErr() << "Unable to read SDS attribute in HDF file \"" << resource.filename() << "\"!" );
- vw_out(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
+ VW_OUT(VerboseDebugMessage, "fileio") << "Attribute \"" << name << "\": data type " << data_type << ", length " << count << std::endl;
SDendaccess( sds_id );
}
};
View
4 src/vw/FileIO/DiskImageResourceJPEG.cc
@@ -246,10 +246,10 @@ void DiskImageResourceJPEG::create( std::string const& filename,
// warning message.
if (format.pixel_format == VW_PIXEL_GRAYA) {
m_format.pixel_format = VW_PIXEL_GRAY;
- vw_out(DebugMessage, "fileio") << "DiskImageResourceJPEG: Warning. alpha channel removed. ";
+ VW_OUT(DebugMessage, "fileio") << "DiskImageResourceJPEG: Warning. alpha channel removed. ";
} else if (format.pixel_format == VW_PIXEL_RGBA) {
m_format.pixel_format = VW_PIXEL_RGB;
- vw_out(DebugMessage, "fileio") << "DiskImageResourceJPEG: Warning. alpha channel removed. ";
+ VW_OUT(DebugMessage, "fileio") << "DiskImageResourceJPEG: Warning. alpha channel removed. ";
}
}
View
4 src/vw/FileIO/DiskImageResourceOpenEXR.cc
@@ -250,7 +250,7 @@ void vw::DiskImageResourceOpenEXR::create( std::string const& filename,
// Read the disk image into the given buffer.
void vw::DiskImageResourceOpenEXR::read( ImageBuffer const& dest, BBox2i const& bbox ) const
{
- vw_out(VerboseDebugMessage, "fileio") << "DiskImageResourceOpenEXR: Reading OpenEXR Block " << bbox << "\n";
+ VW_OUT(VerboseDebugMessage, "fileio") << "DiskImageResourceOpenEXR: Reading OpenEXR Block " << bbox << "\n";
if (!m_input_file_ptr)
vw_throw( LogicErr() << "DiskImageResourceOpenEXR: Could not read file. No file has been opened." );
@@ -338,7 +338,7 @@ void vw::DiskImageResourceOpenEXR::read( ImageBuffer const& dest, BBox2i const&
// Write the given buffer into the disk image.
void vw::DiskImageResourceOpenEXR::write( ImageBuffer const& src, BBox2i const& bbox )
{
- vw_out(VerboseDebugMessage, "fileio") << "DiskImageResourceOpenEXR: Writing OpenEXR Block " << bbox << "\n";
+ VW_OUT(VerboseDebugMessage, "fileio") << "DiskImageResourceOpenEXR: Writing OpenEXR Block " << bbox << "\n";
if (!m_output_file_ptr)
vw_throw( LogicErr() << "DiskImageResourceOpenEXR: Could not write file. No file has been opened." );
View
4 src/vw/FileIO/DiskImageResourcePDS.cc
@@ -180,7 +180,7 @@ void vw::DiskImageResourcePDS::open( std::string const& filename ) {
// Otherwise, we set the data filename to be the same as the
// filename that contains the image header.
if (value[0] == '\"' && value[value.size()-1] == '\"') {
- vw_out(InfoMessage, "fileio") << "PDS header points to a seperate data file: " << value << ".\n";
+ VW_OUT(InfoMessage, "fileio") << "PDS header points to a seperate data file: " << value << ".\n";
m_pds_data_filename = value.substr(1,value.size()-2);
m_image_data_offset = 0;
} else {
@@ -234,7 +234,7 @@ void vw::DiskImageResourcePDS::open( std::string const& filename ) {
m_format.pixel_format = planes_to_pixel_format(m_format.planes);
if (m_format.pixel_format != VW_PIXEL_SCALAR) m_format.planes = 1;
- vw_out(DebugMessage, "fileio")
+ VW_OUT(DebugMessage, "fileio")
<< "Opening PDS Image\n"
<< "\tImage Dimensions: " << m_format.cols << "x" << m_format.rows << "x" << m_format.planes << "\n"
<< "\tImage Format: " << m_format.channel_type << " " << m_format.pixel_format << "\n";
View
2  src/vw/FileIO/DiskImageResourcePNG.cc
@@ -349,7 +349,7 @@ struct DiskImageResourcePNG::vw_png_read_context:
break;
#endif
default:
- vw_out(WarningMessage, "fileio") << "Unsupported PNG comment type in PNG read!" << std::endl;
+ VW_OUT(WarningMessage, "fileio") << "Unsupported PNG comment type in PNG read!" << std::endl;
continue;
}
comments.push_back( c );
View
2  src/vw/FileIO/DiskImageResourceTIFF.cc
@@ -67,7 +67,7 @@ namespace vw {
static void tiff_warning_handler(const char* module, const char* frmt, va_list ap) {
char msg[VW_ERROR_BUFFER_SIZE];
vsnprintf( msg, VW_ERROR_BUFFER_SIZE, frmt, ap );
- vw::vw_out(vw::WarningMessage, "fileio") << "DiskImageResourceTIFF (" << (module?module:"none") << ") Warning: " << msg << std::endl;
+ vw::VW_OUT(vw::WarningMessage, "fileio") << "DiskImageResourceTIFF (" << (module?module:"none") << ") Warning: " << msg << std::endl;
}
/// Handle libTIFF error conditions by vw_throwing an IOErr with the
View
4 src/vw/FileIO/DiskImageView.h
@@ -93,7 +93,7 @@ namespace vw {
}
~DiskCacheHandle() {
- vw_out(DebugMessage, "fileio") << "DiskCacheImageView: deleting temporary cache file: " << m_filename << "\n";
+ VW_OUT(DebugMessage, "fileio") << "DiskCacheImageView: deleting temporary cache file: " << m_filename << "\n";
boost::filesystem::remove( m_filename );
}
@@ -116,7 +116,7 @@ namespace vw {
const ProgressCallback &progress_callback = ProgressCallback::dummy_instance() ) {
TemporaryFile file(m_directory, false, "vw_cache_", "." + m_file_type);
- vw_out(InfoMessage, "fileio") << "Creating disk cache of image in: " << file.filename() << "\n";
+ VW_OUT(InfoMessage, "fileio") << "Creating disk cache of image in: " << file.filename() << "\n";
ImageFormat fmt(view.format());
fmt.pixel_format = PixelFormatID<PixelT>::value;
View
2  src/vw/FileIO/GdalIO.cc
@@ -31,7 +31,7 @@ static void CPL_STDCALL gdal_error_handler(CPLErr eErrClass, int nError, const c
if (eErrClass == CE_Fatal)
vw::vw_throw(vw::IOErr() << "GdalIO: " << msg << " (code = " << nError << ")");
else
- vw::vw_out(lvl, "fileio") << "GdalIO: " << msg << " (code = " << nError << ")" << std::endl;
+ VW_OUT(lvl, "fileio") << "GdalIO: " << msg << " (code = " << nError << ")" << std::endl;
}
// GDAL is not thread-safe, so we keep a global GDAL lock (pointed to
View
4 src/vw/FileIO/JpegIO.cc
@@ -146,14 +146,14 @@ void JpegIOCompress::open() {
m_ctx.in_color_space = JCS_UNKNOWN;
break;
case VW_PIXEL_GRAYA:
- vw_out(DebugMessage, "fileio") << "JpegIOCompress: Warning: alpha channel removed." << std::endl;;
+ VW_OUT(DebugMessage, "fileio") << "JpegIOCompress: Warning: alpha channel removed." << std::endl;;
m_fmt.pixel_format = VW_PIXEL_GRAY;
case VW_PIXEL_GRAY:
m_ctx.input_components = 1;
m_ctx.in_color_space = JCS_GRAYSCALE;
break;
case VW_PIXEL_RGBA:
- vw_out(DebugMessage, "fileio") << "JpegIOCompress: Warning: alpha channel removed." << std::endl;;
+ VW_OUT(DebugMessage, "fileio") << "JpegIOCompress: Warning: alpha channel removed." << std::endl;;
m_fmt.pixel_format = VW_PIXEL_RGB;
case VW_PIXEL_RGB:
m_ctx.input_components = 3;
View
2  src/vw/FileIO/PngIO.cc
@@ -201,7 +201,7 @@ void PngIOCompress::open() {
default:
bit_depth = 8;
if ( bit_depth/8 != int(channel_size( fmt().channel_type )) ) {
- vw_out(WarningMessage,"fileio") << "PngIO: Output type rescaled from VW_CHANNEL_" << channel_type_name(fmt().channel_type) << " to VW_CHANNEL_UINT8" << std::endl;
+ VW_OUT(WarningMessage,"fileio") << "PngIO: Output type rescaled from VW_CHANNEL_" << channel_type_name(fmt().channel_type) << " to VW_CHANNEL_UINT8" << std::endl;
m_fmt.channel_type = VW_CHANNEL_UINT8;
}
break;
View
4 src/vw/Image/BlockRasterize.h
@@ -50,7 +50,7 @@ namespace vw {
inline result_type operator()( int32 x, int32 y, int32 p = 0 ) const {
#if VW_DEBUG_LEVEL > 1
- vw_out(VerboseDebugMessage, "image") << "ImageResourceView rasterizing pixel (" << x << "," << y << "," << p << ")" << std::endl;
+ VW_OUT(VerboseDebugMessage, "image") << "ImageResourceView rasterizing pixel (" << x << "," << y << "," << p << ")" << std::endl;
#endif
if ( m_cache_ptr ) {
// Early-out optimization for single-block resources
@@ -93,7 +93,7 @@ namespace vw {
: m_view(view), m_dest(dest), m_offset(offset) {}
void operator()( BBox2i const& bbox ) const {
#if VW_DEBUG_LEVEL > 1
- vw_out(VerboseDebugMessage, "image") << "BlockRasterizeView::RasterizeFunctor( " << bbox << " )" << std::endl;
+ VW_OUT(VerboseDebugMessage, "image") << "BlockRasterizeView::RasterizeFunctor( " << bbox << " )" << std::endl;
#endif
if( m_view.m_cache_ptr ) {
int32 ix=bbox.min().x()/m_view.m_block_size.x(), iy=bbox.min().y()/m_view.m_block_size.y();
View
2  src/vw/Image/EdgeExtension.h
@@ -371,7 +371,7 @@ namespace vw {
BBox2i src_bbox = source_bbox( bbox );
// Make degenerate bboxes sane
if( src_bbox.empty() ) src_bbox = BBox2i(0,0,0,0);
- vw_out(VerboseDebugMessage, "image") << "EdgeExtensionView: prerasterizing child view with bbox " << src_bbox << ".\n";
+ VW_OUT(VerboseDebugMessage, "image") << "EdgeExtensionView: prerasterizing child view with bbox " << src_bbox << ".\n";
return prerasterize_type(m_image.prerasterize(src_bbox), m_xoffset, m_yoffset, m_cols, m_rows, m_extension_func );
}
template <class DestT> inline void rasterize( DestT const& dest, BBox2i bbox ) const { vw::rasterize( prerasterize(bbox), dest, bbox ); }
View
12 src/vw/Image/ImageIO.h
@@ -159,7 +159,7 @@ namespace vw {
virtual ~WriteBlockTask() {}
virtual void operator() () {
- vw_out(DebugMessage, "image") << "Writing block " << m_idx << " at " << m_bbox << "\n";
+ VW_OUT(DebugMessage, "image") << "Writing block " << m_idx << " at " << m_bbox << "\n";
m_resource.write( m_image_block.buffer(), m_bbox );
m_write_finish_event.notify();
}
@@ -192,7 +192,7 @@ namespace vw {
m_write_finish_event.wait(m_index);
- vw_out(DebugMessage, "image") << "Rasterizing block " << m_index << " at " << m_bbox << "\n";
+ VW_OUT(DebugMessage, "image") << "Rasterizing block " << m_index << " at " << m_bbox << "\n";
// Rasterize the block
ImageView<typename ViewT::pixel_type> image_block( crop(m_image, m_bbox) );
@@ -257,7 +257,7 @@ namespace vw {
block_size = resource.block_write_size();
size_t total_num_blocks = ((rows-1)/block_size.y()+1) * ((cols-1)/block_size.x()+1);
- vw_out(DebugMessage,"image") << "block_write_image: writing " << total_num_blocks << " blocks.\n";
+ VW_OUT(DebugMessage,"image") << "block_write_image: writing " << total_num_blocks << " blocks.\n";
// Early out for easy case
if (total_num_blocks == 1) {
@@ -270,7 +270,7 @@ namespace vw {
for (int32 j = 0; j < rows; j+= block_size.y()) {
for (int32 i = 0; i < cols; i+= block_size.x()) {
- vw_out(DebugMessage, "image") << "ImageIO scheduling block at [" << i << " " << j << "]/[" << rows << " " << cols << "] blocksize = " << block_size.x() << " x " << block_size.y() << "\n";
+ VW_OUT(DebugMessage, "image") << "ImageIO scheduling block at [" << i << " " << j << "]/[" << rows << " " << cols << "] blocksize = " << block_size.x() << " x " << block_size.y() << "\n";
// Rasterize and save this image block
BBox2i current_bbox(Vector2i(i,j),
@@ -316,7 +316,7 @@ namespace vw {
block_size = resource.block_write_size();
size_t total_num_blocks = ((rows-1)/block_size.y()+1) * ((cols-1)/block_size.x()+1);
- vw_out(DebugMessage,"image") << "write_image: writing " << total_num_blocks << " blocks.\n";
+ VW_OUT(DebugMessage,"image") << "write_image: writing " << total_num_blocks << " blocks.\n";
// Early out for easy case
if (total_num_blocks == 1) {
@@ -325,7 +325,7 @@ namespace vw {
} else {
for (int32 j = 0; j < rows; j+= block_size.y()) {
for (int32 i = 0; i < cols; i+= block_size.x()) {
- vw_out(DebugMessage, "image") << "ImageIO writing block at [" << i << " " << j << "]/[" << rows << " " << cols << "] blocksize = " << block_size.x() << " x " << block_size.y() << "\n";
+ VW_OUT(DebugMessage, "image") << "ImageIO writing block at [" << i << " " << j << "]/[" << rows << " " << cols << "] blocksize = " << block_size.x() << " x " << block_size.y() << "\n";
// Rasterize and save this image block
BBox2i current_bbox(Vector2i(i,j),
View
4 src/vw/Image/ImageResourceView.h
@@ -66,7 +66,7 @@ namespace vw {
result_type operator()( int32 x, int32 y, int32 plane=0 ) const {
Mutex::Lock lock(*m_rsrc_mutex);
#if VW_DEBUG_LEVEL > 1
- vw_out(VerboseDebugMessage, "image") << "ImageResourceView rasterizing pixel (" << x << "," << y << ")" << std::endl;
+ VW_OUT(VerboseDebugMessage, "image") << "ImageResourceView rasterizing pixel (" << x << "," << y << ")" << std::endl;
#endif
ImageView<PixelT> buffer(1,1,m_planes);
read_image( buffer, *m_rsrc, BBox2i(x,y,1,1) );
@@ -87,7 +87,7 @@ namespace vw {
template <class DestT> inline void rasterize( DestT const& dest, BBox2i bbox ) const {
Mutex::Lock lock(*m_rsrc_mutex);
#if VW_DEBUG_LEVEL > 1
- vw_out(VerboseDebugMessage, "image") << "ImageResourceView rasterizing bbox " << bbox << std::endl;
+ VW_OUT(VerboseDebugMessage, "image") << "ImageResourceView rasterizing bbox " << bbox << std::endl;
#endif
read_image( dest, *m_rsrc, bbox );
}
View
2  src/vw/Image/ImageView.h
@@ -186,7 +186,7 @@ namespace vw {
boost::shared_array<PixelT> data( new (std::nothrow) PixelT[size] );
if (!data) {
// print it and throw it for the benefit of OSX, which doesn't print the exception what() on terminate()
- vw_out(ErrorMessage) << "Cannot allocate enough memory for a " << cols << "x" << rows << "x" << planes << " image: too many bytes!" << std::endl;
+ VW_OUT(ErrorMessage) << "Cannot allocate enough memory for a " << cols << "x" << rows << "x" << planes << " image: too many bytes!" << std::endl;
vw_throw(ArgumentErr() << "Cannot allocate enough memory for a " << cols << "x" << rows << "x" << planes << " image: too many bytes!");
}
m_data = data;
View
8 src/vw/Image/Transform.h
@@ -700,11 +700,11 @@ namespace vw {
// If the image bounding box is too large or too small, print a
// warning message.
if ( (bbox.width() * bbox.height()) < min_image_size ) {
- vw_out(WarningMessage, "image") << "Warning: The transformed image exceeds the minimum (" << min_image_size << ") \n"
+ VW_OUT(WarningMessage, "image") << "Warning: The transformed image exceeds the minimum (" << min_image_size << ") \n"
<< " recommended image dimension in compute_transformed_bbox().\n";
}
if ( (bbox.width() * bbox.height()) > max_image_size ) {
- vw_out(WarningMessage, "image") << "Warning: The transformed image exceeds the maximum (" << max_image_size << ") \n"
+ VW_OUT(WarningMessage, "image") << "Warning: The transformed image exceeds the maximum (" << max_image_size << ") \n"
<< " recommended image dimension in compute_transformed_bbox().\n";
}
return bbox;
@@ -754,11 +754,11 @@ namespace vw {
// back and set the size of the output image to the size of the
// input image and print a warning message.
if ( (bbox.width() * bbox.height()) < min_image_size ) {
- vw_out(WarningMessage, "image") << "Warning: The transformed image exceeds the minimum (" << min_image_size << ") \n"
+ VW_OUT(WarningMessage, "image") << "Warning: The transformed image exceeds the minimum (" << min_image_size << ") \n"
<< " recommended image dimension in compute_transformed_bbox_fast().\n";
}
if ( (bbox.width() * bbox.height()) > max_image_size ) {
- vw_out(WarningMessage, "image") << "Warning: The transformed image exceeds the maximum (" << max_image_size << ") \n"
+ VW_OUT(WarningMessage, "image") << "Warning: The transformed image exceeds the maximum (" << max_image_size << ") \n"
<< " recommended image dimension in compute_transformed_bbox_fast().\n";
}
return bbox;
View
40 src/vw/Math/ConjugateGradient.h
@@ -104,7 +104,7 @@ namespace math{
typename FuncT::result_type new_val = func(new_pos);
if( new_val - val <= thresh || count > m_max_iterations ) return new_pos;
//if( ( stepsize < 1e-20 && val-new_val > 0 ) || stepsize < 1e-40 ) {
- // vw_out(DebugMessage, "math") << "ArmijoStepSize punting! (slope=" << dot_prod(grad,dir) << ", delta=" << (new_val-val) << ", thresh=" << thresh << ")" << std::endl;
+ // VW_OUT(DebugMessage, "math") << "ArmijoStepSize punting! (slope=" << dot_prod(grad,dir) << ", delta=" << (new_val-val) << ", thresh=" << thresh << ")" << std::endl;
// return new_pos;
//}
stepsize *= m_beta;
@@ -132,29 +132,29 @@ namespace math{
double cur_stepsize = 0;
double cur_val = val;
double cur_slope = base_slope;
- vw_out(DebugMessage, "math") << "*** CharalambousStepSize ***" << std::endl;
- vw_out(DebugMessage, "math") << "Initial val: " << cur_val << std::endl;
- vw_out(DebugMessage, "math") << "Initial slope: " << cur_slope << std::endl;
+ VW_OUT(DebugMessage, "math") << "*** CharalambousStepSize ***" << std::endl;
+ VW_OUT(DebugMessage, "math") << "Initial val: " << cur_val << std::endl;
+ VW_OUT(DebugMessage, "math") << "Initial slope: " << cur_slope << std::endl;
while( true ) {
double new_stepsize = cur_stepsize + stepdelta;
- vw_out(DebugMessage, "math") << "step: " << new_stepsize << std::endl;
+ VW_OUT(DebugMessage, "math") << "step: " << new_stepsize << std::endl;
typename FuncT::domain_type new_pos = pos + new_stepsize * dir;
typename FuncT::result_type new_val = func(new_pos);
typename FuncT::gradient_type new_grad = func.gradient(new_pos);
double new_slope = dot_prod(new_grad,dir);
- vw_out(DebugMessage, "math") << "val: " << new_val << std::endl;
- vw_out(DebugMessage, "math") << "slope: " << new_slope << std::endl;
+ VW_OUT(DebugMessage, "math") << "val: " << new_val << std::endl;
+ VW_OUT(DebugMessage, "math") << "slope: " << new_slope << std::endl;
if( new_val <= val + mu*new_stepsize*base_slope && fabs(new_slope) <= -sigma*base_slope ) {
- vw_out(DebugMessage, "math") << "*** ACCEPTING! ***" << std::endl;
+ VW_OUT(DebugMessage, "math") << "*** ACCEPTING! ***" << std::endl;
return new_pos;
}
else if( new_slope <= 0 ) {
if( new_val >= val ) {
- vw_out(DebugMessage, "math") << "Too large!" << std::endl;
+ VW_OUT(DebugMessage, "math") << "Too large!" << std::endl;
stepdelta *= 0.1;
}
else {
- vw_out(DebugMessage, "math") << "Too small! (Retaining.)" << std::endl;
+ VW_OUT(DebugMessage, "math") << "Too small! (Retaining.)" << std::endl;
cur_stepsize = new_stepsize;
cur_val = new_val;
cur_slope = new_slope;
@@ -162,23 +162,23 @@ namespace math{
}
}
else {
- vw_out(DebugMessage, "math") << "Interpolating!" << std::endl;
+ VW_OUT(DebugMessage, "math") << "Interpolating!" << std::endl;
double a = 3*((cur_slope+new_slope)*stepdelta - 2*(new_val-cur_val))/(stepdelta*stepdelta*stepdelta);
double b = 2*(3*(new_val-cur_val) - (2*cur_slope+new_slope)*stepdelta)/(stepdelta*stepdelta);
- vw_out(DebugMessage, "math") << "a=" << a << " b=" << b << " c=" << cur_slope << std::endl;
+ VW_OUT(DebugMessage, "math") << "a=" << a << " b=" << b << " c=" << cur_slope << std::endl;
double step = 0;
if( fabs(a)*stepdelta < 1e-4*fabs(b) ) {
- vw_out(DebugMessage, "math") << "Quadratic" << std::endl;
+ VW_OUT(DebugMessage, "math") << "Quadratic" << std::endl;
step = -cur_slope/b;
}
else {
- vw_out(DebugMessage, "math") << "Cubic" << std::endl;
+ VW_OUT(DebugMessage, "math") << "Cubic" << std::endl;
step = (-b+sqrt(b*b-4*a*cur_slope))/(2*a);
}
- vw_out(DebugMessage, "math") << "Before: " << step << std::endl;
+ VW_OUT(DebugMessage, "math") << "Before: " << step << std::endl;
if( step < gamma*stepdelta ) step = gamma*stepdelta;
else if( step > (1-gamma)*stepdelta ) step = (1-gamma)*stepdelta;
- vw_out(DebugMessage, "math") << "After: " << step << std::endl;
+ VW_OUT(DebugMessage, "math") << "After: " << step << std::endl;
stepdelta = step;
}
}
@@ -193,12 +193,12 @@ namespace math{
int numiters ) {
typename FuncT::domain_type pos = seed;
typename FuncT::result_type val = func(pos);
- vw_out(DebugMessage, "math") << "Initial: " << val << std::endl;
+ VW_OUT(DebugMessage, "math") << "Initial: " << val << std::endl;
for( int i=0; i<numiters; ++i ) {
typename FuncT::gradient_type grad = func.gradient( pos );
pos = step( func, pos, val, grad, -grad );
val = func(pos);
- vw_out(DebugMessage, "math") << "Step " << i << ": " << val << std::endl;
+ VW_OUT(DebugMessage, "math") << "Step " << i << ": " << val << std::endl;
}
return pos;
}
@@ -211,7 +211,7 @@ namespace math{
int numiters ) {
typename FuncT::domain_type pos = seed;
typename FuncT::result_type val = func(pos);
- vw_out(DebugMessage, "math") << "Initial: " << val << std::endl;
+ VW_OUT(DebugMessage, "math") << "Initial: " << val << std::endl;
double last_grad_norm2 = 0;
typename FuncT::gradient_type last_dir;
for( int i=0; i<numiters; ++i ) {
@@ -224,7 +224,7 @@ namespace math{
last_grad_norm2 = grad_norm2;
last_dir = dir;
val = func(pos);
- vw_out(DebugMessage, "math") << "Step " << i << ": " << val << std::endl;
+ VW_OUT(DebugMessage, "math") << "Step " << i << ": " << val << std::endl;
}
return pos;
}
View
4 src/vw/Math/EulerAngles.h
@@ -149,10 +149,10 @@ namespace math {
double test = q[0]*q[2]-q[3]*q[1];
// Testing for gimbal lock, if we're within 0.2 degrees of the poles
if ( test > 0.499999 ) {
- vw_out( WarningMessage, "math" ) << "Q2E_XYZ: North Gimbal Lock!\n";
+ VW_OUT( WarningMessage, "math" ) << "Q2E_XYZ: North Gimbal Lock!\n";
return Vector3( -2*atan2(q[3],q[0]), M_PI/2, 0 );
} else if ( test < -0.499999 ) {
- vw_out( WarningMessage, "math" ) << "Q2E_XYZ: South Gimbal Lock!\n";
+ VW_OUT( WarningMessage, "math" ) << "Q2E_XYZ: South Gimbal Lock!\n";
return Vector3( 2*atan2(q[3],q[0]), -M_PI/2, 0 );
}
return Vector3 ( atan2( 2*(q[0]*q[1]+q[2]*q[3]),
View
30 src/vw/Math/LevenbergMarquardt.h
@@ -183,9 +183,9 @@ namespace math {
typename ImplT::result_type error = model.difference(observation, h);
double norm_start = norm_2(error);
- vw_out(DebugMessage, "math") << "LM: initial guess for the model is " << seed << std::endl;
- vw_out(VerboseDebugMessage, "math") << "LM: starting error " << error << std::endl;
- vw_out(DebugMessage, "math") << "LM: starting norm is: " << norm_start << std::endl;
+ VW_OUT(DebugMessage, "math") << "LM: initial guess for the model is " << seed << std::endl;
+ VW_OUT(VerboseDebugMessage, "math") << "LM: starting error " << error << std::endl;
+ VW_OUT(DebugMessage, "math") << "LM: starting norm is: " << norm_start << std::endl;
// Solution may already be good enough
if (norm_start < abs_tolerance)
@@ -195,7 +195,7 @@ namespace math {
while (!done){
bool shortCircuit = false;
- vw_out(DebugMessage, "math") << "LM: outer iteration " << ++outer_iter << " x = " << x << std::endl;
+ VW_OUT(DebugMessage, "math") << "LM: outer iteration " << ++outer_iter << " x = " << x << std::endl;
// Compute the value, derivative, and hessian of the cost function
// at the current point. These remain valid until the parameter
@@ -207,7 +207,7 @@ namespace math {
// Difference between observed and predicted and error (2-norm of difference)
error = model.difference(observation, h);
norm_start = norm_2(error);
- //vw_out(DebugMessage, "math") << "LM: outer iteration starting robust norm: " << norm_start << std::endl;
+ //VW_OUT(DebugMessage, "math") << "LM: outer iteration starting robust norm: " << norm_start << std::endl;
// Measurement Jacobian
typename ImplT::jacobian_type J = model.jacobian(x);
@@ -239,8 +239,8 @@ namespace math {
typename ImplT::result_type error_try = model.difference(observation, h_try);
norm_try = norm_2(error_try);
- //vw_out(VerboseDebugMessage, "math") << "LM: inner iteration " << iterations << " error is " << error_try << std::endl;
- //vw_out(DebugMessage, "math") << "\tLM: inner iteration " << iterations << " norm is " << norm_try << std::endl;
+ //VW_OUT(VerboseDebugMessage, "math") << "LM: inner iteration " << iterations << " error is " << error_try << std::endl;
+ //VW_OUT(DebugMessage, "math") << "\tLM: inner iteration " << iterations << " norm is " << norm_try << std::endl;
if (norm_try > norm_start)
// Increase lambda and try again
@@ -248,30 +248,30 @@ namespace math {
++iterations; // Sanity check on iterations in this loop
if (iterations > 5) {
- //vw_out(DebugMessage, "math") << "\n****LM: too many inner iterations - short circuiting\n" << std::endl;
+ //VW_OUT(DebugMessage, "math") << "\n****LM: too many inner iterations - short circuiting\n" << std::endl;
shortCircuit = true;
norm_try = norm_start;
}
- //vw_out(DebugMessage, "math") << "\tlambda = " << lambda << std::endl;
+ //VW_OUT(DebugMessage, "math") << "\tlambda = " << lambda << std::endl;
}
// Percentage change convergence criterion
if (((norm_start-norm_try)/norm_start) < rel_tolerance) {
status = optimization::eConvergedRelTolerance;
- vw_out(DebugMessage, "math") << "CONVERGED TO RELATIVE TOLERANCE\n";
+ VW_OUT(DebugMessage, "math") << "CONVERGED TO RELATIVE TOLERANCE\n";
done = true;
}
// Absolute error convergence criterion
if (norm_try < abs_tolerance) {
status = optimization::eConvergedAbsTolerance;
- vw_out(DebugMessage, "math") << "CONVERGED TO ABSOLUTE TOLERANCE\n";
+ VW_OUT(DebugMessage, "math") << "CONVERGED TO ABSOLUTE TOLERANCE\n";
done = true;
}
// Max iterations convergence criterion
if (outer_iter >= max_iterations) {
- vw_out(DebugMessage, "math") << "REACHED MAX ITERATIONS!";
+ VW_OUT(DebugMessage, "math") << "REACHED MAX ITERATIONS!";
done = true;
}
@@ -286,10 +286,10 @@ namespace math {
// Decrease lambda
lambda /= 10;
- //vw_out(DebugMessage, "math") << "lambda = " << lambda << std::endl;
- //vw_out(DebugMessage, "math") << "LM: end of outer iteration " << outer_iter << " with error " << norm_try << std::endl;
+ //VW_OUT(DebugMessage, "math") << "lambda = " << lambda << std::endl;
+ //VW_OUT(DebugMessage, "math") << "LM: end of outer iteration " << outer_iter << " with error " << norm_try << std::endl;
}
- vw_out(DebugMessage, "math") << "LM: finished with: " << outer_iter << "\n";
+ VW_OUT(DebugMessage, "math") << "LM: finished with: " << outer_iter << "\n";
return x;
}
View
6 src/vw/Math/MatrixSparseSkyline.h
@@ -128,7 +128,7 @@ namespace math {
VW_ASSERT( m.impl().rows() == m_matrix.size1() &&
m.impl().cols() == m_matrix.size2(), ArgumentErr() << "Matrix must have dimensions "
<< m_matrix.size1() << "x" << m_matrix.size2() << "." );
- vw_out(vw::WarningMessage, "math") << "Sparsity destroyed in generic assignment to MatrixSparseSkyline.\n";
+ VW_OUT(vw::WarningMessage, "math") << "Sparsity destroyed in generic assignment to MatrixSparseSkyline.\n";
for ( size_t i = 0; i < m.rows(); i++ ) {
for ( size_t j = 0; j < m.cols(); j++ ) {
(*this)(i,j) = m(i,j);
@@ -641,7 +641,7 @@ namespace math {
boost::property_map<Graph,boost::vertex_index_t>::type
index_map = get(boost::vertex_index, G);
- vw_out(DebugMessage,"math") << "-> CutHill McKee starting B: "
+ VW_OUT(DebugMessage,"math") << "-> CutHill McKee starting B: "
<< boost::bandwidth(G) << "\n";
// Solving for CutHill McKee
@@ -658,7 +658,7 @@ namespace math {
// Finding new bandwidth for debug purposes
for (size_type c = 0; c != inv_perm.size(); ++c )
perm[index_map[inv_perm[c]]] = c;
- vw_out(DebugMessage,"math") << "-> CutHill McKee ending B: "
+ VW_OUT(DebugMessage,"math") << "-> CutHill McKee ending B: "
<< boost::bandwidth(G, make_iterator_property_map(&perm[0], index_map, perm[0])) << "\n";
return lookup_chart;
View
12 src/vw/Math/NelderMead.h
@@ -98,9 +98,9 @@ namespace math {
void print_vertices() {
for ( vertex_iterator iter = m_vertices.begin();
iter != m_vertices.end(); ++iter) {
- vw_out(DebugMessage, "math") << "\tSIMPLEX: " << (*iter).first << "[" << (*iter).second << "] ";
+ VW_OUT(DebugMessage, "math") << "\tSIMPLEX: " << (*iter).first << "[" << (*iter).second << "] ";
}
- vw_out(InfoMessage, "math") << "\n";
+ VW_OUT(InfoMessage, "math") << "\n";
}
DomainT location() { return lowest_vertex().first; }
@@ -184,8 +184,8 @@ namespace math {
status = optimization::eNelderMeadConvergedRelTolerance;
if (verbose) {
- vw_out(InfoMessage, "math") << "Nelder Mead Optimizer:\n";
- vw_out(InfoMessage, "math") << "\tTol: " << tolerance << " MaxIter: " << max_iterations << " Restarts: " << restarts << "\n";
+ VW_OUT(InfoMessage, "math") << "Nelder Mead Optimizer:\n";
+ VW_OUT(InfoMessage, "math") << "\tTol: " << tolerance << " MaxIter: " << max_iterations << " Restarts: " << restarts << "\n";
}
// Restart the simplex several times -- this prevents false
@@ -203,11 +203,11 @@ namespace math {
delta = simplex.update();
++iterations;
if (verbose && iterations % 100 == 0)
- vw_out(DebugMessage, "math") << "\t" << iterations << ": " << simplex.location() << "[" << simplex.value() << "]\n";
+ VW_OUT(DebugMessage, "math") << "\t" << iterations << ": " << simplex.location() << "[" << simplex.value() << "]\n";
}
if (verbose)
- vw_out(DebugMessage, "math") << "\t" << iterations << ": " << simplex.location() << "[" << simplex.value() << "]\n";
+ VW_OUT(DebugMessage, "math") << "\t" << iterations << ": " << simplex.location() << "[" << simplex.value() << "]\n";
// Store the best result so far.
result = simplex.location();
View
14 src/vw/Math/ParticleSwarmOptimization.h
@@ -53,7 +53,7 @@ namespace math {
// external loop - run the whole PSO multiple times in case it gets in some local optimum
// in function of the initial conditions and/or the development over time
for (int start = 0; start < restarts; start++) {
- if (verbose) vw::vw_out(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << std::endl;
+ if (verbose) VW_OUT(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << std::endl;
// initialize x random and v zero
for (unsigned int i = 0; i < x.size(); i++) {
@@ -70,7 +70,7 @@ namespace math {
x_hat_val[i] = func(x_hat[i]);
}
- if (verbose) vw::vw_out(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << " initialized particles" << std::endl;
+ if (verbose) VW_OUT(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << " initialized particles" << std::endl;
// search globally minimum particle
for (unsigned int i = 0; i < x.size(); i++) {
@@ -80,7 +80,7 @@ namespace math {
}
}
- if (verbose) vw::vw_out(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << " found globally max particle with val " << g_hat_val << std::endl;
+ if (verbose) VW_OUT(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << " found globally max particle with val " << g_hat_val << std::endl;
// create two random number vectors with elements 0..1
DomainT r1, r2;
@@ -89,7 +89,7 @@ namespace math {
// iterate
for (unsigned int iter = 0; iter < n_iter; iter++) {
- if (verbose) vw::vw_out(vw::VerboseDebugMessage, "math") << "PSO run " << start << "/" << restarts << " iteration " << iter << "/" << n_iter << std::endl;
+ if (verbose) VW_OUT(vw::VerboseDebugMessage, "math") << "PSO run " << start << "/" << restarts << " iteration " << iter << "/" << n_iter << std::endl;
// update all particles
for (unsigned int i = 0; i < x.size(); i++) {
@@ -108,19 +108,19 @@ namespace math {
if (norm > v_max*v_max)
v[i] /= vw::sqrt(norm);
- if (verbose) vw::vw_out(vw::VerboseDebugMessage, "math") << "PSO x = " << x[i] << " with velocity v = " << v[i] << std::endl;
+ if (verbose) VW_OUT(vw::VerboseDebugMessage, "math") << "PSO x = " << x[i] << " with velocity v = " << v[i] << std::endl;
// update local maximum
double x_i_val = func(x[i]);
if (x_i_val < x_hat_val[i]) {
- if (verbose) vw::vw_out(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << " iteration " << iter << "/" << n_iter << " new local minimum " << x_i_val << std::endl;
+ if (verbose) VW_OUT(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << " iteration " << iter << "/" << n_iter << " new local minimum " << x_i_val << std::endl;
x_hat[i] = x[i];
x_hat_val[i] = x_i_val;
}
// update global maximum
if (x_i_val < g_hat_val) {
- if (verbose) vw::vw_out(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << " iteration " << iter << "/" << n_iter << " new global minimum " << x_i_val << std::endl;
+ if (verbose) VW_OUT(vw::VerboseDebugMessage, "math") << "PSO run " << start+1 << "/" << restarts << " iteration " << iter << "/" << n_iter << " new global minimum " << x_i_val << std::endl;
g_hat = x[i];
g_hat_val = x_i_val;
}
View
6 src/vw/Math/RANSAC.h
@@ -243,9 +243,9 @@ namespace math {
inliers( H, p1, p2, try1, try2 );
}
// For debugging
- vw_out(InfoMessage, "interest_point") << "\nRANSAC Summary:" << std::endl;
- vw_out(InfoMessage, "interest_point") << "\tFit = " << H << std::endl;
- vw_out(InfoMessage, "interest_point") << "\tInliers / Total = " << try1.size() << " / " << p1.size() << "\n\n";
+ VW_OUT(InfoMessage, "interest_point") << "\nRANSAC Summary:" << std::endl;
+ VW_OUT(InfoMessage, "interest_point") << "\tFit = " << H << std::endl;
+ VW_OUT(InfoMessage, "interest_point") << "\tInliers / Total = " << try1.size() << " / " << p1.size() << "\n\n";
return H;
}
Please sign in to comment.
Something went wrong with that request. Please try again.