boost

Comparing 2 graphs created by Boost Graph Library

This may be a rather novice or even wrong question so please be forgiving. Is there a way to compare 2 graphs created using the Boost Graph Library => with 1 graph created in memory and the 2nd loaded from an archive (i.e. 2nd was serialized out previously)? I don't see an operator== provided in BGL's documentation, but not sure if that...

Compiling C++ Code With Boost's Numeric Binding Library to Solve Ax=b Linear System

I am using Numeric Library Bindings for Boost UBlas to solve a simple linear system: #include<boost/numeric/ublas/matrix.hpp> #include<boost/numeric/ublas/io.hpp> #include<boost/numeric/bindings/traits/ublas_matrix.hpp> #include<boost/numeric/bindings/lapack/gesv.hpp> #include <boost/numeric/bindings/traits/ublas_vector2.hpp> namespac...

How to assign / copy a Boost::multi_array

I want to assign a copy of a boost::multi_array. How can I do this. The object where I want to assign it to has been initialized with the default constructors. This code does not work, because the dimensions and size are not the same class Field { boost::multi_array<char, 2> m_f; void set_f(boost::multi_array<short, 2> &f) { m...

C++ Memory Efficient Solution for Ax=b Linear Algebra System

I am using Numeric Library Bindings for Boost UBlas to solve a simple linear system. The following works fine, except it is limited to handling matrices A(m x m) for relatively small 'm'. In practice I have a much larger matrix with dimension m= 10^6 (up to 10^7). Is there existing C++ approach for solving Ax=b that uses memory efficien...

Boost Documentation

Hi, what's the easiest way for me to get a pdf of the boost-documentation? I have a windows system with eclipse cdt, mingw and boost just unzipped. ...

linking boost.asio

Hello, I have a problem linking boost.asio. It uses boost.system and the linker errors start with: /boost_1_39_0/boost/system/error_code.hpp:205: undefined reference to `boost::system::get_system_category()' which means I need to link boost.system. I already built boost and I have now several lib files. boost_system-mgw32-d-1_39.dll...

(simple) boost thread_group question

I'm trying to write a fairly simple threaded application, but am new to boost's thread library. A simple test program I'm working on is: #include <iostream> #include <boost/thread.hpp> int result = 0; boost::mutex result_mutex; boost::thread_group g; void threaded_function(int i) { for(; i < 100000; ++i) {} { boost::mut...

When using boost::program_options, how does one set the name of the argument?

When using boost::program_options, how do I set the name of an argument for boost::program_options::value<>()? #include <iostream> #include <boost/program_options.hpp> int main() { boost::program_options::options_description desc; desc.add_options() ("width", boost::program_options::value<int>(), "Give width"); std::co...

Is there an elegant way to bridge two devices/streams in ASIO?

Given two stream-oriented I/O objects in Asio, what is the simplest way to forward data from one device to the other in both directions? Could this be done with boost::iostreams::combination or boost::iostreams:copy perhaps? Or is a manual approach better--waiting for data on each end and then writing it out to the other stream? In other...

Does Qt work well with STL & Boost ?

I am interested in learning Qt. I am fairly good with C++, STL and Boost. I like STL/Boost style very much, and I use them with C++ whenever I can in uni projects. However, I always miss the GUI. It seems that Qt is the best solution in my case. Qt does have a good collection of containers, but I am greatly familiar with STL/Boost stuff....

How to unordered_set<tuple<int,int>> ?

I had encountered strange problem while construct a unordeed_set<tuple<int,int>>. I had tried VC++8, gcc3.2, gcc4.3, all have the same result. I have no idea what's wrong with the code, following is my code: #include <boost/unordered_set.hpp> #include <boost/tuple/tuple.hpp> // For unordered container, the declaration of operator== #inc...

Very poor boost::lexical_cast performance

Hello, Windows XP SP3. Core 2 Duo 2.0 GHz. I'm finding the boost::lexical_cast performance to be extremely slow. Wanted to find out ways to speed up the code. Using /O2 optimizations on visual c++ 2008 and comparing with java 1.6 and python 2.6.2 I see the following results. Integer casting: c++: std::string s ; for(int i = 0; i < 10...

Using boost::tokenizer with string delimiters

I've been looking boost::tokenizer, and I've found that the documentation is very thin. Is it possible to make it tokenize a string such as "dolphin--monkey--baboon" and make every word a token, as well as every double dash a token? From the examples I've only seen single character delimiters being allowed. Is the library not advanced en...

How to escape a string for use in Boost Regex

I'm just getting my head around regular expressions, and I'm using the Boost Regex library. I have a need to use a regex that includes a specific URL, and it chokes because obviously there are characters in the URL that are reserved for regex and need to be escaped. Is there any function or method in the Boost library to escape a strin...

Installing Libboost 1.38 on Ubuntu 8.10

Is there a way to Install Libboost 1.38 on Ubuntu 8.10? The highest version in my repositories is 1.35. It has been suggested that there may be some repositories I could add to accomplish this, but my searches haven't yielded anything. Do I have to resort to source code? If so, what is the best way to accomplish this? Thanks ...

Synchro boost example problem

Dear everybody, I have a problem using asio. My client/server application requires only synchronous communication. So, using the examples for synchro from the boost homepage, I have set up two procedures to send and receive data. Their code is as follows: void vReceive(tcp::socket & socket, std::string & szDest){ char szTmp_Buf [BUF...

Apt-Pinning: Installing libboost from Jaunty repository into Intrepid Ubuntu

I'm trying to install libboost 1.38 in Ubuntu 8.10 using a Ubuntu 9.04 repository since it isn't avalable in any of the 8.10 repositories. I'm trying to use an Apt-pinning by adding the following lines of code: /etc/apt/sources.list: deb http://us.archive.ubuntu.com/ubuntu/ jaunty universe /etc/apt/preferences (Which I had to create):...

boost::ifind_first problem

I am trying to use boost string algorithms for case insensitive search. total newbie here. if I am using it this way, I get an error. std::string str1("Hello world"); std::string str2("hello"); if ( boost::ifind_first(str1, str2) ) some code; Converting to char pointers resolves the problem. boost::ifind_first( (char*)str1.c_str(), ...

Why is Boost scoped_lock not unlocking the mutex?

I've been using boost::mutex::scoped_lock in this manner: void ClassName::FunctionName() { { boost::mutex::scoped_lock scopedLock(mutex_); //do stuff waitBoolean=true; } while(waitBoolean == true ){ sleep(1); } //get on with the thread's activities } Basically it sets waitBoolean, and the ...

Boost Program Options Examples

In the boost tutorials online for program options : http://www.boost.org/doc/libs/1_39_0/doc/html/program_options/tutorial.html#id2891824 It says that the complete code examples can be found at "BOOST_ROOT/libs/program_options/example" directory. I could not figure out where is this. Can anyone help me finding the examples? ...