Exemplo n.º 1
0
void set_difference (C1& B, const C2& A)
{
  typename C1::iterator newlast = B.end();
  for (typename C2::const_iterator it=A.begin(); it != A.end(); it++)
    newlast = std::remove (B.begin(), newlast, *it);
  B.erase (newlast, B.end());
}
Exemplo n.º 2
0
void sub1(){
  C1 c;
  try{
    c.memb();
  } catch(C1::Warn a){
    a.print();
    throw;
  }
}
void test_friend_3_function()
{
	C1 x;
	C2 y;
	x.set_status(IDLE);
	y.set_status(IDLE);
	if (x.idle(y)) cout << "Screen can be used.\n";
	else cout << "In use.\n";
	x.set_status(INUSE);
	if (x.idle(y)) cout << "Screen can be used.\n";
	else cout << "In use.\n";
}
Exemplo n.º 4
0
std::vector<std::pair<typename C1::value_type, typename C2::value_type> > zip(C1 const &container1,
                                                                              C2 const &container2)
{
    std::vector<std::pair<typename C1::value_type, typename C2::value_type> > result;

    auto it1 = container1.begin();
    auto it2 = container2.begin();
    for (; it1 != container1.end() && it2 != container2.end(); ++it1, ++it2) {
        result.push_back(std::make_pair(*it1, *it2));
    }

    return result;
}
Exemplo n.º 5
0
main()
{
  C1 *one = new C1;
  
  if (one->type() == 1)
    {
      printf ("PASS\n");
      return 0;
    }
  else
    {
      printf ("FAIL\n");
      return 1;
    }
}
Exemplo n.º 6
0
int main()
{
clrscr();
C1 x;
C2 y;
x.set_status(IDLE);
y.set_status(IDLE);
if(idle(x, y)) cout << "Screen can be used.\n";
else cout << "In use.\n";
x.set_status(INUSE);
if(idle(x, y)) cout << "Screen can be used.\n";
else cout << "In use.\n";
getch();
return 0;
}
Exemplo n.º 7
0
static void fillStats(C1<Stat> &stats, const Interval &iv, const C2<Value> &vals)
{
    int i = 0, n = stats.size(), dt = iv.secs();
    typename C1<Stat>::iterator st = stats.begin();
    typename C2<Value>::const_iterator v1 = vals.begin(), v2 = vals.begin(); ++v2;
    while(v2 != vals.end() && st != stats.end())
    {
        Interval vi(v1->tm, v2->tm);//, ci(iv.t1 + i*dt/n, iv.t1 + (i + 1)*dt/n);
        uint t = iv.t1 + int((i + 0.5f)*dt/n);
        if(v2->value != v2->value) vi.t2 = vi.t1 + 1;
        if(vi.contains(t) && v1->value == v1->value)
        {
        	//typename C1<Stat>::iterator pst = st;
        	//if(pst != stats.begin()) (--pst)->add(v1->value);
        	st->add(v1->value);
        }
        if(t < vi.t2) ++st, ++i; else ++v1, ++v2;
    }
}
Exemplo n.º 8
0
bool CheckEqualIt( const T1 &i1, const T2 &i2, const C1 &c1, const C2 &c2 )
{
   bool c1end = i1 == c1.end();
   bool c2end = i2 == c2.end();
   if( c1end != c2end ){
      return false;
   }
   else if(c1end){
      return true;
   }
   else{
      return CheckEqual(*i1, *i2);
   }
}
Exemplo n.º 9
0
   bool step()
    {
     random.fill(Range(key));
     random.fill(Range(src));
     
     cipher1.key(key.getPtr());
     cipher2.key(key.getPtr());

     ApplyBlockCipher(cipher1,src.getPtr(),dst1.getPtr(),blocks);
     ApplyBlockCipher(cipher2,src.getPtr(),dst2.getPtr(),blocks);
     
#if 0
     
     Printf(Con,"\n#;\n\n#;\n",PrintDump(Range(dst1)),PrintDump(Range(dst2)));
     
#endif     
     
     return Range(dst1).equal(Range(dst2));
    }
Exemplo n.º 10
0
Arquivo: t135.C Projeto: 0day-ci/gcc
void foobar ()
{
  C1_int_object.diddle_C2 ();
}
Exemplo n.º 11
0
template <class C1, class C2> auto insert_back(C1& c1, const C2& c2)
{
    return c1.insert(std::end(c1), std::begin(c2), std::end(c2));
}
Exemplo n.º 12
0
 static void foo(int &flag)  
 {
     C1 c;
 
     c.foo(flag);
 }
Exemplo n.º 13
0
Arquivo: copy.hpp Projeto: psiha/nt2
 inline void copy(C1 const& a, cuda_buffer<T> &b, cudaStream_t stream = 0)
 {
   b.resize(a.size());
   copy(a,b,nt2::host_{},nt2::device_{},stream);
 }
Exemplo n.º 14
0
 static void
 C1__take_C1r( C1 & obj, C1 & p )
 {
     obj.take_C1r(p);
 }
Exemplo n.º 15
0
 static void
 C1__take_C1p( C1 & obj, C1 * p )
 {
     obj.take_C1p(p);
 }
Exemplo n.º 16
0
 static void
 C1__take_C1Cr( const C1 & obj, const C1 & cp )
 {
     obj.take_C1Cr(cp);
 }
Exemplo n.º 17
0
 static void
 C1__take_C1Cp( const C1 & obj, const C1 * cp )
 {
     obj.take_C1Cp(cp);
 }
Exemplo n.º 18
0
double C1_Smooth::
up (const double & rr) const
{
  return (1. - sw.u(rr)) * c1.up(rr) + ( - sw.up(rr)) * c1.u(rr);
}
Exemplo n.º 19
0
	double impl(C1 const& estimates, C2 const& answers, bool is_sorted, F&& compare_func) const
	{
		return static_cast<double>(set_intersection_num(estimates, answers, is_sorted, std::forward<F>(compare_func))) / estimates.size();
	}