Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 09:00:48

0001 # /* Copyright (C) 2001
0002 #  * Housemarque Oy
0003 #  * http://www.housemarque.com
0004 #  *
0005 #  * Distributed under the Boost Software License, Version 1.0. (See
0006 #  * accompanying file LICENSE_1_0.txt or copy at
0007 #  * http://www.boost.org/LICENSE_1_0.txt)
0008 #  */
0009 0010 ">#
0011 # /* Revised by Paul Mensonides (2002) */
0012 # /* Revised by Edward Diener (2020) */
0013 0014 ">#
0015 # /* See http://www.boost.org for most recent version. */
0016 0017 ">#
0018 # ifndef BOOST_PREPROCESSOR_ARITHMETIC_MUL_HPP
0019 # define BOOST_PREPROCESSOR_ARITHMETIC_MUL_HPP
0020 0021 ">#
0022 # include <boost/preprocessor/config/config.hpp>
0023 0024 ">#
0025 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
0026 0027 ">#
0028 # include <boost/preprocessor/arithmetic/add.hpp>
0029 # include <boost/preprocessor/arithmetic/dec.hpp>
0030 # include <boost/preprocessor/control/while.hpp>
0031 # include <boost/preprocessor/tuple/elem.hpp>
0032 # include <boost/preprocessor/tuple/rem.hpp>
0033 0034 ">#
0035 # /* BOOST_PP_MUL */
0036 0037 ">#
0038 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0039 #    define BOOST_PP_MUL(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
0040 # else
0041 #    define BOOST_PP_MUL(x, y) BOOST_PP_MUL_I(x, y)
0042 #    define BOOST_PP_MUL_I(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
0043 # endif
0044 0045 ">#
0046 # define BOOST_PP_MUL_P(d, rxy) BOOST_PP_TUPLE_ELEM(3, 2, rxy)
0047 0048 ">#
0049 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
0050 #    define BOOST_PP_MUL_O(d, rxy) BOOST_PP_MUL_O_IM(d, BOOST_PP_TUPLE_REM_3 rxy)
0051 #    define BOOST_PP_MUL_O_IM(d, im) BOOST_PP_MUL_O_I(d, im)
0052 # else
0053 #    define BOOST_PP_MUL_O(d, rxy) BOOST_PP_MUL_O_I(d, BOOST_PP_TUPLE_ELEM(3, 0, rxy), BOOST_PP_TUPLE_ELEM(3, 1, rxy), BOOST_PP_TUPLE_ELEM(3, 2, rxy))
0054 # endif
0055 0056 ">#
0057 # define BOOST_PP_MUL_O_I(d, r, x, y) (BOOST_PP_ADD_D(d, r, x), x, BOOST_PP_DEC(y))
0058 0059 ">#
0060 # /* BOOST_PP_MUL_D */
0061 0062 ">#
0063 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0064 #    define BOOST_PP_MUL_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
0065 # else
0066 #    define BOOST_PP_MUL_D(d, x, y) BOOST_PP_MUL_D_I(d, x, y)
0067 #    define BOOST_PP_MUL_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
0068 # endif
0069 0070 ">#
0071 # else
0072 0073 ">#
0074 # include <boost/preprocessor/arithmetic/add.hpp>
0075 # include <boost/preprocessor/arithmetic/dec.hpp>
0076 # include <boost/preprocessor/control/iif.hpp>
0077 # include <boost/preprocessor/control/while.hpp>
0078 # include <boost/preprocessor/facilities/identity.hpp>
0079 # include <boost/preprocessor/logical/bitand.hpp>
0080 # include <boost/preprocessor/logical/bool.hpp>
0081 # include <boost/preprocessor/logical/compl.hpp>
0082 # include <boost/preprocessor/tuple/elem.hpp>
0083 # include <boost/preprocessor/tuple/rem.hpp>
0084 # include <boost/preprocessor/arithmetic/detail/is_minimum_number.hpp>
0085 # include <boost/preprocessor/arithmetic/detail/is_maximum_number.hpp>
0086 # include <boost/preprocessor/arithmetic/detail/is_1_number.hpp>
0087 0088 ">#
0089 # /* BOOST_PP_MUL */
0090 0091 ">#
0092 #    define BOOST_PP_MUL(x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(x),BOOST_PP_IDENTITY_N(x,2),BOOST_PP_MUL_CHECK_1X)(x,y)
0093 0094 ">#
0095 #    define BOOST_PP_MUL_CHECK_1X(x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(x),BOOST_PP_IDENTITY_N(y,2),BOOST_PP_MUL_DO)(x,y)
0096 0097 ">#
0098 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0099 #    define BOOST_PP_MUL_DO(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
0100 # else
0101 #    define BOOST_PP_MUL_DO(x, y) BOOST_PP_MUL_I(x, y)
0102 #    define BOOST_PP_MUL_I(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
0103 # endif
0104 0105 ">#
0106 # define BOOST_PP_MUL_P(d, rxy) BOOST_PP_BITAND(BOOST_PP_BOOL(BOOST_PP_TUPLE_ELEM(3, 2, rxy)),BOOST_PP_COMPL(BOOST_PP_DETAIL_IS_MAXIMUM_NUMBER(BOOST_PP_TUPLE_ELEM(3, 0, rxy))))
0107 0108 ">#
0109 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
0110 #    define BOOST_PP_MUL_O(d, rxy) BOOST_PP_MUL_O_IM(d, BOOST_PP_TUPLE_REM_3 rxy)
0111 #    define BOOST_PP_MUL_O_IM(d, im) BOOST_PP_MUL_O_I(d, im)
0112 # else
0113 #    define BOOST_PP_MUL_O(d, rxy) BOOST_PP_MUL_O_I(d, BOOST_PP_TUPLE_ELEM(3, 0, rxy), BOOST_PP_TUPLE_ELEM(3, 1, rxy), BOOST_PP_TUPLE_ELEM(3, 2, rxy))
0114 # endif
0115 0116 ">#
0117 # define BOOST_PP_MUL_O_I(d, r, x, y) (BOOST_PP_ADD_D(d, r, x), x, BOOST_PP_DEC(y))
0118 0119 ">#
0120 # /* BOOST_PP_MUL_D */
0121 0122 ">#
0123 #    define BOOST_PP_MUL_D(d, x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(x),BOOST_PP_IDENTITY_N(x,3),BOOST_PP_MUL_CHECK_1X_D)(d,x,y)
0124 0125 ">#
0126 #    define BOOST_PP_MUL_CHECK_1X_D(d, x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(x),BOOST_PP_IDENTITY_N(y,3),BOOST_PP_MUL_DO_D)(d,x,y)
0127 0128 ">#
0129 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0130 #    define BOOST_PP_MUL_DO_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
0131 # else
0132 #    define BOOST_PP_MUL_DO_D(d, x, y) BOOST_PP_MUL_D_I(d, x, y)
0133 #    define BOOST_PP_MUL_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
0134 # endif
0135 0136 ">#
0137 # endif
0138 0139 ">#
0140 # endif