Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Fuzzy Union in C++

Reply
Thread Tools

Fuzzy Union in C++

 
 
Evyn
Guest
Posts: n/a
 
      01-18-2007
Hi,

What is the best way to implement a union for fuzzy sets in C++? I have
used the following code for crisp sets, but the trick to converting it
for fuzzy sets eludes me.

std::set_union(vec1.begin(), vec1.end(), vec2.begin(), vec2.end(),
std::back_inserter<std::vector<double> >(vec3));
sort (vec3.begin (), vec3.end (), less <double> ());

TIA
Evyn

 
Reply With Quote
 
 
 
 
Ondra Holub
Guest
Posts: n/a
 
      01-18-2007

Evyn napsal:
> Hi,
>
> What is the best way to implement a union for fuzzy sets in C++? I have
> used the following code for crisp sets, but the trick to converting it
> for fuzzy sets eludes me.
>
> std::set_union(vec1.begin(), vec1.end(), vec2.begin(), vec2.end(),
> std::back_inserter<std::vector<double> >(vec3));
> sort (vec3.begin (), vec3.end (), less <double> ());
>
> TIA
> Evyn


Although I do not know what does mean crisp set, you can simplify your
code a little bit:

std::set_union(
vec1.begin(), vec1.end(),
vec2.begin(), vec2.end(),
back_inserter(vec3)
);
std::sort (vec3.begin (), vec3.end (), std::less<double>());

 
Reply With Quote
 
 
 
 
Evyn
Guest
Posts: n/a
 
      01-18-2007
Thanks for the heads-up...

Ondra Holub wrote:
> Evyn napsal:
> > Hi,
> >
> > What is the best way to implement a union for fuzzy sets in C++? I have
> > used the following code for crisp sets, but the trick to converting it
> > for fuzzy sets eludes me.
> >
> > std::set_union(vec1.begin(), vec1.end(), vec2.begin(), vec2.end(),
> > std::back_inserter<std::vector<double> >(vec3));
> > sort (vec3.begin (), vec3.end (), less <double> ());
> >
> > TIA
> > Evyn

>
> Although I do not know what does mean crisp set, you can simplify your
> code a little bit:
>
> std::set_union(
> vec1.begin(), vec1.end(),
> vec2.begin(), vec2.end(),
> back_inserter(vec3)
> );
> std::sort (vec3.begin (), vec3.end (), std::less<double>());


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fuzzy Logic Library VisionSet Java 3 12-12-2005 10:32 PM
algorithm for generating top fuzzy variations ... Giovanni Azua Java 3 08-09-2005 01:57 PM
union in struct without union name Peter Dunker C Programming 2 04-26-2004 07:23 PM
map XML union to C union (and vice-versa) Matt Garman XML 1 04-25-2004 12:40 AM
The Fuzzy Bunny has Got the carrot JasonC Computer Support 7 02-16-2004 01:11 AM



Advertisments