Gennadiy Rozental | 1 May 2007 02:59
Picon

Re: [1.33.1][test][vc80]newuserquestionconcerning1_33_1\libs\test\doc\examples\unit_test_example1.html&unit_test_example1.cpp/


"John McMahon" <john_gg_mcmahon <at> hotmail.com> wrote in message 
news:f15iu8$c6d$1 <at> sea.gmane.org...
> Would it be this?:
> "Use /EHa to specify the asynchronous exception handling model (C++ 
> exception handling with structured exception handling exceptions). /EHa 
> may result in a less performant image because the compiler will not 
> optimize a catch block as aggressively, even if the compiler does not see 
> a throw.
> /GX is deprecated in Visual C++ 2005; use /EH (Exception Handling Model) 
> instead. For more information, see Deprecated Compiler Options."
>
> Also, I'm guessing, but it looks like I should set the compiler flag in
> boost\boost_1_33_1\tools\build\v1\vc-8_0-tools.jam
>
> I edited it to contain
> flags vc-8_0 C++FLAGS : /EHa ; # no idea if the syntax is right; also is 
> this the right compiler option?  or /EHsh.  Tried both.  to no avail.

Ask Boost.Build guys.

> and ran
>
> bjam --v2 --with-test "-sTOOLS=vc-8_0" "-sVS80_ROOT=C:\Program 
> Files\Microsoft Visual Studio 8\VC"

Make sure you cleanup results of previous run

> (I see no corresponding v2 vc-8_0-tools.jam.)
>
(Continue reading)

Peter Dulimov | 1 May 2007 02:10
Picon

[1.33.1][Iostreams][compression] Jamfile does not copy compression libraries into target destination, on Windows platform.


Hello,

I built boost 1.33.1 on my PC with the source for the bzip2 and zlib
libraries in 
order to enable the Iostreams compression filters.

While doing this, I discovered that "-sNO_COMPRESSION=0" in the bjam 
options, (in order to override the defaults that are selected for
building 
on the PC platform), causes the build process to stop.  Just leave it
out.
Also, the bzip2 and zlib libraries aren't copied with the rest of the 
libraries.  You need to find them and copy them into place manually.  I 
suspect this to be a bug in the Jamfile.

This is the command that I issued to build Boost and the compression 
libraries:

bjam "-sTOOLS=vc-7_1" "--prefix=c:\Boost"
"--exec-prefix=c:\Boost\MSVC71" 
"--builddir=c:\temp\boostbuild" "--with-python-root=c:\Python" 
"--with-python-version=2.5"
"-sBZIP2_SOURCE=c:\Downloads\Boost\bzip2-1.0.4" 
"-sZLIB_SOURCE=c:\Downloads\Boost\zlib-1.2.3" install

Regards,

Peter.

(Continue reading)

John Maddock | 1 May 2007 11:17
Picon

Re: Regex failure when matching with a POSIX extendedregexp

Roger Leigh wrote:
>> Hi folks,
>>
>> The following code demonstrates the problem I'm having.  I'm using
>> Boost 1.33.1 (Debian), but IIRC this worked last year with the same
>> version because I tested it; possibly a Debian-specific regression?

> I expect both regular expressions here to match with the value string.
> They certainly to with egrep.  However, I only get the second to
> match:
>
> % g++ -c regex.cc -o regex.o && g++ -o regex regex.o -lboost_regex
> % ./regex
> It didn't match the first
> It matched the second
>
> Am I correct in my expectation that expression1 will match?  If not,
> what should I be doing to make it match?

Use regex_search.  regex_match will only succeed if the expression matches 
*all* of the string, regex_search will *find* a sub-string that matches.

John.
Hughes, James | 1 May 2007 11:18
Picon

[Shared_ptrs] As I doing this right

Although I have been using shared_ptr's for a while, I still get a bit
confused with polymorphic stuff ...no change there.

An pseudocode example:

Class A
{
};

Class B : public A
{
 DoStuff1();
 DoStuff2();
 DoStuff3();
 DoStuff4()
};

// MyFunction handles A and classes derived from A
MyFunction(shared_ptr<A>)
{
};

Main()
{
  shared_ptr<A> poly<new B);   // OK so far

  MyFunction(poly);		 // Still OK - 

  // OK, done this, but now if I want to call a load of stuff in an
instance of B
(Continue reading)

John Reid | 1 May 2007 12:12
Picon

Re: BGL python: dijkstra_shortest_paths

Doug Gregor wrote:
> I see what's going on. The documentation says that weight_map is  
> optional (defaults to all weights = 1.0), but the code didn't agree.  
> I've just committed a fix to the SVN repository that makes weight_map  
> optional for dijkstra_shortest_paths... your example code works fine  
> for me, now.

Great

> Again, my apologies for the abysmal response time :(
> 
> 	- Doug

No worries - I'm just pleased I get to use the BGL from python.

Cheers,
John.
John McMahon | 1 May 2007 12:53
Picon
Favicon

Re: [1.33.1][test][vc80]newuserquestionconcerning1_33_1\libs\test\doc\examples\unit_test_example1.html&unit_test_example1.cpp/

Hi Grennadiy, thanks for your help so far.
I might just switch to the no libraries solution and wait for 1.34 binaries to be built, since I don't have time on my schedule to dig deeper into the boost build. 
 
Correct me if I'm wrong - if I chose to use the synchronous exceptions version of the libraries now on Boost Consulting website, the core libraries ought to work fine, it is just that I ought to expect runtime exceptions to terminate the execution of any code I write using it.  Ie please confirm that there's no reason to think that boost-test, etc might not function with this exception model.
 
Just on the no-libraries solution.  I can't find anything documented about any special compiler settings to get it to work with vc80.
When I set /EHsc, the popped up exception occurs.  When I set /EHa, the program _appears_ to finish fine, but on closer inspection of the console output, I discover the access violation message is there in the console.  But I guess this is not what I should get with my no-libraries test.  What am I doing wrong here?
--
OUTPUT:
$ ./Boost_test_1_withoutSeparateLibrary.exe
Running 1 test case...
d:/john/syncfolder/projects/programming/c++/vc++/projects/boost_test_1/boost_test_1/getstarted.cpp(13): error in "free_te
st_function": check 3 == 1 failed
unknown location(0): fatal error in "free_test_function": memory access violation
 
*** 1 failure detected (1 failure expected) in test suite "Unit test example 1"
---

#include <boost/test/included/unit_test_framework.hpp>

using boost::unit_test::test_suite;

void free_test_function(){

BOOST_CHECK(3 == 1);

int* p = (int*)0;

*p = 0;}

test_suite* init_unit_test_suite( int, char* [] ) {

test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" );

test->add( BOOST_TEST_CASE( &free_test_function ), 1 /* expected one error */ );

return test;}

 

_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
JOAQUIN LOPEZ MU?Z | 1 May 2007 13:53
Picon
Gravatar

Re: [multi_index] 2D/3D range seaching

----- Mensaje original -----
De: Chris Fairles <chris.fairles <at> gmail.com>
Fecha: Lunes, Abril 30, 2007 9:44 pm
Asunto: [Boost-users] [multi_index] 2D/3D range seaching
Para: boost-users <at> lists.boost.org

> At first glance, it looked like the multi_index lib (perhaps combined
> with the range lib) might provide a convenient way to search for
> ranges of two+ indicies. For example, points. You have a grid of
> random points and you want a pair of iterators that contain all 
points
> within the cube (x1,y1,z1) and (x2,y2,z2) .
> 
> I made a multi_index container with a composite key containing all
> three coords contained within a point class.
> 
> struct point {
>  int x, y ,z;
> };
> 
> struct coords_key : composite_key<
>  point,
>  member<point,int,x>,
>  member<point,int,y>,
>  member<point,int,z>
> >{};
> 
> struct coords{};
> 
> typedef multi_index_container<
>  point,
>  indexed_by<
>    ordered_non_unique<tag<coords>, coords_key>
> >
> > point_set;
> 
> int main() {
>  point_set p;
> 
>  p.insert(point(1,2,2));
>  p.insert(point(2,3,1));
>  p.insert(point(1,2,3));
>  p.insert(point(10,3,2));
> 
>  point_set::iterator it = p.lower_bound(make_tuple(1,1,1));
>  point_set::iterator it2 = p.upper_bound(make_tuple(3,3,3));
>  return 0;
> }
> 
> it would be great if [it, it2] contained the first four points,
> but this is not the case. If I run this code, it == it2 == the
> first point.
> 
> Am i barking up the wrong tree? Or is this doable.

Hello Chris,

I'm afraid you can't tweak a multi_index_container or any other
STL-compatible container so that their associated ranges are
actually prisms in 2- or 3-D: basically, ranges and prisms
do not behave the same. For instance, given three iterators
it1,it2,it3, the following hold of ranges:

  [it1,it3) is the disjoint union of [it1,it2) and [it2,it3),

which is not true of prisms (in 2 or more dimensions),
as you can easily visualize. 

So, you have to resort to more elaborate data structures or
algorithms in order to do what you want. A crude way to
get the points in the rectangle [x1,y1,x2,y2) with B.MI
could be coded as follows (done in 2D for simplicity of
exposition):

  struct point {
    int x, y;
  };

  struct coords_xy_key : composite_key<
    point,
    member<point,int,x>,
    member<point,int,y>
  >{};

  struct coords_yx_key : composite_key<
    point,
    member<point,int,y>,
    member<point,int,x>
  >{};

  struct coords_xy{};
  struct coords_yx{};

  typedef multi_index_container<
    point,
    indexed_by<
      ordered_non_unique<tag<coords_xy>, coords_key_xy>,
      ordered_non_unique<tag<coords_yx>, coords_key_yx>
   >
  > point_set;

  template<typename F
  void for_each_in_rectangle(point x1,point y1,point x2,point y2,Fun f)
  {
    point_set::iterator it=p.lower_bound(make_tuple(x1));
    while(it!=p.end()&&it->x<x2){
      point_set::index_iterator<coords_key_yx>::type ityx1=
        p.get<coords_key_yx>().lower_bound(it->x,y1);
      point_set::index_iterator<coords_key_yx>::type ityx2=
        p.get<coords_key_yx>().upper_bound(it->x,y2);
      // [ityx1,ityx2) is the vertical segment of the rectangle
      // with x-coordinate== it->x.

      while(ityx1!=ityx2)f(*ityx1++);

      // next non-empty x-coordinate
      it=p.upper_bound(make_tuple(it->x));
    }
  }

This has not been compiled and will surely contain some
sintax erros, but you get the idea. Of course, this is not terribly
efficient, and if you want maximum performance you should probably
go to dedicated spatial indexing data structures like quadtress and
octrees.

HTH,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Chris Fairles | 1 May 2007 14:13
Picon

Re: [multi_index] 2D/3D range seaching

Thanks for the input. I currently use kd-trees to do such range
searches. Its fairly efficient, I think 2D worst case range search is
around O(sqrt(N)) assuming its perfectly balanced... its slightly
worse for a random tree.

Maybe theres interest in a k-D set container implemented with such a
structure (although theres probably more efficient methods, kd-trees
are fairly simple).

Chris

On 5/1/07, "JOAQUIN LOPEZ MU?Z" <joaquin <at> tid.es> wrote:
> ----- Mensaje original -----
> De: Chris Fairles <chris.fairles <at> gmail.com>
> Fecha: Lunes, Abril 30, 2007 9:44 pm
> Asunto: [Boost-users] [multi_index] 2D/3D range seaching
> Para: boost-users <at> lists.boost.org
>
> > At first glance, it looked like the multi_index lib (perhaps combined
> > with the range lib) might provide a convenient way to search for
> > ranges of two+ indicies. For example, points. You have a grid of
> > random points and you want a pair of iterators that contain all
> points
> > within the cube (x1,y1,z1) and (x2,y2,z2) .
> >
> > I made a multi_index container with a composite key containing all
> > three coords contained within a point class.
> >
> > struct point {
> >  int x, y ,z;
> > };
> >
> > struct coords_key : composite_key<
> >  point,
> >  member<point,int,x>,
> >  member<point,int,y>,
> >  member<point,int,z>
> > >{};
> >
> > struct coords{};
> >
> > typedef multi_index_container<
> >  point,
> >  indexed_by<
> >    ordered_non_unique<tag<coords>, coords_key>
> > >
> > > point_set;
> >
> > int main() {
> >  point_set p;
> >
> >  p.insert(point(1,2,2));
> >  p.insert(point(2,3,1));
> >  p.insert(point(1,2,3));
> >  p.insert(point(10,3,2));
> >
> >  point_set::iterator it = p.lower_bound(make_tuple(1,1,1));
> >  point_set::iterator it2 = p.upper_bound(make_tuple(3,3,3));
> >  return 0;
> > }
> >
> > it would be great if [it, it2] contained the first four points,
> > but this is not the case. If I run this code, it == it2 == the
> > first point.
> >
> > Am i barking up the wrong tree? Or is this doable.
>
> Hello Chris,
>
> I'm afraid you can't tweak a multi_index_container or any other
> STL-compatible container so that their associated ranges are
> actually prisms in 2- or 3-D: basically, ranges and prisms
> do not behave the same. For instance, given three iterators
> it1,it2,it3, the following hold of ranges:
>
>   [it1,it3) is the disjoint union of [it1,it2) and [it2,it3),
>
> which is not true of prisms (in 2 or more dimensions),
> as you can easily visualize.
>
> So, you have to resort to more elaborate data structures or
> algorithms in order to do what you want. A crude way to
> get the points in the rectangle [x1,y1,x2,y2) with B.MI
> could be coded as follows (done in 2D for simplicity of
> exposition):
>
>   struct point {
>     int x, y;
>   };
>
>   struct coords_xy_key : composite_key<
>     point,
>     member<point,int,x>,
>     member<point,int,y>
>   >{};
>
>   struct coords_yx_key : composite_key<
>     point,
>     member<point,int,y>,
>     member<point,int,x>
>   >{};
>
>   struct coords_xy{};
>   struct coords_yx{};
>
>   typedef multi_index_container<
>     point,
>     indexed_by<
>       ordered_non_unique<tag<coords_xy>, coords_key_xy>,
>       ordered_non_unique<tag<coords_yx>, coords_key_yx>
>    >
>   > point_set;
>
>   template<typename F
>   void for_each_in_rectangle(point x1,point y1,point x2,point y2,Fun f)
>   {
>     point_set::iterator it=p.lower_bound(make_tuple(x1));
>     while(it!=p.end()&&it->x<x2){
>       point_set::index_iterator<coords_key_yx>::type ityx1=
>         p.get<coords_key_yx>().lower_bound(it->x,y1);
>       point_set::index_iterator<coords_key_yx>::type ityx2=
>         p.get<coords_key_yx>().upper_bound(it->x,y2);
>       // [ityx1,ityx2) is the vertical segment of the rectangle
>       // with x-coordinate== it->x.
>
>       while(ityx1!=ityx2)f(*ityx1++);
>
>       // next non-empty x-coordinate
>       it=p.upper_bound(make_tuple(it->x));
>     }
>   }
>
> This has not been compiled and will surely contain some
> sintax erros, but you get the idea. Of course, this is not terribly
> efficient, and if you want maximum performance you should probably
> go to dedicated spatial indexing data structures like quadtress and
> octrees.
>
> HTH,
>
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo
> _______________________________________________
> Boost-users mailing list
> Boost-users <at> lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
John Reid | 1 May 2007 14:52
Picon

Re: BGL python: dijkstra_shortest_paths

A quick note to say my original code was wrong in another way:
distances = graph.add_edge_property('float')

should be:
distances = graph.add_vertex_property('float')

Thanks again,
John.
Pete Forman | 1 May 2007 11:26

Re: Regex failure when matching with a POSIX extended regexp

Roger Leigh <rleigh <at> whinlatter.ukfsn.org> writes:

 > I expect both regular expressions here to match with the value
 > string.

The result of regex_match is true only if the expression matches the
whole of the input sequence.  If you want to search for an expression
somewhere within the sequence then use regex_search.  If you want to
match a prefix of the character string then use regex_search with the
flag match_continuous set.
--

-- 
Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
pete.forman <at> westerngeco.com    -./\.-   the opinion of Schlumberger or
http://petef.port5.com           -./\.-   WesternGeco.

Gmane