Hello!
Does anyone know how to speed up boost::numeric::ublas::vector?
I am using typedef ublas::vector<float, ublas::bounded_array<float, 3> > MYVECTOR3 and compare it's speed to D3DXVECTOR3 on plain operations.
The test look the following way:
#include <d3dx9.h>
#pragma comment(lib, "d3dx9.lib")
static const size_t kRuns = static_...
What does "equivalent" mean in the definition of concepts, such as http://www.boost.org/doc/libs/1_43_0/libs/utility/CopyConstructible.html?
Shallow copy?
Deep copy?
Either?
...
I'm looking for suggestions for an efficient algorithm for finding all matches in a large body of text. Terms to search for will be contained in a list and can have 1000+ possibilities. The search terms may be 1 or more words.
Obviously I could make multiple passes through the text comparing against each search term. Not too efficient.
...
I'm trying to figure out how could many boost classes be able to accept a function signature as template argument and then "extract" from there the result type, first argument type and so on.
template <class Signature>
class myfunction_ptr
{
Signature* fn_ptr;
public:
typedef /*something*/ result_type; // How can I define this?
...
I have a structure
typedef struct myStruct_st
{
int a;
}myStruct;
It can be created using
myStruct * myStruct_new()
{
printf("Allocate\n");
return new myStruct;
}
And deleted using
static void myStruct_free(myStruct * ptr)
{
printf("Deallocate\n");
delete ptr;
}
I want the memory allocated for the structure freed au...
Hi,
I need to generalise a C++ typedef so I do not need to copy and paste a lot of code. I am serializing blitz arrays using boost and I am defining my own load and save methods and need to do this based on template parameters. Basically I don't know how to generalize
typedef blitz::Array<double, 2> my_Matrix;
for higher order te...
Hello!
I was looking for some suitable 2D element container. What I want is the ability to iterate through every element of the container using, for example BOOST_FOREACH and I also would like to have an ability to construct subview (slices / subranges) of my container and, probably iterate through them too.
Right now I am using boost:...
I have successfully installed boost, compiled binaries, and built bcp. I have also been able to extract the regex library using bcp. After doing this, I found a gcc_gen.sh script and bunch of makefiles under
my_exported_boost_regex/libs/regex/build/
and used one of them to make
my_exported_boost_regex/libs/regex/build/gcc/libboos...
I'm new to Boost, but not to functional programming, and I'm trying to see where Boost can help me out.
I have a list of 2D points, and I want to extract the minimum x coordinate. The Point class has a member function float x() const so I can use boost::mem_fn as follows:
boost::mem_fn(&Point::x)
But in order to use std::min_element,...
Is there a way to round to the nearest number in the Boost library? I mean any number, 2's, 5's, 17's and so on and so forth.
Or is there another way to do it?
...
I have a DLL which has a function which accepts a function pointer converts it to a boost::function. This is then stored and then called from inside the DLL.
I want to add a function to the DLL to handle member functions in a similar way. I know I need to use boost::bind to wrap the member function pointer and the object together. I wan...
I asked a previous question about producer/consumer code that was overly general (though the answers were certainly helpful). So I've taken the suggestions from an earlier SO question by another author and converted them to C++ and boost. However I'm always a bit concerned about multithreaded code - so if anyone can see any obvious impro...
I have created a test application to illustrate my problem. It parses a list of integers preceded by "a=" or "b=" and is separated by "\r\n". The list contains multiple occurrences of those fields in any order.
#include <string>
#include <vector>
#include <iostream>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/includ...
I have a class with signal member encapsulated with boost::function.
Is it possible to add another signal as a handler with this API?
class Foo
{
public:
VOID AddHandler(boost::function<VOID()> handler)
{
m_signal.connect(handler);
}
private:
boost::signal<VOID()> m_signal;
};
boost::signal<VOID()> signal;
VOID SignalC...
I have the following XML file:
<xml version="1.0" encoding="utf-8"?>
<Data>
<Parameter1>1</Parameter1>
</Data>
I want to add a new node: Parameter2="2" to the Data node. This code doesn't work, saved file still contains only one parameter:
boost::property_tree::ptree tree;
boost::property_tree::ptree dataTree;
read...
I think I'm missing something simple here. I'm using Boost's shared_ptr.
shared_ptr<Foo> pA(new Foo());
shared_ptr<Foo> pB(new Foo());
Now, I want to switch pB so it contains the contents of pA, decrementing the ref count of pB. How can I do this?
...
Hello all,
I am working on a AI dynamic link library. It is to be explicitly linked and all of this is handled by a simple header include.
I am at the moment trying to create the code for the DLL to be able to call functions in the main EXE to manipulate the world and also to be able to query functions to learn about the state of the ...
Hello,
I want to install boost library on ma PC with Vista and Visual Studio 2010.
First of all a downloaded boost 1.42 from official site and unpacked to c:\boost_1_42_0
Then I invoked bootstrap.bat but i get some errors:
c:\boost_1_42_0>bootstrap.bat
Building Boost.Jam build engine
Failed to build Boost.Jam build engine.
Please con...
When a function should take a boost::shared_ptr, are you passing it
by const reference void foo(const boost::shared_ptr<T>& p)
or by value void foo(boost::shared_ptr<T> p) ?
I would prefer the first method because I suspect it to be faster. But is this really worth a though or are there any additional issues?
Edit: Could you please g...
#include <list>
#include <boost/tuple/tuple.hpp>
template<class InputIterator>
void f(InputIterator it)
{
typedef boost::tuple<typename InputIterator::value_type, int> Pair;
std::list<Pair> paired;
typename std::list<Pair>::const_iterator output;
for(output=paired.begin(); output!=paired.end(); ++output)
{
ou...