1 /* 2 This file is part of GNU APL, a free implementation of the 3 ISO/IEC Standard 13751, "Programming Language APL, Extended" 4 5 Copyright (C) 2008-2016 Dr. Jürgen Sauermann 6 7 This program is free software: you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation, either version 3 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef __Quad_DLX_HH_DEFINED__ 22 #define __Quad_DLX_HH_DEFINED__ 23 24 #include "QuadFunction.hh" 25 #include "Value.hh" 26 27 //----------------------------------------------------------------------------- 28 /** 29 The system function ⎕DLX aka. Dancing Links or Algorithm X by D. Knuth 2000 30 */ 31 /// The class implementing ⎕DLX 32 class Quad_DLX : public QuadFunction 33 { 34 public: 35 /// Constructor. Quad_DLX()36 Quad_DLX() : QuadFunction(TOK_Quad_DLX) {} 37 38 static Quad_DLX * fun; ///< Built-in function. 39 static Quad_DLX _fun; ///< Built-in function. 40 41 protected: 42 /// overloaded Function::eval_AB(). 43 virtual Token eval_AB(Value_P A, Value_P B); 44 45 /// overloaded Function::eval_B(). 46 virtual Token eval_B(Value_P B); 47 48 /// common part of eval_AB() and eval_B() 49 Token do_DLX(ShapeItem result_count, const Value & B); 50 }; 51 //----------------------------------------------------------------------------- 52 53 #endif // __Quad_DLX_HH_DEFINED__ 54 55 56