/********************************************************************** This file is part of the Quantum Computation Language QCL. (c) Copyright by Bernhard Oemer , 1998 This program comes without any warranty; without even the implied warranty of merchantability or fitness for any particular purpose. This program is free software under the terms of the GNU General Public Licence (GPL) version 2 or higher ************************************************************************/ #pragma implementation #include "cond.h" #include "types.h" string QuCond::str() const { string ostr=""; bitvec v; iter i; int j; if(elem()==0) return "<>"; for(i=cond.begin();i!=cond.end();i++) { ostr+=" "; v=*i; if(zero(v)) { ostr+="*;"; } else { for(j=0;jbasebits()); m.setbit(q->mapindex(i)); return QuCond(m); } QuCond regcomp(const quState *q,const quState *p) { QuCond c=QCTRUE(q->basebits()); int i; int n=q->mapbits(); if(n!=p->mapbits()) return QCFALSE(q->basebits()); for(i=0;ibasebits()); int i; for(i=0;imapbits();i++) { if(n&1) c=c & regbit(q,i); else c=c & ~regbit(q,i); n>>=1; } if(n) return QCFALSE(q->basebits()); return c; }