head	1.10;
access
	thoth
	monica;
symbols
	r0_9:1.1
	Eglin_alpha_1:1.1;
locks; strict;
comment	@// @;


1.10
date	94.12.21.20.40.42;	author monica;	state Exp;
branches;
next	1.9;

1.9
date	94.11.21.14.16.30;	author monica;	state Exp;
branches;
next	1.8;

1.8
date	94.11.17.21.41.19;	author monica;	state Exp;
branches;
next	1.7;

1.7
date	94.11.17.21.20.41;	author monica;	state Exp;
branches;
next	1.6;

1.6
date	94.11.01.22.42.05;	author monica;	state Exp;
branches;
next	1.5;

1.5
date	94.10.18.22.38.46;	author monica;	state Exp;
branches;
next	1.4;

1.4
date	94.09.22.16.46.09;	author monica;	state Exp;
branches;
next	1.3;

1.3
date	94.09.01.17.40.23;	author monica;	state Exp;
branches;
next	1.2;

1.2
date	94.08.17.22.29.51;	author monica;	state Exp;
branches;
next	1.1;

1.1
date	93.02.23.12.07.36;	author reti;	state Exp;
branches;
next	;


desc
@@


1.10
log
@*** empty log message ***
@
text
@#include <iostream.h>
#include "Set.h"
#include "Bit.h"
#include "RGB.h"
#include "SetIter.h"

//  global valueset vars

int fill_array[]= {-3,-2,-1,0,1,2,3,4};

IA_Set<int>
               viu,
//             vi0(), //understood as function
               vi1(1),vi2(2),vi3(3),si4(4),si5(5),si6(6),vi7(7),
               vi12(1,2),vi13(1,3),vi23(2,3),
	       vi123(1,2,3),
	       vi4(-1,0,1,2),
	       vi5(-2,-1,0,1,2),
	       vi6(fill_array,7),
	       vi66(vi6),
	       vitempa, vitempb;

float fil[]= {-3.1,-2.2,-1.0,0.1,1.0,2.0,3.0,4.0};

IA_Set<float>
               vfu,
//             vf0(), //understood as function
               vf1(1.0),vf2(2.0),vf3(3.0),vf4(4),sf4(4),sf5(5),sf6(6),
	       vf5(5),vf6(6),vf7(7),
               vf12(1.0,2.0),vf13(1.0,3.0),vf23(2.0,3.0),
	       vf123(1.0,2.0,3.0),
	       vf8(-1.0,0.0,1.0,2.0),
	       vf9(-2.0,-1.0,0.0,1.0,2.0),
	       vf10(fil,3),
	       vf11(vf10),
	       vftempfa, vftempfb;


IA_Set<IA_Bit> vbu, vb0((IA_Bit)0), vb1(1), vb01((IA_Bit)0,1);

IA_Bit fill_arrayb[]={0,1};

float return_float ( )
{
    return 666.666;
}   

void set ( IA_Set<int> a)
{
    if (a.empty()) cout << " empty set ";
    IA_SetIter<int> it(a); int i;
    cout << "{ ";
    while (it(i)) cout <<i<<",";
    cout << " } ";
}    

void infof ( char *str, IA_Set<float> a)
{
    cout << "\n\n" << str << "\n";
    if (a.empty()) cout << " empty set \n";
    cout << "cardinality of set is " << a.card() << "\n";
    cout << "minimum value: " << a.min() << "\n";
    cout << "maximum value: " << a.max() << "\n";
    cout << "selected value test: " << (a.contains(a.choice()) != 0 ? "pass":"fail") << "\n";
    if (a.contains(1.1)) cout << "set contains 1.1\n";
    if (a.contains(2.2)) cout << "set contains 2.2\n";
    if (a.contains(666.666)) cout << "set contains 666.666\n";
}

void info ( char *str, IA_Set<int> a)
{
    cout << "\n\n" << str << "\n";
    if (a.empty()) cout << " empty set \n";
    cout << "cardinality of set is " << a.card() << "\n";
    cout << "minimum value: " << a.min() << "\n";
    cout << "maximum value: " << a.max() << "\n";
    cout << "selected value test: " << (a.contains(a.choice()) != 0 ? "pass":"fail") << "\n";
    if (a.contains(1)) cout << "set contains 1\n";
    if (a.contains(2)) cout << "set contains 2\n";
    if (a.contains(666)) cout << "set contains 666\n";
}

void infob ( char *str, IA_Set<IA_Bit> a)
{
    cout << "\n\n" << str << "\n";
    if (a.empty()) cout << " empty set \n";
    cout << "cardinality of set is " << a.card() << "\n";
    cout << "minimum value: " << a.min() << "\n";
    cout << "maximum value: " << a.max() << "\n";
    cout << "selected value test: " << (a.contains(a.choice()) != 0 ? "pass":"fail") << "\n";
    if (a.contains(1)) cout << "set contains 1\n";
    if (a.contains(0)) cout << "set contains 0\n";
}

void setf ( IA_Set<float> a)
{
//    cout << "cardinality of set is " << a.card() << "\n";
    if (a.empty()) cout << " empty set ";

    IA_Set<float> temp_s = a;
    cout << "{ ";
    float v;
    while (!(temp_s.empty())) {
	v = temp_s.min();
	temp_s = temp_s / v;
	cout << v << ",";
    };
    cout << " } ";
}    

/* void setf ( IA_Set<float> a)
{
    if (a.empty()) cout << " empty set ";
    IA_SetIter<float> it(a); float i;
    cout << "{ ";
    while (it(i)) cout <<i<<",";
    cout << " } ";
}    */
	
void com (IA_Set<int> a,IA_Set<int> b)
{
		   switch (compare(a,b))
		   {
		    case 0: cout<< "P_SUBSET"; break;
	            case 1: cout<< "MP_SUBSET";break;
		    case 2: cout<< "EQUAL"; break;
		    case 3: cout<< "MP_SUPERSET";break;
		    case 4: cout<< "P_SUPERSET";break;
		    case 5: cout<< "NO_REL";break;
		    case 6: cout<< "UNKNOWN";break;
		    default: break;	
		   };
}

void comf (IA_Set<float> a,IA_Set<float> b)
{
		   switch (compare(a,b))
		   {
		    case 0: cout<< "P_SUBSET"; break;
	            case 1: cout<< "MP_SUBSET";break;
		    case 2: cout<< "EQUAL"; break;
		    case 3: cout<< "MP_SUPERSET";break;
		    case 4: cout<< "P_SUPERSET";break;
		    case 5: cout<< "NO_REL";break;
		    case 6: cout<< "UNKNOWN";break;
		    default: break;	
		   };
}

#define p11(a,op,op2,b)\
                   cout<< "\n\t";\
		   vitempa = IA_Set<int>(a);\
		   set(vitempa);\
                   cout<< "\n\t"<< op << "\n\t";\
		   vitempb = IA_Set<int>(b);\
		   set(vitempb);\
		   cout<< "\n\t result: ";\
		   set(a op2 b);\
		   cout<< "\n";
		   
#define p11f(a,op,op2,b)\
                   cout<< "\n\t";\
		   vftempfa = IA_Set<float>(a);\
		   setf(vftempfa);\
                   cout<< "\n\t"<< op << "\n\t";\
		   vftempfb = IA_Set<float>(b);\
		   setf(vftempfb);\
		   cout<< "\n\t result: ";\
		   setf(a op2 b);\
		   cout<< "\n";
		   
#define p12(a,b)\
                   cout<< "\n\t compare \n\t";\
		   set(a); cout<<"\n\t";\
                   set(b);\
		   cout<<"\n\t  result:" ;\
                   com(a,b);\
		   cout << "\n"\
		   
#define p12f(a,b)\
                   cout<< "\n\t compare \n\t";\
		   setf(a); cout<<"\n\t";\
                   setf(b);\
		   cout<<"\n\t  result:" ;\
                   comf(a,b);\
		   cout << "\n"\
		   
#define p13(a,op,op2,b)\
                   cout<< "\n\t";\
		   vitempa = IA_Set<int>(a);\
		   set(vitempa);\
                   cout<< "\n\t"<< op << "\n\t";\
		   vitempb = IA_Set<int>(b);\
		   set(vitempb);\
		   cout<< "\n";\
		   (a  op2 b)==0 ? cout <<"\tresult:False\n" \
		                    : cout <<"\tresult:True\n" 
#define p13f(a,op,op2,b)\
                   cout<< "\n\t";\
		   vftempfa = IA_Set<float>(a);\
		   setf(vftempfa);\
                   cout<< "\n\t"<< op << "\n\t";\
		   vftempfb = IA_Set<float>(b);\
		   setf(vftempfb);\
		   cout<< "\n";\
		   (a  op2 b)==0 ? cout <<"\tresult:False\n" \
		                    : cout <<"\tresult:True\n" 

#define p14(op,op2,a)\
                   cout<< "\n\t" << op <<"\t" ;               \
		   set(a);                                    \
                   cout <<"\n\t result:" << a.op2() << "\n"
                  
    
#define p5(a,op,op2)\
                   cout<< "\n\t" << a <<"\t" << op <<"\n";\
		   cout <<"\t result:" << (a op2 )<< "\n"

#define p7(a,b)\
                   cout<<"\n\t"<<a<<"\t concat \t"<<b<<"\n";\
		   cout<<"\t result:" << concat(a,b) <<"\n"
		   
#define p8(f,f2,b,c)\
                   cout<<"\n\t"<<f<<"("<< b<<","<<c<<")\n";\
		   cout<<"\t result:" << f2(b,c) <<"\n"

#define p9(f,f2,b)\
                   cout<<"\n\t"<<f<<"("<<b<<")\n";\
		   cout<<"\t result:" << f2(b) <<"\n"

inline void r3(char h)
{
  cout <<"\t result: ";
  switch (h)
      {
      case -1: cout << "< "; break;
      case  0: cout << "=="; break;
      case  1: cout << "> "; break;
      }
}



@


1.9
log
@*** empty log message ***
@
text
@d64 1
a64 2
    float vv = a.choice();
    cout << "selected value: " << vv << "\n";
d77 1
a77 2
    int vv = a.choice();
    cout << "selected value: " << vv << "\n";
d90 1
a90 2
    int vv = a.choice();
    cout << "selected value: " << vv << "\n";
@


1.8
log
@*** empty log message ***
@
text
@d193 2
a194 2
		   tempa = IA_Set<int>(a);\
		   set(tempa);\
d196 2
a197 2
		   tempb = IA_Set<int>(b);\
		   set(tempb);\
d203 2
a204 2
		   tempfa = IA_Set<float>(a);\
		   setf(tempfa);\
d206 2
a207 2
		   tempfb = IA_Set<float>(b);\
		   setf(tempfb);\
@


1.7
log
@mods to work around the mac's problem with temporary set args -
changed p11 & p11f mainly
@
text
@d21 1
a21 1
	       tempa, tempb;
d36 1
a36 1
	       tempfa, tempfb;
d155 2
a156 2
		   tempa = IA_Set<int>(a);\
		   set(tempa);\
d158 2
a159 2
		   tempb = IA_Set<int>(b);\
		   set(tempb);\
d166 2
a167 2
		   tempfa = IA_Set<float>(a);\
		   setf(tempfa);\
d169 2
a170 2
		   tempfb = IA_Set<float>(b);\
		   setf(tempfb);\
@


1.6
log
@updated infob routine
@
text
@d20 2
a21 1
	       vi66(vi6);
d28 2
a29 1
               vf1(1.0),vf2(2.0),vf3(3.0),vf4(4),vf5(5),vf6(6),vf7(7),
d35 2
a36 1
	       vf11(vf10);
d155 2
a156 1
		   set(a);\
d158 2
a159 1
		   set(b);\
d166 2
a167 1
		   setf(a);\
d169 2
a170 1
		   setf(b);\
d193 2
a194 1
		   set(a);\
d196 2
a197 1
		   set(b);\
d203 2
a204 1
		   setf(a);\
d206 2
a207 1
		   setf(b);\
@


1.5
log
@return to using iterators
@
text
@d92 1
a92 2
    if (a.contains(2)) cout << "set contains 2\n";
    if (a.contains(6)) cout << "set contains 6\n";
@


1.4
log
@changed fill to fill_array
@
text
@d5 1
a6 1

d48 1
a48 7
//  commented out until set iter is restored.
//    IA_SetIter<int> it(a); int i;
//    cout << "{ ";
//    while (it(i)) cout <<i<<",";
//    cout << " } ";

    IA_Set<int> temp_s = a;
d50 1
a50 6
    int v;
    while (!(temp_s.empty())) {
	v = temp_s.min();
	temp_s = temp_s / v;
	cout << v << ",";
    };
@


1.3
log
@changed include stream.h to iostream.h
@
text
@d9 1
a9 1
int fill[]= {-3,-2,-1,0,1,2,3,4};
d19 1
a19 1
	       vi6(fill,7),
d38 1
a38 1
IA_Bit fillb[]={0,1};
@


1.2
log
@various updates
@
text
@d1 1
a1 1
#include <stream.h>
@


1.1
log
@Initial revision
@
text
@d2 3
a4 1
#include "ValueSet.h"
a5 1
//  global valuset vars
d7 2
d11 1
a11 1
ValueSet<int>
d19 2
a20 1
	       vi6(fill,7);
d24 1
a24 1
ValueSet<float>
d32 60
a91 1
	       vf10(fil,3);
d93 13
d107 1
a107 1
void set ( ValueSet<int> a)
d109 1
d111 2
a112 1
    ValueSetIter<int> it(a); int i;
d114 6
a119 1
    while (it(i)) cout <<i<<",";
d123 1
a123 1
void setf ( ValueSet<float> a)
d126 1
a126 1
    ValueSetIter<float> it(a); float i;
d130 1
a130 1
}    
d132 16
a147 1
void com (ValueSet<int> a,ValueSet<int> b)
d171 9
d186 8
@
