Barco You | 1 Apr 2009 02:10
Picon
Gravatar

Re: How to generate a Bernuolli number

Yes, my function just want to return 0 or 1, so I have the return type as
int, is there any problem for that?

On Tue, Mar 31, 2009 at 4:58 PM, Yaser Zhian <yaserzt <at> yahoo.com> wrote:

> Barco You wrote:
> > This really works. but If I write this in a function:
> > int genB() {
> > ...
> > }
> >
>
> Is your function really supposed to return an "int"?
>
> -yzt
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>

--

-- 
-------------------------------
Enjoy life!
Barco You
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Chris Wagner | 1 Apr 2009 01:50
Picon

[gsoc] Proposal for Generic Trie, Radix Tree, and Suffix Array Data Structures

Hello,

I am interested in writing a library consisting of generic implementations of
several common data structures and algorithms primarily useful in
text-processing. I believe these would be useful additions to Boost and would
like to work on them for GSoC. Before I submit my proposal, I would like to
hear whether or not the community agrees that this is a good idea, and I would
appreciate any suggestions or comments offered.

My plan is to implement a trie / prefix tree data structure, STL set/map-like
classes implemented over the trie, a radix tree, a suffix tree implemented
over the radix tree, and a suffix array. These would be instantiable over
arbitrary sequence types, and use iterator traits to determine the contained
type.

I am a student at Kent State University, working on an M.S. in Computer
Science in a combined undergraduate/graduate program. I have a particular
interest in computational linguistics, and I will admit that am especially
interested in this project because of how it could be applied to my own
field, but I believe that these types would be of general utility to the
programming community as a whole.

Thank you for your time,
Chris Wagner
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Barco You | 1 Apr 2009 02:47
Picon
Gravatar

Re: How to generate a Bernuolli number

Hi Henning,

Thanks for your reply!
but,
g = generator(rng, boost::bernoulli_distribution<>(p));
can not be compiled successfully, how to do? thanks!

On Tue, Mar 31, 2009 at 6:58 PM, Henning Basold <h.basold <at> googlemail.com>wrote:

> Hi,
> sorry about my first post. I didn't realize your question.
>
> About your problem: just reuse the number generator and construct a new
> instance of bernoulli_distribution with the new probability:
>
> int main() {
>  double p = 0.5;
>  boost::mt19937 rng;
>  boost::bernoulli_distribution<> d(p);
>
>  typedef boost::variate_generator<
>     boost::mt19937&,
>     boost::bernoulli_distribution<>
>  > generator;
>
>  generator g(rng, d);
>   int time_steps = 2;
>
>  for(int i = 0; i < 10; ++i) {
>     // change probability every second step
(Continue reading)

Steven Watanabe | 1 Apr 2009 03:09
Picon

Re: How to generate a Bernuolli number

AMDG

Barco You wrote:
> Hi Henning,
>
> Thanks for your reply!
> but,
> g = generator(rng, boost::bernoulli_distribution<>(p));
>   

Try
  g.distribution() = boost::bernoulli_distribution<>(p);
or just construct the variate generator whenever you need
a random number:
  std::cout << generator(rng, boost::bernoulli_distribution<>(p))() << 
std::endl;

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Kornel Kisielewicz | 1 Apr 2009 03:17
Picon
Gravatar

[gsoc] Proposal - Boost.Matrix - DRAFT RFC

Hello all,

Following the discussion in the threads:
"[boost][gsoc] Interest check for 3d geometry proposal"
"[boost] [gsoc] fixed size matrix class?"

I post a draft of my proposal with a request for comments. Following
the suggestions I decided to scale down the proposal to a polished and
production-quality fixed-size Boost.Matrix library, with a big
emphasis on correctness and performance.

The application follows:

Abstract
=========

uBLAS is Boost's general linear algebra library, and it is a fine
library indeed. However, in some cases it's design decisions, while
quite rational for the general use case, are restrictive. This
proposal is about a new library that would address some of these
issues in the specific situation of vector and matrix operations on
fixed sized structures.

Suggested is a new library boost::matrix. The library would introduce
a single container class that allows representation of fixed size
vectors and matrices, and their respective standard operations. The
library would define the following template

template<typename T, std::size_t N, std::size_t M, class Traits> matrix

(Continue reading)

Barco You | 1 Apr 2009 03:18
Picon
Gravatar

Re: How to generate a Bernuolli number

Hi Steven,

This way:  g.distribution() = boost::bernoulli_distribution<>(p);  works
successfully!!!

Many thanks!

On Wed, Apr 1, 2009 at 9:09 AM, Steven Watanabe <watanabesj <at> gmail.com>wrote:

> AMDG
>
> Barco You wrote:
>
>> Hi Henning,
>>
>> Thanks for your reply!
>> but,
>> g = generator(rng, boost::bernoulli_distribution<>(p));
>>
>>
>
> Try
>  g.distribution() = boost::bernoulli_distribution<>(p);
> or just construct the variate generator whenever you need
> a random number:
>  std::cout << generator(rng, boost::bernoulli_distribution<>(p))() <<
> std::endl;
>
> In Christ,
> Steven Watanabe
(Continue reading)

Eugene Wee | 1 Apr 2009 04:10
Picon
Gravatar

Re: [safebool] Can we generalize it and put it into utilities?

Hi,

On Wed, Apr 1, 2009 at 6:20 AM, Vladimir Batov
<vladimir.batov <at> wrsa.com.au>wrote:

> I glanced over "explicit conversion operators" in C++0x. It did not struck
> me as
> relevant to safe_bool. Care to elaborate?

It is relevant since you can say, define an explicit conversion function to
convert to bool, and yet avoid the very problems with say, also allowing
implicit conversion to int, that the safe bool idiom is used to avoid. In
other words, it is a language feature directly designed to replace the safe
bool idiom, and more.

Regards,
Eugene Wee
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Emil Dotchevski | 1 Apr 2009 04:29
Picon

Re: [gsoc] Proposal - Boost.Matrix - DRAFT RFC

On Tue, Mar 31, 2009 at 6:17 PM, Kornel Kisielewicz
<kornel.kisielewicz <at> gmail.com> wrote:
> template<typename T, std::size_t N, std::size_t M, class Traits> matrix

I'd suggest using Rows and Cols as arguments of the template instead of M and N.

> In cases that make heavy use of fixed sized matrices and vectors (
> like real-time computer graphics ), such a tradeoff is unacceptable --
> due to increased memory consumption as well as effective vectorized
> math operations, and alignment of structures passed ( a single 4D
> vector should effectively fit a 128 bit register, and a single 128 bit
> move operation ).

IMO the abstraction provided by a template <typename T,size_t
Rows,size_t Cols> class matrix is unnecessary and will only get in the
way for computer graphics applications. I've seen several attempts
like this at generalizing matrices for game engine use getting
scrapped and refactored to a more traditional set of types (not
templates) and functions (this doesn't mean that such generalizations
are not appropriate in general.)

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

troy d. straszheim | 1 Apr 2009 04:53
Favicon

[gsoc] PLEASE SUBMIT PROPOSALS NOW

Hi Students,

This just in from the director of the GSOC, in an email with lots of 
asterisks and capital letters in the subject:

> I realize that many organizations are working with students to refine
> their proposal ideas on their mailing lists, wikis, etc. However, a
> proposal on a wiki, mailing list, etc. does not constitute an actual
> application for the program; the proposal must be submitted to the
> GSoC 2009 site. While doing review and refinement outside of
> http://socghop.appspot.com is a useful exercise, it doesn't allow us
> to accurately gauge the number of student proposals we're receiving
> for GSoC 2009.
> 
> Please help us get an accurate sense of how many proposals will be
> submitted for GSoC 2009 by asking your students to submit their
> proposals to the GSoC 2009 site *now*. They are welcome to link to the
> wiki page, mailing list thread, forum topic, etc. where their
> proposals are under discussion and refinement as part of the proposal
> submission process.[0]

And the [0] refers to:

http://socghop.appspot.com/document/show/program/google/gsoc2009/userguide#depth_studentapply

Many of you have done a *great* job raising proposals, discussing and 
refining them.  Please get some placeholder applications up asap, even 
if they aren't completely finished.

I'm looking forward to seeing yet more good discussion and refinement of 
(Continue reading)

Vladimir Batov | 1 Apr 2009 05:06
Picon
Favicon

Re: [safebool] Can we generalize it and put it into utilities?

> Eugene Wee <crystalrecursion <at> gmail.com> writes:
> > I glanced over "explicit conversion operators" in C++0x. It did not struck
> > me as relevant to safe_bool. Care to elaborate?
> 
> It is relevant since you can say, define an explicit conversion function to
> convert to bool, and yet avoid the very problems with say, also allowing
> implicit conversion to int, that the safe bool idiom is used to avoid. In
> other words, it is a language feature directly designed to replace the safe
> bool idiom, and more.

Ah, my bad, I was damn looking at something completely else. :-( Now I found the
relevant section (12.3.2. Conversion functions) and see that adding 'explicit'
seem to fix all the problems we are now trying to solve with safe_bool. Thanks
for setting me straight. Problem solved then... well, it is being taken care of,
anyway. Sorry for all the noise.

Thanks,
V.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Gmane