Commit 45c56bb2 authored by Davis King's avatar Davis King

Cleaned up the code more and fully filled out the spec.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402685
parent 0b6dad89
...@@ -624,13 +624,13 @@ namespace dlib ...@@ -624,13 +624,13 @@ namespace dlib
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
template <int control_bit1, int control_bit2, int target_bit> template <int control_bit1, int control_bit2, int target_bit>
class taffoli : public gate_exp<taffoli<control_bit1, control_bit2, target_bit> > class toffoli : public gate_exp<toffoli<control_bit1, control_bit2, target_bit> >
{ {
public: public:
COMPILE_TIME_ASSERT(control_bit1 != target_bit && control_bit2 != target_bit && control_bit1 != control_bit2); COMPILE_TIME_ASSERT(control_bit1 != target_bit && control_bit2 != target_bit && control_bit1 != control_bit2);
COMPILE_TIME_ASSERT((control_bit1 < target_bit && control_bit2 < target_bit) ||(control_bit1 > target_bit && control_bit2 > target_bit) ); COMPILE_TIME_ASSERT((control_bit1 < target_bit && control_bit2 < target_bit) ||(control_bit1 > target_bit && control_bit2 > target_bit) );
taffoli() : gate_exp<taffoli>(*this) toffoli() : gate_exp<toffoli>(*this)
{ {
const int min_bit = std::min(std::min(control_bit1, control_bit2), target_bit); const int min_bit = std::min(std::min(control_bit1, control_bit2), target_bit);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment