Fuzzy Union in C++

Discussion in 'C++' started by Evyn, Jan 18, 2007.

  1. Evyn

    Evyn Guest

    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
    Evyn, Jan 18, 2007
    #1
    1. Advertising

  2. Evyn

    Ondra Holub Guest

    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>());
    Ondra Holub, Jan 18, 2007
    #2
    1. Advertising

  3. Evyn

    Evyn Guest

    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>());
    Evyn, Jan 18, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Giovanni Azua
    Replies:
    3
    Views:
    612
    Ingo R. Homann
    Aug 9, 2005
  2. VisionSet

    Fuzzy Logic Library

    VisionSet, Dec 12, 2005, in forum: Java
    Replies:
    3
    Views:
    1,045
    Roedy Green
    Dec 12, 2005
  3. Matt Garman
    Replies:
    1
    Views:
    652
    Matt Garman
    Apr 25, 2004
  4. Ray Gardener

    Fuzzy logic question

    Ray Gardener, Dec 28, 2003, in forum: C++
    Replies:
    1
    Views:
    425
    Jeff Schwab
    Dec 28, 2003
  5. Peter Dunker

    union in struct without union name

    Peter Dunker, Apr 26, 2004, in forum: C Programming
    Replies:
    2
    Views:
    854
    Chris Torek
    Apr 26, 2004
Loading...

Share This Page