473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Fuzzy Union in C++

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

Jan 18 '07 #1
2 2350

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>());

Jan 18 '07 #2
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>());
Jan 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ray Gardener | last post by:
I was wondering if anyone had tried implementing fuzzy logic set concepts in C++, because in FL, the concept of "type" or "class" is fuzzy; things belong (or are of) a given type only by degree....
5
by: Simon Elliott | last post by:
I'd like to do something along these lines: struct foo { int i1_; int i2_; }; struct bar {
1
by: Evaluating Fuzzy SW | last post by:
Hi All We are using soundex (and later tried Nysiis) for fuzzy name search software. But we faced a lot of problems the search accuracy was not very good also we saw a lot of misses of...
6
by: Neil Zanella | last post by:
Hello, I would like to know what the C standards (and in particular the C99 standard) have to say about union initializers with regards to the following code snippet (which compiles fine under...
73
by: Sean Dolan | last post by:
typedef struct ntt { int type; union { int i; char* s; }; }nt; nt n; n.i = 0;
24
by: cassetti | last post by:
Here's the issue: I have roughly 20 MS excel spreadsheets, each row contains a record. These records were hand entered by people in call centers. The problem is, there can and are duplicate...
14
by: Steve Bergman | last post by:
I'm looking for a module to do fuzzy comparison of strings. I have 2 item master files which are supposed to be identical, but they have thousands of records where the item numbers don't match in...
30
by: Yevgen Muntyan | last post by:
Hey, Why is it legal to do union U {unsigned char u; int a;}; union U u; u.a = 1; u.u; I tried to find it in the standard, but I only found that
5
by: wugon.net | last post by:
question: db2 LUW V8 UNION ALL with table function month() have bad query performance Env: db2 LUW V8 + FP14 Problem : We have history data from 2005/01/01 ~ 2007/05/xx in single big...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.