add stringize preprocessor

add random using
add some headers
This commit is contained in:
bolero-MURAKAMI 2012-04-14 12:31:47 +09:00
parent 1766ed43a4
commit 89e2be54fa
24 changed files with 166 additions and 7 deletions

7
sprout/checksum.hpp Normal file
View file

@ -0,0 +1,7 @@
#ifndef SPROUT_CHECKSUM_HPP
#define SPROUT_CHECKSUM_HPP
#include <sprout/config.hpp>
#include <sprout/checksum/sha1.hpp>
#endif // #ifndef SPROUT_CHECKSUM_HPP

8
sprout/integer/bit.hpp Normal file
View file

@ -0,0 +1,8 @@
#ifndef SPROUT_INTEGER_BIT_HPP
#define SPROUT_INTEGER_BIT_HPP
#include <sprout/config.hpp>
#include <sprout/integer/bit_length.hpp>
#include <sprout/integer/bit_reverse.hpp>
#endif // #ifndef SPROUT_INTEGER_BIT_HPP

View file

@ -3,6 +3,6 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp> #include <sprout/iterator/operation.hpp>
#include <sprout/iterator/reverse_iterator.hpp> #include <sprout/iterator/predefined.hpp>
#endif // #ifndef SPROUT_ITERATOR_HPP #endif // #ifndef SPROUT_ITERATOR_HPP

View file

@ -0,0 +1,10 @@
#ifndef SPROUT_ITERATOR_PREDEFINED_HPP
#define SPROUT_ITERATOR_PREDEFINED_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/reverse_iterator.hpp>
#include <sprout/iterator/index_iterator.hpp>
#include <sprout/iterator/value_iterator.hpp>
#include <sprout/iterator/bytes_iterator.hpp>
#endif // #ifndef SPROUT_ITERATOR_PREDEFINED_HPP

10
sprout/preprocessor.hpp Normal file
View file

@ -0,0 +1,10 @@
#ifndef SPROUT_PREPROCESSOR_HPP
#define SPROUT_PREPROCESSOR_HPP
#include <sprout/config.hpp>
#include <sprout/preprocessor/cat.hpp>
#include <sprout/preprocessor/stringize_all.hpp>
#include <sprout/preprocessor/str_all.hpp>
#include <sprout/preprocessor/unique_string.hpp>
#endif // #ifndef SPROUT_PREPROCESSOR_HPP

View file

@ -0,0 +1,10 @@
#ifndef SPROUT_PREPROCESSOR_STR_ALL_HPP
#define SPROUT_PREPROCESSOR_STR_ALL_HPP
#include <sprout/config.hpp>
#include <sprout/preprocessor/wstr.hpp>
#include <sprout/preprocessor/u16str.hpp>
#include <sprout/preprocessor/u32str.hpp>
#endif // #ifndef SPROUT_PREPROCESSOR_STR_ALL_HPP

View file

@ -3,12 +3,11 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#define SPROUT_PP_STRINGIZE_I(text) #text
// //
// SPROUT_PP_STRINGIZE // SPROUT_PP_STRINGIZE
// //
#define SPROUT_PP_STRINGIZE(text) SPROUT_PP_STRINGIZE_I(text) #define SPROUT_PP_STRINGIZE(text) SPROUT_PP_STRINGIZE_I(text)
#define SPROUT_PP_STRINGIZE_I(text) #text
#endif // #ifndef SPROUT_PREPROCESSOR_STRINGIZE_HPP #endif // #ifndef SPROUT_PREPROCESSOR_STRINGIZE_HPP

View file

@ -0,0 +1,11 @@
#ifndef SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP
#define SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP
#include <sprout/config.hpp>
#include <sprout/preprocessor/stringize.hpp>
#include <sprout/preprocessor/wstringize.hpp>
#include <sprout/preprocessor/u16stringize.hpp>
#include <sprout/preprocessor/u32stringize.hpp>
#endif // #ifndef SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP

View file

@ -0,0 +1,13 @@
#ifndef SPROUT_PREPROCESSOR_U16STR_HPP
#define SPROUT_PREPROCESSOR_U16STR_HPP
#include <sprout/config.hpp>
//
// SPROUT_PP_U16STR
//
#define SPROUT_PP_U16STR(str) SPROUT_PP_U16STR_I(str)
#define SPROUT_PP_U16STR_I(str) u ## str
#endif // #ifndef SPROUT_PREPROCESSOR_U16STR_HPP

View file

@ -0,0 +1,14 @@
#ifndef SPROUT_PREPROCESSOR_U16STRINGIZE_HPP
#define SPROUT_PREPROCESSOR_U16STRINGIZE_HPP
#include <sprout/config.hpp>
//
// SPROUT_PP_U16STRINGIZE
//
#define SPROUT_PP_U16STRINGIZE(text) SPROUT_PP_U16STRINGIZE_I(text)
#define SPROUT_PP_U16STRINGIZE_I(text) SPROUT_PP_U16STRINGIZE_II(#text)
#define SPROUT_PP_U16STRINGIZE_II(str) u ## str
#endif // #ifndef SPROUT_PREPROCESSOR_U16STRINGIZE_HPP

View file

@ -0,0 +1,13 @@
#ifndef SPROUT_PREPROCESSOR_U32STR_HPP
#define SPROUT_PREPROCESSOR_U32STR_HPP
#include <sprout/config.hpp>
//
// SPROUT_PP_U32STR
//
#define SPROUT_PP_U32STR(str) SPROUT_PP_U32STR_I(str)
#define SPROUT_PP_U32STR_I(str) U ## str
#endif // #ifndef SPROUT_PREPROCESSOR_U32STR_HPP

View file

@ -0,0 +1,14 @@
#ifndef SPROUT_PREPROCESSOR_U32STRINGIZE_HPP
#define SPROUT_PREPROCESSOR_U32STRINGIZE_HPP
#include <sprout/config.hpp>
//
// SPROUT_PP_U32STRINGIZE
//
#define SPROUT_PP_U32STRINGIZE(text) SPROUT_PP_U32STRINGIZE_I(text)
#define SPROUT_PP_U32STRINGIZE_I(text) SPROUT_PP_U32STRINGIZE_II(#text)
#define SPROUT_PP_U32STRINGIZE_II(str) U ## str
#endif // #ifndef SPROUT_PREPROCESSOR_U32STRINGIZE_HPP

View file

@ -2,12 +2,22 @@
#define SPROUT_PREPROCESSOR_UNIQUE_STRING_HPP #define SPROUT_PREPROCESSOR_UNIQUE_STRING_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/preprocessor/stringize.hpp> #include <sprout/preprocessor/stringize_all.hpp>
#include <sprout/preprocessor/str_all.hpp>
// //
// SPROUT_PP_UNIQUE_STRING // SPROUT_PP_UNIQUE_STRING
// SPROUT_PP_UNIQUE_WSTRING
// SPROUT_PP_UNIQUE_U16STRING
// SPROUT_PP_UNIQUE_U32STRING
// //
#define SPROUT_PP_UNIQUE_STRING __DATE__ " " __TIME__ " : " __FILE__ "(" SPROUT_PP_STRINGIZE(__LINE__) ")" #define SPROUT_PP_UNIQUE_STRING __DATE__ " " __TIME__ " : " __FILE__ ":" SPROUT_PP_STRINGIZE(__LINE__)
#define SPROUT_PP_UNIQUE_WSTRING SPROUT_PP_WSTR(__DATE__) SPROUT_PP_WSTR(" ") SPROUT_PP_WSTR(__TIME__) \
SPROUT_PP_WSTR(" : ") SPROUT_PP_WSTR(__FILE__) SPROUT_PP_WSTR(":") SPROUT_PP_WSTRINGIZE(__LINE__)
#define SPROUT_PP_UNIQUE_U16STRING SPROUT_PP_U16STR(__DATE__) SPROUT_PP_U16STR(" ") SPROUT_PP_U16STR(__TIME__) \
SPROUT_PP_U16STR(" : ") SPROUT_PP_U16STR(__FILE__) SPROUT_PP_U16STR(":") SPROUT_PP_U16STRINGIZE(__LINE__)
#define SPROUT_PP_UNIQUE_U32STRING SPROUT_PP_U32STR(__DATE__) SPROUT_PP_U32STR(" ") SPROUT_PP_U32STR(__TIME__) \
SPROUT_PP_U32STR(" : ") SPROUT_PP_U32STR(__FILE__) SPROUT_PP_U32STR(":") SPROUT_PP_U32STRINGIZE(__LINE__)
#endif // #ifndef SPROUT_PREPROCESSOR_UNIQUE_STRING_HPP #endif // #ifndef SPROUT_PREPROCESSOR_UNIQUE_STRING_HPP

View file

@ -0,0 +1,13 @@
#ifndef SPROUT_PREPROCESSOR_WSTR_HPP
#define SPROUT_PREPROCESSOR_WSTR_HPP
#include <sprout/config.hpp>
//
// SPROUT_PP_WSTR
//
#define SPROUT_PP_WSTR(str) SPROUT_PP_WSTR_I(str)
#define SPROUT_PP_WSTR_I(str) L ## str
#endif // #ifndef SPROUT_PREPROCESSOR_WSTR_HPP

View file

@ -0,0 +1,14 @@
#ifndef SPROUT_PREPROCESSOR_WSTRINGIZE_HPP
#define SPROUT_PREPROCESSOR_WSTRINGIZE_HPP
#include <sprout/config.hpp>
//
// SPROUT_PP_WSTRINGIZE
//
#define SPROUT_PP_WSTRINGIZE(text) SPROUT_PP_WSTRINGIZE_I(text)
#define SPROUT_PP_WSTRINGIZE_I(text) SPROUT_PP_WSTRINGIZE_II(#text)
#define SPROUT_PP_WSTRINGIZE_II(str) L ## str
#endif // #ifndef SPROUT_PREPROCESSOR_WSTRINGIZE_HPP

View file

@ -21,5 +21,6 @@
#include <sprout/random/variate_generator.hpp> #include <sprout/random/variate_generator.hpp>
#include <sprout/random/random_result.hpp> #include <sprout/random/random_result.hpp>
#include <sprout/random/random_iterator.hpp> #include <sprout/random/random_iterator.hpp>
#include <sprout/random/unique_seed.hpp>
#endif // #ifndef SPROUT_RANDOM_HPP #endif // #ifndef SPROUT_RANDOM_HPP

View file

@ -96,12 +96,13 @@ namespace sprout {
// //
// ecuyer1988 // ecuyer1988
// //
typedef additive_combine_engine< typedef sprout::random::additive_combine_engine<
sprout::random::linear_congruential_engine<std::uint32_t, 40014, 0, 2147483563>, sprout::random::linear_congruential_engine<std::uint32_t, 40014, 0, 2147483563>,
sprout::random::linear_congruential_engine<std::uint32_t, 40692, 0, 2147483399> sprout::random::linear_congruential_engine<std::uint32_t, 40692, 0, 2147483399>
> ecuyer1988; > ecuyer1988;
} // namespace random } // namespace random
using sprout::random::additive_combine_engine;
using sprout::random::ecuyer1988; using sprout::random::ecuyer1988;
} // namespace sprout } // namespace sprout

View file

@ -125,6 +125,7 @@ namespace sprout {
typedef sprout::random::inversive_congruential_engine<std::uint32_t, 9102, 2147483647 - 36884165, 2147483647> hellekalek1995; typedef sprout::random::inversive_congruential_engine<std::uint32_t, 9102, 2147483647 - 36884165, 2147483647> hellekalek1995;
} // namespace random } // namespace random
using sprout::random::inversive_congruential_engine;
using sprout::random::hellekalek1995; using sprout::random::hellekalek1995;
} // namespace sprout } // namespace sprout

View file

@ -211,6 +211,7 @@ namespace sprout {
}; };
} // namespace random } // namespace random
using sprout::random::linear_congruential_engine;
using sprout::random::minstd_rand0; using sprout::random::minstd_rand0;
using sprout::random::minstd_rand; using sprout::random::minstd_rand;
using sprout::random::rand48; using sprout::random::rand48;

View file

@ -107,6 +107,8 @@ namespace sprout {
template<typename UIntType, int w, int k, int q, int s> template<typename UIntType, int w, int k, int q, int s>
SPROUT_CONSTEXPR UIntType sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::default_seed; SPROUT_CONSTEXPR UIntType sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::default_seed;
} // namespace random } // namespace random
using sprout::random::linear_feedback_shift_engine;
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_RANDOM_LINEAR_FEEDBACK_SHIFT_HPP #endif // #ifndef SPROUT_RANDOM_LINEAR_FEEDBACK_SHIFT_HPP

View file

@ -459,6 +459,7 @@ namespace sprout {
> mt19937_64; > mt19937_64;
} // namespace random } // namespace random
using sprout::random::mersenne_twister_engine;
using sprout::random::mt11213b; using sprout::random::mt11213b;
using sprout::random::mt19937; using sprout::random::mt19937;
using sprout::random::mt19937_64; using sprout::random::mt19937_64;

View file

@ -171,13 +171,14 @@ namespace sprout {
// //
// knuth_b // knuth_b
// //
typedef shuffle_order_engine<sprout::random::minstd_rand0, 256> knuth_b; typedef sprout::random::shuffle_order_engine<sprout::random::minstd_rand0, 256> knuth_b;
// //
// kreutzer1986 // kreutzer1986
// //
typedef sprout::random::shuffle_order_engine<sprout::random::linear_congruential_engine<std::uint32_t, 1366, 150889, 714025>, 97> kreutzer1986; typedef sprout::random::shuffle_order_engine<sprout::random::linear_congruential_engine<std::uint32_t, 1366, 150889, 714025>, 97> kreutzer1986;
} // namespace random } // namespace random
using sprout::random::shuffle_order_engine;
using sprout::random::knuth_b; using sprout::random::knuth_b;
using sprout::random::kreutzer1986; using sprout::random::kreutzer1986;
} // namespace sprout } // namespace sprout

View file

@ -85,6 +85,8 @@ namespace sprout {
template<typename URNG1, int s1, typename URNG2, int s2> template<typename URNG1, int s1, typename URNG2, int s2>
SPROUT_CONSTEXPR int sprout::random::xor_combine_engine<URNG1, s1, URNG2, s2>::shift2; SPROUT_CONSTEXPR int sprout::random::xor_combine_engine<URNG1, s1, URNG2, s2>::shift2;
} // namespace random } // namespace random
using sprout::random::xor_combine_engine;
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_RANDOM_XOR_COMBINE_HPP #endif // #ifndef SPROUT_RANDOM_XOR_COMBINE_HPP

View file

@ -6,5 +6,8 @@
#include <sprout/utility/rel_ops.hpp> #include <sprout/utility/rel_ops.hpp>
#include <sprout/utility/operation.hpp> #include <sprout/utility/operation.hpp>
#include <sprout/utility/operation_ext.hpp> #include <sprout/utility/operation_ext.hpp>
#include <sprout/utility/enabler_if.hpp>
#include <sprout/utility/pack.hpp>
#include <sprout/utility/value_holder.hpp>
#endif // #ifndef SPROUT_UTILITY_HPP #endif // #ifndef SPROUT_UTILITY_HPP