ooxml_crypt 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +58 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/ext/ooxml_crypt/extconf.rb +18 -0
- data/ext/ooxml_crypt/ooxml_crypt.c +27 -0
- data/ext/ooxml_crypt/ooxml_crypt.h +7 -0
- data/lib/ooxml_crypt/version.rb +5 -0
- data/lib/ooxml_crypt.rb +75 -0
- data/vendor/cybozulib/.github/workflows/main.yml +12 -0
- data/vendor/cybozulib/.gitignore +5 -0
- data/vendor/cybozulib/CMakeLists.txt +6 -0
- data/vendor/cybozulib/COPYRIGHT +27 -0
- data/vendor/cybozulib/Makefile +26 -0
- data/vendor/cybozulib/bin/libeay32.dll +0 -0
- data/vendor/cybozulib/bin/libmecab.dll +0 -0
- data/vendor/cybozulib/bin/ssleay32.dll +0 -0
- data/vendor/cybozulib/common.mk +116 -0
- data/vendor/cybozulib/common.props +25 -0
- data/vendor/cybozulib/cybozulib.sln +286 -0
- data/vendor/cybozulib/debug.props +14 -0
- data/vendor/cybozulib/include/cybozu/array.hpp +197 -0
- data/vendor/cybozulib/include/cybozu/atoi.hpp +238 -0
- data/vendor/cybozulib/include/cybozu/atomic.hpp +146 -0
- data/vendor/cybozulib/include/cybozu/base64.hpp +210 -0
- data/vendor/cybozulib/include/cybozu/benchmark.hpp +212 -0
- data/vendor/cybozulib/include/cybozu/bfd.hpp +105 -0
- data/vendor/cybozulib/include/cybozu/bit_operation.hpp +139 -0
- data/vendor/cybozulib/include/cybozu/bitvector.hpp +358 -0
- data/vendor/cybozulib/include/cybozu/condition_variable.hpp +113 -0
- data/vendor/cybozulib/include/cybozu/condition_variable_cs.hpp +74 -0
- data/vendor/cybozulib/include/cybozu/config.hpp +392 -0
- data/vendor/cybozulib/include/cybozu/critical_section.hpp +60 -0
- data/vendor/cybozulib/include/cybozu/crypto.hpp +321 -0
- data/vendor/cybozulib/include/cybozu/csucvector.hpp +624 -0
- data/vendor/cybozulib/include/cybozu/csv.hpp +294 -0
- data/vendor/cybozulib/include/cybozu/data_type.hpp +27 -0
- data/vendor/cybozulib/include/cybozu/endian.hpp +224 -0
- data/vendor/cybozulib/include/cybozu/env.hpp +63 -0
- data/vendor/cybozulib/include/cybozu/event.hpp +122 -0
- data/vendor/cybozulib/include/cybozu/exception.hpp +253 -0
- data/vendor/cybozulib/include/cybozu/file.hpp +626 -0
- data/vendor/cybozulib/include/cybozu/fmindex.hpp +291 -0
- data/vendor/cybozulib/include/cybozu/format.hpp +93 -0
- data/vendor/cybozulib/include/cybozu/frequency.hpp +264 -0
- data/vendor/cybozulib/include/cybozu/hash.hpp +67 -0
- data/vendor/cybozulib/include/cybozu/inttype.hpp +174 -0
- data/vendor/cybozulib/include/cybozu/itoa.hpp +336 -0
- data/vendor/cybozulib/include/cybozu/json.hpp +120 -0
- data/vendor/cybozulib/include/cybozu/line_stream.hpp +149 -0
- data/vendor/cybozulib/include/cybozu/link_libeay32.hpp +21 -0
- data/vendor/cybozulib/include/cybozu/link_mpir.hpp +18 -0
- data/vendor/cybozulib/include/cybozu/link_ssleay32.hpp +19 -0
- data/vendor/cybozulib/include/cybozu/log.hpp +237 -0
- data/vendor/cybozulib/include/cybozu/minixml.hpp +452 -0
- data/vendor/cybozulib/include/cybozu/mmap.hpp +143 -0
- data/vendor/cybozulib/include/cybozu/mutex.hpp +144 -0
- data/vendor/cybozulib/include/cybozu/nlp/mecab.hpp +96 -0
- data/vendor/cybozulib/include/cybozu/nlp/plsi.hpp +315 -0
- data/vendor/cybozulib/include/cybozu/nlp/random.hpp +74 -0
- data/vendor/cybozulib/include/cybozu/nlp/sparse.hpp +529 -0
- data/vendor/cybozulib/include/cybozu/nlp/svd.hpp +486 -0
- data/vendor/cybozulib/include/cybozu/nlp/tfidf.hpp +226 -0
- data/vendor/cybozulib/include/cybozu/nlp/top_score.hpp +75 -0
- data/vendor/cybozulib/include/cybozu/option.hpp +743 -0
- data/vendor/cybozulib/include/cybozu/parallel.hpp +88 -0
- data/vendor/cybozulib/include/cybozu/pcg.hpp +72 -0
- data/vendor/cybozulib/include/cybozu/process.hpp +324 -0
- data/vendor/cybozulib/include/cybozu/quit_signal_handler.hpp +66 -0
- data/vendor/cybozulib/include/cybozu/random_generator.hpp +144 -0
- data/vendor/cybozulib/include/cybozu/regex.hpp +463 -0
- data/vendor/cybozulib/include/cybozu/select8.hpp +279 -0
- data/vendor/cybozulib/include/cybozu/serializer.hpp +363 -0
- data/vendor/cybozulib/include/cybozu/sha1.hpp +209 -0
- data/vendor/cybozulib/include/cybozu/sha2.hpp +506 -0
- data/vendor/cybozulib/include/cybozu/siphash.hpp +105 -0
- data/vendor/cybozulib/include/cybozu/socket.hpp +785 -0
- data/vendor/cybozulib/include/cybozu/ssl.hpp +203 -0
- data/vendor/cybozulib/include/cybozu/stacktrace.hpp +291 -0
- data/vendor/cybozulib/include/cybozu/stream.hpp +269 -0
- data/vendor/cybozulib/include/cybozu/string.hpp +1746 -0
- data/vendor/cybozulib/include/cybozu/string_operation.hpp +365 -0
- data/vendor/cybozulib/include/cybozu/sucvector.hpp +378 -0
- data/vendor/cybozulib/include/cybozu/test.hpp +373 -0
- data/vendor/cybozulib/include/cybozu/thread.hpp +229 -0
- data/vendor/cybozulib/include/cybozu/time.hpp +281 -0
- data/vendor/cybozulib/include/cybozu/tls.hpp +115 -0
- data/vendor/cybozulib/include/cybozu/unordered_map.hpp +13 -0
- data/vendor/cybozulib/include/cybozu/unordered_set.hpp +13 -0
- data/vendor/cybozulib/include/cybozu/v128.hpp +376 -0
- data/vendor/cybozulib/include/cybozu/wavelet_matrix.hpp +345 -0
- data/vendor/cybozulib/include/cybozu/xorshift.hpp +189 -0
- data/vendor/cybozulib/include/cybozu/zlib.hpp +325 -0
- data/vendor/cybozulib/include/sais.hxx +364 -0
- data/vendor/cybozulib/misc/make_select8tbl.cpp +26 -0
- data/vendor/cybozulib/mk.bat +37 -0
- data/vendor/cybozulib/readme.md +29 -0
- data/vendor/cybozulib/release.props +12 -0
- data/vendor/cybozulib/sample/Makefile +30 -0
- data/vendor/cybozulib/sample/csucvector_smpl.cpp +42 -0
- data/vendor/cybozulib/sample/data/svd/org/test1.S +4 -0
- data/vendor/cybozulib/sample/data/svd/org/test1.U +4 -0
- data/vendor/cybozulib/sample/data/svd/org/test1.V +6 -0
- data/vendor/cybozulib/sample/data/svd/test1 +4 -0
- data/vendor/cybozulib/sample/data/svd/test2 +4 -0
- data/vendor/cybozulib/sample/desymbol.cpp +127 -0
- data/vendor/cybozulib/sample/exception_smpl.cpp +46 -0
- data/vendor/cybozulib/sample/fmindex_smpl.cpp +231 -0
- data/vendor/cybozulib/sample/log_smpl.cpp +19 -0
- data/vendor/cybozulib/sample/mecab_smpl.cpp +37 -0
- data/vendor/cybozulib/sample/option2_smpl.cpp +68 -0
- data/vendor/cybozulib/sample/option_smpl.cpp +42 -0
- data/vendor/cybozulib/sample/plsi_smpl.cpp +207 -0
- data/vendor/cybozulib/sample/proj/exception_smpl.vcproj +184 -0
- data/vendor/cybozulib/sample/proj/mecab_smpl.vcproj +184 -0
- data/vendor/cybozulib/sample/proj/ssl_smpl/ssl_smpl.vcxproj +85 -0
- data/vendor/cybozulib/sample/proj/ssl_smpl.vcproj +347 -0
- data/vendor/cybozulib/sample/proj/stacktrace_smpl/stacktrace_smpl.vcxproj +85 -0
- data/vendor/cybozulib/sample/proj/svd_smpl.vcproj +184 -0
- data/vendor/cybozulib/sample/quit_signal_handler.cpp +30 -0
- data/vendor/cybozulib/sample/serializer_smpl.cpp +196 -0
- data/vendor/cybozulib/sample/socket_smpl.cpp +82 -0
- data/vendor/cybozulib/sample/ssl_smpl.cpp +39 -0
- data/vendor/cybozulib/sample/stacktrace_smpl.cpp +52 -0
- data/vendor/cybozulib/sample/svd_bench_smpl.cpp +143 -0
- data/vendor/cybozulib/sample/svd_smpl.cpp +94 -0
- data/vendor/cybozulib/sample/wm_bench_smpl.cpp +182 -0
- data/vendor/cybozulib/sample/zlib_smpl.cpp +41 -0
- data/vendor/cybozulib/src/Makefile +8 -0
- data/vendor/cybozulib/src/base/Makefile +19 -0
- data/vendor/cybozulib/test/Makefile +12 -0
- data/vendor/cybozulib/test/base/Makefile +37 -0
- data/vendor/cybozulib/test/base/array_test.cpp +173 -0
- data/vendor/cybozulib/test/base/atoi_test.cpp +774 -0
- data/vendor/cybozulib/test/base/atomic_test.cpp +49 -0
- data/vendor/cybozulib/test/base/base64_test.cpp +113 -0
- data/vendor/cybozulib/test/base/bit_operation_test.cpp +134 -0
- data/vendor/cybozulib/test/base/bitvector_test.cpp +204 -0
- data/vendor/cybozulib/test/base/condition_variable_cs_test.cpp +92 -0
- data/vendor/cybozulib/test/base/condition_variable_test.cpp +88 -0
- data/vendor/cybozulib/test/base/config_test.cpp +236 -0
- data/vendor/cybozulib/test/base/crypto_test.cpp +122 -0
- data/vendor/cybozulib/test/base/csucvector_test.cpp +63 -0
- data/vendor/cybozulib/test/base/csv_test.cpp +182 -0
- data/vendor/cybozulib/test/base/data/a.xml +26 -0
- data/vendor/cybozulib/test/base/endian_test.cpp +56 -0
- data/vendor/cybozulib/test/base/env_test.cpp +22 -0
- data/vendor/cybozulib/test/base/event_test.cpp +41 -0
- data/vendor/cybozulib/test/base/file_test.cpp +233 -0
- data/vendor/cybozulib/test/base/fmindex_test.cpp +118 -0
- data/vendor/cybozulib/test/base/format_test.cpp +12 -0
- data/vendor/cybozulib/test/base/frequency_test.cpp +104 -0
- data/vendor/cybozulib/test/base/itoa_test.cpp +522 -0
- data/vendor/cybozulib/test/base/line_stream_test.cpp +208 -0
- data/vendor/cybozulib/test/base/mecab_test.cpp +41 -0
- data/vendor/cybozulib/test/base/minixml_test.cpp +103 -0
- data/vendor/cybozulib/test/base/mmap_test.cpp +15 -0
- data/vendor/cybozulib/test/base/option_test.cpp +487 -0
- data/vendor/cybozulib/test/base/parallel_test.cpp +48 -0
- data/vendor/cybozulib/test/base/proj/array_test/array_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/atoi_test/atoi_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/atomic_test/atomic_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/base64_test/base64_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/condition_variable_cs_test/condition_variable_cs_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/condition_variable_test/condition_variable_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/config_test/config_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/csv_test/csv_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/endian_test/endian_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/env_test/env_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/event_test/event_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/file_test/file_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/itoa_test/itoa_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/mecab_test/mecab_test.vcxproj +88 -0
- data/vendor/cybozulib/test/base/proj/minixml_test/minixml_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/mmap_test/mmap_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/serializer_test/serializer_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/sha1_test/sha1_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/stream_test/stream_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/string_operation_test/string_operation_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/string_test/string_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/thread_test/thread_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/time_test/time_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/tls_test/tls_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/proj/zlib_test/zlib_test.vcxproj +86 -0
- data/vendor/cybozulib/test/base/random_generator_test.cpp +28 -0
- data/vendor/cybozulib/test/base/regex_test.cpp +74 -0
- data/vendor/cybozulib/test/base/serializer_test.cpp +483 -0
- data/vendor/cybozulib/test/base/sha1_test.cpp +61 -0
- data/vendor/cybozulib/test/base/sha2_test.cpp +191 -0
- data/vendor/cybozulib/test/base/siphash_test.cpp +33 -0
- data/vendor/cybozulib/test/base/socket_test.cpp +76 -0
- data/vendor/cybozulib/test/base/stream_test.cpp +101 -0
- data/vendor/cybozulib/test/base/string_operation_test.cpp +340 -0
- data/vendor/cybozulib/test/base/string_test.cpp +1705 -0
- data/vendor/cybozulib/test/base/sucvector_test.cpp +312 -0
- data/vendor/cybozulib/test/base/thread_test.cpp +62 -0
- data/vendor/cybozulib/test/base/time_test.cpp +164 -0
- data/vendor/cybozulib/test/base/tls_test.cpp +50 -0
- data/vendor/cybozulib/test/base/wavelet_matrix_test.cpp +145 -0
- data/vendor/cybozulib/test/base/zlib_test.cpp +371 -0
- data/vendor/cybozulib/test/nlp/Makefile +27 -0
- data/vendor/cybozulib/test/nlp/proj/random_test.vcproj +184 -0
- data/vendor/cybozulib/test/nlp/proj/sparse_test.vcproj +184 -0
- data/vendor/cybozulib/test/nlp/proj/svd_test.vcproj +184 -0
- data/vendor/cybozulib/test/nlp/random_test.cpp +62 -0
- data/vendor/cybozulib/test/nlp/sparse_test.cpp +347 -0
- data/vendor/cybozulib/test/nlp/svd_test.cpp +234 -0
- data/vendor/cybozulib/test/nlp/top_score_test.cpp +40 -0
- data/vendor/cybozulib/tool/create_vcproj.py +186 -0
- data/vendor/cybozulib/tool/vcproj_tmpl.py +185 -0
- data/vendor/msoffice/COPYRIGHT +27 -0
- data/vendor/msoffice/Makefile +29 -0
- data/vendor/msoffice/bin/64/msoc.dll +0 -0
- data/vendor/msoffice/bin/64/msocsample.exe +0 -0
- data/vendor/msoffice/bin/64/msoffice-crypt.exe +0 -0
- data/vendor/msoffice/bin/msoc.dll +0 -0
- data/vendor/msoffice/bin/msocsample.exe +0 -0
- data/vendor/msoffice/bin/msoffice-crypt.exe +0 -0
- data/vendor/msoffice/common.mk +71 -0
- data/vendor/msoffice/common.props +26 -0
- data/vendor/msoffice/debug.props +14 -0
- data/vendor/msoffice/include/attack.hpp +211 -0
- data/vendor/msoffice/include/cfb.hpp +777 -0
- data/vendor/msoffice/include/crypto_util.hpp +450 -0
- data/vendor/msoffice/include/custom_sha1.hpp +342 -0
- data/vendor/msoffice/include/decode.hpp +240 -0
- data/vendor/msoffice/include/encode.hpp +221 -0
- data/vendor/msoffice/include/make_dataspace.hpp +316 -0
- data/vendor/msoffice/include/msoc.h +129 -0
- data/vendor/msoffice/include/resource.hpp +7 -0
- data/vendor/msoffice/include/standard_encryption.hpp +145 -0
- data/vendor/msoffice/include/uint32vec.hpp +179 -0
- data/vendor/msoffice/include/util.hpp +212 -0
- data/vendor/msoffice/lib/.emptydir +0 -0
- data/vendor/msoffice/misc/decrypt-xls.vbs +46 -0
- data/vendor/msoffice/mk.bat +1 -0
- data/vendor/msoffice/mkdll.bat +3 -0
- data/vendor/msoffice/msoc.def +13 -0
- data/vendor/msoffice/msocsample.py +178 -0
- data/vendor/msoffice/msoffice12.sln +31 -0
- data/vendor/msoffice/readme.md +110 -0
- data/vendor/msoffice/release.props +28 -0
- data/vendor/msoffice/src/Makefile +19 -0
- data/vendor/msoffice/src/attack.cpp +124 -0
- data/vendor/msoffice/src/cfb_test.cpp +77 -0
- data/vendor/msoffice/src/minisample.c +54 -0
- data/vendor/msoffice/src/msocdll.cpp +276 -0
- data/vendor/msoffice/src/msocsample.c +136 -0
- data/vendor/msoffice/src/msoffice-crypt.cpp +219 -0
- data/vendor/msoffice/src/proj/attack/attack.vcxproj +88 -0
- data/vendor/msoffice/src/proj/main/msoffice-crypt.vcxproj +88 -0
- data/vendor/msoffice/src/sha1.cpp +234 -0
- data/vendor/msoffice/test/Makefile +20 -0
- data/vendor/msoffice/test/cfb_test.cpp +74 -0
- data/vendor/msoffice/test/hash_test.cpp +59 -0
- data/vendor/msoffice/test/proj/cfb/cfb_test.vcxproj +90 -0
- data/vendor/msoffice/test/proj/hash/hash_test.vcxproj +90 -0
- data/vendor/msoffice/test/sampl.bat +8 -0
- data/vendor/msoffice/test_all.py +46 -0
- data/vendor/update +4 -0
- metadata +351 -0
@@ -0,0 +1,184 @@
|
|
1
|
+
<?xml version="1.0" encoding="shift_jis"?>
|
2
|
+
<VisualStudioProject
|
3
|
+
ProjectType="Visual C++"
|
4
|
+
Version="9.00"
|
5
|
+
Name="random_test"
|
6
|
+
ProjectGUID="{D0B6CDA2-ED5A-488C-8A00-42B558C10F2E}"
|
7
|
+
RootNamespace="random_test"
|
8
|
+
Keyword="Win32Proj"
|
9
|
+
TargetFrameworkVersion="196613"
|
10
|
+
>
|
11
|
+
<Platforms>
|
12
|
+
<Platform
|
13
|
+
Name="Win32"
|
14
|
+
/>
|
15
|
+
<Platform
|
16
|
+
Name="x64"
|
17
|
+
/>
|
18
|
+
</Platforms>
|
19
|
+
<ToolFiles>
|
20
|
+
</ToolFiles>
|
21
|
+
<Configurations>
|
22
|
+
<Configuration
|
23
|
+
Name="Debug|Win32"
|
24
|
+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
25
|
+
IntermediateDirectory="$(ConfigurationName)\random_test"
|
26
|
+
ConfigurationType="1"
|
27
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/debug.vsprops"
|
28
|
+
CharacterSet="2"
|
29
|
+
>
|
30
|
+
<Tool
|
31
|
+
Name="VCCLCompilerTool"
|
32
|
+
Optimization="0"
|
33
|
+
AdditionalIncludeDirectories=""
|
34
|
+
PreprocessorDefinitions=""
|
35
|
+
MinimalRebuild="true"
|
36
|
+
BasicRuntimeChecks="3"
|
37
|
+
RuntimeLibrary="3"
|
38
|
+
UsePrecompiledHeader="0"
|
39
|
+
DebugInformationFormat="4"
|
40
|
+
/>
|
41
|
+
<Tool
|
42
|
+
Name="VCLinkerTool"
|
43
|
+
OutputFile="..\..\..\../cybozulib/bin\random_testd.exe"
|
44
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
45
|
+
LinkIncremental="2"
|
46
|
+
GenerateDebugInformation="true"
|
47
|
+
SubSystem="1"
|
48
|
+
TargetMachine="1"
|
49
|
+
/>
|
50
|
+
<Tool
|
51
|
+
Name="VCLibrarianTool"
|
52
|
+
OutputFile="..\..\..\../cybozulib/bin\random_testd.exe"
|
53
|
+
/>
|
54
|
+
</Configuration>
|
55
|
+
<Configuration
|
56
|
+
Name="Release|Win32"
|
57
|
+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
58
|
+
IntermediateDirectory="$(ConfigurationName)\random_test"
|
59
|
+
ConfigurationType="1"
|
60
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/release.vsprops"
|
61
|
+
CharacterSet="2"
|
62
|
+
WholeProgramOptimization="1"
|
63
|
+
>
|
64
|
+
<Tool
|
65
|
+
Name="VCCLCompilerTool"
|
66
|
+
Optimization="2"
|
67
|
+
EnableIntrinsicFunctions="true"
|
68
|
+
AdditionalIncludeDirectories=""
|
69
|
+
PreprocessorDefinitions=""
|
70
|
+
RuntimeLibrary="2"
|
71
|
+
EnableFunctionLevelLinking="true"
|
72
|
+
UsePrecompiledHeader="0"
|
73
|
+
DebugInformationFormat="3"
|
74
|
+
/>
|
75
|
+
<Tool
|
76
|
+
Name="VCLibrarianTool"
|
77
|
+
OutputFile="..\..\..\../cybozulib/bin\random_test.exe"
|
78
|
+
/>
|
79
|
+
<Tool
|
80
|
+
Name="VCLinkerTool"
|
81
|
+
OutputFile="..\..\..\../cybozulib/bin\random_test.exe"
|
82
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
83
|
+
LinkIncremental="1"
|
84
|
+
GenerateDebugInformation="true"
|
85
|
+
SubSystem="1"
|
86
|
+
OptimizeReferences="2"
|
87
|
+
EnableCOMDATFolding="2"
|
88
|
+
TargetMachine="1"
|
89
|
+
/>
|
90
|
+
</Configuration>
|
91
|
+
<Configuration
|
92
|
+
Name="Debug|x64"
|
93
|
+
OutputDirectory="$(SolutionDir)$(PlatformName)$(ConfigurationName)"
|
94
|
+
IntermediateDirectory="$(ConfigurationName)\$(RootNamespace)64"
|
95
|
+
ConfigurationType="1"
|
96
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/debug.vsprops"
|
97
|
+
CharacterSet="2"
|
98
|
+
>
|
99
|
+
<Tool
|
100
|
+
Name="VCMIDLTool"
|
101
|
+
TargetEnvironment="3"
|
102
|
+
/>
|
103
|
+
<Tool
|
104
|
+
Name="VCCLCompilerTool"
|
105
|
+
Optimization="0"
|
106
|
+
AdditionalIncludeDirectories=""
|
107
|
+
PreprocessorDefinitions=""
|
108
|
+
MinimalRebuild="true"
|
109
|
+
BasicRuntimeChecks="3"
|
110
|
+
RuntimeLibrary="3"
|
111
|
+
UsePrecompiledHeader="0"
|
112
|
+
DebugInformationFormat="3"
|
113
|
+
/>
|
114
|
+
<Tool
|
115
|
+
Name="VCLinkerTool"
|
116
|
+
OutputFile="..\..\..\../cybozulib/bin\random_testd.exe"
|
117
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
118
|
+
LinkIncremental="2"
|
119
|
+
GenerateDebugInformation="true"
|
120
|
+
SubSystem="1"
|
121
|
+
TargetMachine="17"
|
122
|
+
/>
|
123
|
+
<Tool
|
124
|
+
Name="VCLibrarianTool"
|
125
|
+
OutputFile="..\..\..\../cybozulib/bin\random_testd.exe"
|
126
|
+
/>
|
127
|
+
</Configuration>
|
128
|
+
<Configuration
|
129
|
+
Name="Release|x64"
|
130
|
+
OutputDirectory="$(SolutionDir)$(PlatformName)$(ConfigurationName)"
|
131
|
+
IntermediateDirectory="$(ConfigurationName)\$(RootNamespace)64"
|
132
|
+
ConfigurationType="1"
|
133
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/release.vsprops"
|
134
|
+
CharacterSet="2"
|
135
|
+
WholeProgramOptimization="1"
|
136
|
+
>
|
137
|
+
<Tool
|
138
|
+
Name="VCMIDLTool"
|
139
|
+
TargetEnvironment="3"
|
140
|
+
/>
|
141
|
+
<Tool
|
142
|
+
Name="VCCLCompilerTool"
|
143
|
+
Optimization="2"
|
144
|
+
EnableIntrinsicFunctions="true"
|
145
|
+
AdditionalIncludeDirectories=""
|
146
|
+
PreprocessorDefinitions=""
|
147
|
+
RuntimeLibrary="2"
|
148
|
+
EnableFunctionLevelLinking="true"
|
149
|
+
UsePrecompiledHeader="0"
|
150
|
+
DebugInformationFormat="3"
|
151
|
+
/>
|
152
|
+
<Tool
|
153
|
+
Name="VCLibrarianTool"
|
154
|
+
OutputFile="..\..\..\../cybozulib/bin\random_test.exe"
|
155
|
+
/>
|
156
|
+
<Tool
|
157
|
+
Name="VCLinkerTool"
|
158
|
+
OutputFile="..\..\..\../cybozulib/bin\random_test.exe"
|
159
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
160
|
+
LinkIncremental="1"
|
161
|
+
GenerateDebugInformation="true"
|
162
|
+
SubSystem="1"
|
163
|
+
OptimizeReferences="2"
|
164
|
+
EnableCOMDATFolding="2"
|
165
|
+
TargetMachine="17"
|
166
|
+
/>
|
167
|
+
</Configuration>
|
168
|
+
</Configurations>
|
169
|
+
<References>
|
170
|
+
</References>
|
171
|
+
<Files>
|
172
|
+
<Filter
|
173
|
+
Name="Source Files"
|
174
|
+
Filter="cpp;c;cc;cxx">
|
175
|
+
<File RelativePath="..\random_test.cpp"></File>
|
176
|
+
</Filter>
|
177
|
+
<Filter
|
178
|
+
Name="Header Files"
|
179
|
+
Filter="h;hpp">
|
180
|
+
</Filter>
|
181
|
+
</Files>
|
182
|
+
<Globals>
|
183
|
+
</Globals>
|
184
|
+
</VisualStudioProject>
|
@@ -0,0 +1,184 @@
|
|
1
|
+
<?xml version="1.0" encoding="shift_jis"?>
|
2
|
+
<VisualStudioProject
|
3
|
+
ProjectType="Visual C++"
|
4
|
+
Version="9.00"
|
5
|
+
Name="sparse_test"
|
6
|
+
ProjectGUID="{4C0C4E8A-0030-4450-8B3D-2BFC77443D98}"
|
7
|
+
RootNamespace="sparse_test"
|
8
|
+
Keyword="Win32Proj"
|
9
|
+
TargetFrameworkVersion="196613"
|
10
|
+
>
|
11
|
+
<Platforms>
|
12
|
+
<Platform
|
13
|
+
Name="Win32"
|
14
|
+
/>
|
15
|
+
<Platform
|
16
|
+
Name="x64"
|
17
|
+
/>
|
18
|
+
</Platforms>
|
19
|
+
<ToolFiles>
|
20
|
+
</ToolFiles>
|
21
|
+
<Configurations>
|
22
|
+
<Configuration
|
23
|
+
Name="Debug|Win32"
|
24
|
+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
25
|
+
IntermediateDirectory="$(ConfigurationName)\sparse_test"
|
26
|
+
ConfigurationType="1"
|
27
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/debug.vsprops"
|
28
|
+
CharacterSet="2"
|
29
|
+
>
|
30
|
+
<Tool
|
31
|
+
Name="VCCLCompilerTool"
|
32
|
+
Optimization="0"
|
33
|
+
AdditionalIncludeDirectories=""
|
34
|
+
PreprocessorDefinitions=""
|
35
|
+
MinimalRebuild="true"
|
36
|
+
BasicRuntimeChecks="3"
|
37
|
+
RuntimeLibrary="3"
|
38
|
+
UsePrecompiledHeader="0"
|
39
|
+
DebugInformationFormat="4"
|
40
|
+
/>
|
41
|
+
<Tool
|
42
|
+
Name="VCLinkerTool"
|
43
|
+
OutputFile="..\..\..\../cybozulib/bin\sparse_testd.exe"
|
44
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
45
|
+
LinkIncremental="2"
|
46
|
+
GenerateDebugInformation="true"
|
47
|
+
SubSystem="1"
|
48
|
+
TargetMachine="1"
|
49
|
+
/>
|
50
|
+
<Tool
|
51
|
+
Name="VCLibrarianTool"
|
52
|
+
OutputFile="..\..\..\../cybozulib/bin\sparse_testd.exe"
|
53
|
+
/>
|
54
|
+
</Configuration>
|
55
|
+
<Configuration
|
56
|
+
Name="Release|Win32"
|
57
|
+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
58
|
+
IntermediateDirectory="$(ConfigurationName)\sparse_test"
|
59
|
+
ConfigurationType="1"
|
60
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/release.vsprops"
|
61
|
+
CharacterSet="2"
|
62
|
+
WholeProgramOptimization="1"
|
63
|
+
>
|
64
|
+
<Tool
|
65
|
+
Name="VCCLCompilerTool"
|
66
|
+
Optimization="2"
|
67
|
+
EnableIntrinsicFunctions="true"
|
68
|
+
AdditionalIncludeDirectories=""
|
69
|
+
PreprocessorDefinitions=""
|
70
|
+
RuntimeLibrary="2"
|
71
|
+
EnableFunctionLevelLinking="true"
|
72
|
+
UsePrecompiledHeader="0"
|
73
|
+
DebugInformationFormat="3"
|
74
|
+
/>
|
75
|
+
<Tool
|
76
|
+
Name="VCLibrarianTool"
|
77
|
+
OutputFile="..\..\..\../cybozulib/bin\sparse_test.exe"
|
78
|
+
/>
|
79
|
+
<Tool
|
80
|
+
Name="VCLinkerTool"
|
81
|
+
OutputFile="..\..\..\../cybozulib/bin\sparse_test.exe"
|
82
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
83
|
+
LinkIncremental="1"
|
84
|
+
GenerateDebugInformation="true"
|
85
|
+
SubSystem="1"
|
86
|
+
OptimizeReferences="2"
|
87
|
+
EnableCOMDATFolding="2"
|
88
|
+
TargetMachine="1"
|
89
|
+
/>
|
90
|
+
</Configuration>
|
91
|
+
<Configuration
|
92
|
+
Name="Debug|x64"
|
93
|
+
OutputDirectory="$(SolutionDir)$(PlatformName)$(ConfigurationName)"
|
94
|
+
IntermediateDirectory="$(ConfigurationName)\$(RootNamespace)64"
|
95
|
+
ConfigurationType="1"
|
96
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/debug.vsprops"
|
97
|
+
CharacterSet="2"
|
98
|
+
>
|
99
|
+
<Tool
|
100
|
+
Name="VCMIDLTool"
|
101
|
+
TargetEnvironment="3"
|
102
|
+
/>
|
103
|
+
<Tool
|
104
|
+
Name="VCCLCompilerTool"
|
105
|
+
Optimization="0"
|
106
|
+
AdditionalIncludeDirectories=""
|
107
|
+
PreprocessorDefinitions=""
|
108
|
+
MinimalRebuild="true"
|
109
|
+
BasicRuntimeChecks="3"
|
110
|
+
RuntimeLibrary="3"
|
111
|
+
UsePrecompiledHeader="0"
|
112
|
+
DebugInformationFormat="3"
|
113
|
+
/>
|
114
|
+
<Tool
|
115
|
+
Name="VCLinkerTool"
|
116
|
+
OutputFile="..\..\..\../cybozulib/bin\sparse_testd.exe"
|
117
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
118
|
+
LinkIncremental="2"
|
119
|
+
GenerateDebugInformation="true"
|
120
|
+
SubSystem="1"
|
121
|
+
TargetMachine="17"
|
122
|
+
/>
|
123
|
+
<Tool
|
124
|
+
Name="VCLibrarianTool"
|
125
|
+
OutputFile="..\..\..\../cybozulib/bin\sparse_testd.exe"
|
126
|
+
/>
|
127
|
+
</Configuration>
|
128
|
+
<Configuration
|
129
|
+
Name="Release|x64"
|
130
|
+
OutputDirectory="$(SolutionDir)$(PlatformName)$(ConfigurationName)"
|
131
|
+
IntermediateDirectory="$(ConfigurationName)\$(RootNamespace)64"
|
132
|
+
ConfigurationType="1"
|
133
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/release.vsprops"
|
134
|
+
CharacterSet="2"
|
135
|
+
WholeProgramOptimization="1"
|
136
|
+
>
|
137
|
+
<Tool
|
138
|
+
Name="VCMIDLTool"
|
139
|
+
TargetEnvironment="3"
|
140
|
+
/>
|
141
|
+
<Tool
|
142
|
+
Name="VCCLCompilerTool"
|
143
|
+
Optimization="2"
|
144
|
+
EnableIntrinsicFunctions="true"
|
145
|
+
AdditionalIncludeDirectories=""
|
146
|
+
PreprocessorDefinitions=""
|
147
|
+
RuntimeLibrary="2"
|
148
|
+
EnableFunctionLevelLinking="true"
|
149
|
+
UsePrecompiledHeader="0"
|
150
|
+
DebugInformationFormat="3"
|
151
|
+
/>
|
152
|
+
<Tool
|
153
|
+
Name="VCLibrarianTool"
|
154
|
+
OutputFile="..\..\..\../cybozulib/bin\sparse_test.exe"
|
155
|
+
/>
|
156
|
+
<Tool
|
157
|
+
Name="VCLinkerTool"
|
158
|
+
OutputFile="..\..\..\../cybozulib/bin\sparse_test.exe"
|
159
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
160
|
+
LinkIncremental="1"
|
161
|
+
GenerateDebugInformation="true"
|
162
|
+
SubSystem="1"
|
163
|
+
OptimizeReferences="2"
|
164
|
+
EnableCOMDATFolding="2"
|
165
|
+
TargetMachine="17"
|
166
|
+
/>
|
167
|
+
</Configuration>
|
168
|
+
</Configurations>
|
169
|
+
<References>
|
170
|
+
</References>
|
171
|
+
<Files>
|
172
|
+
<Filter
|
173
|
+
Name="Source Files"
|
174
|
+
Filter="cpp;c;cc;cxx">
|
175
|
+
<File RelativePath="..\sparse_test.cpp"></File>
|
176
|
+
</Filter>
|
177
|
+
<Filter
|
178
|
+
Name="Header Files"
|
179
|
+
Filter="h;hpp">
|
180
|
+
</Filter>
|
181
|
+
</Files>
|
182
|
+
<Globals>
|
183
|
+
</Globals>
|
184
|
+
</VisualStudioProject>
|
@@ -0,0 +1,184 @@
|
|
1
|
+
<?xml version="1.0" encoding="shift_jis"?>
|
2
|
+
<VisualStudioProject
|
3
|
+
ProjectType="Visual C++"
|
4
|
+
Version="9.00"
|
5
|
+
Name="svd_test"
|
6
|
+
ProjectGUID="{382604E1-AA7C-4AF6-9E8D-60E5CB352675}"
|
7
|
+
RootNamespace="svd_test"
|
8
|
+
Keyword="Win32Proj"
|
9
|
+
TargetFrameworkVersion="196613"
|
10
|
+
>
|
11
|
+
<Platforms>
|
12
|
+
<Platform
|
13
|
+
Name="Win32"
|
14
|
+
/>
|
15
|
+
<Platform
|
16
|
+
Name="x64"
|
17
|
+
/>
|
18
|
+
</Platforms>
|
19
|
+
<ToolFiles>
|
20
|
+
</ToolFiles>
|
21
|
+
<Configurations>
|
22
|
+
<Configuration
|
23
|
+
Name="Debug|Win32"
|
24
|
+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
25
|
+
IntermediateDirectory="$(ConfigurationName)\svd_test"
|
26
|
+
ConfigurationType="1"
|
27
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/debug.vsprops"
|
28
|
+
CharacterSet="2"
|
29
|
+
>
|
30
|
+
<Tool
|
31
|
+
Name="VCCLCompilerTool"
|
32
|
+
Optimization="0"
|
33
|
+
AdditionalIncludeDirectories=""
|
34
|
+
PreprocessorDefinitions=""
|
35
|
+
MinimalRebuild="true"
|
36
|
+
BasicRuntimeChecks="3"
|
37
|
+
RuntimeLibrary="3"
|
38
|
+
UsePrecompiledHeader="0"
|
39
|
+
DebugInformationFormat="4"
|
40
|
+
/>
|
41
|
+
<Tool
|
42
|
+
Name="VCLinkerTool"
|
43
|
+
OutputFile="..\..\..\../cybozulib/bin\svd_testd.exe"
|
44
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
45
|
+
LinkIncremental="2"
|
46
|
+
GenerateDebugInformation="true"
|
47
|
+
SubSystem="1"
|
48
|
+
TargetMachine="1"
|
49
|
+
/>
|
50
|
+
<Tool
|
51
|
+
Name="VCLibrarianTool"
|
52
|
+
OutputFile="..\..\..\../cybozulib/bin\svd_testd.exe"
|
53
|
+
/>
|
54
|
+
</Configuration>
|
55
|
+
<Configuration
|
56
|
+
Name="Release|Win32"
|
57
|
+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
58
|
+
IntermediateDirectory="$(ConfigurationName)\svd_test"
|
59
|
+
ConfigurationType="1"
|
60
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/release.vsprops"
|
61
|
+
CharacterSet="2"
|
62
|
+
WholeProgramOptimization="1"
|
63
|
+
>
|
64
|
+
<Tool
|
65
|
+
Name="VCCLCompilerTool"
|
66
|
+
Optimization="2"
|
67
|
+
EnableIntrinsicFunctions="true"
|
68
|
+
AdditionalIncludeDirectories=""
|
69
|
+
PreprocessorDefinitions=""
|
70
|
+
RuntimeLibrary="2"
|
71
|
+
EnableFunctionLevelLinking="true"
|
72
|
+
UsePrecompiledHeader="0"
|
73
|
+
DebugInformationFormat="3"
|
74
|
+
/>
|
75
|
+
<Tool
|
76
|
+
Name="VCLibrarianTool"
|
77
|
+
OutputFile="..\..\..\../cybozulib/bin\svd_test.exe"
|
78
|
+
/>
|
79
|
+
<Tool
|
80
|
+
Name="VCLinkerTool"
|
81
|
+
OutputFile="..\..\..\../cybozulib/bin\svd_test.exe"
|
82
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
83
|
+
LinkIncremental="1"
|
84
|
+
GenerateDebugInformation="true"
|
85
|
+
SubSystem="1"
|
86
|
+
OptimizeReferences="2"
|
87
|
+
EnableCOMDATFolding="2"
|
88
|
+
TargetMachine="1"
|
89
|
+
/>
|
90
|
+
</Configuration>
|
91
|
+
<Configuration
|
92
|
+
Name="Debug|x64"
|
93
|
+
OutputDirectory="$(SolutionDir)$(PlatformName)$(ConfigurationName)"
|
94
|
+
IntermediateDirectory="$(ConfigurationName)\$(RootNamespace)64"
|
95
|
+
ConfigurationType="1"
|
96
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/debug.vsprops"
|
97
|
+
CharacterSet="2"
|
98
|
+
>
|
99
|
+
<Tool
|
100
|
+
Name="VCMIDLTool"
|
101
|
+
TargetEnvironment="3"
|
102
|
+
/>
|
103
|
+
<Tool
|
104
|
+
Name="VCCLCompilerTool"
|
105
|
+
Optimization="0"
|
106
|
+
AdditionalIncludeDirectories=""
|
107
|
+
PreprocessorDefinitions=""
|
108
|
+
MinimalRebuild="true"
|
109
|
+
BasicRuntimeChecks="3"
|
110
|
+
RuntimeLibrary="3"
|
111
|
+
UsePrecompiledHeader="0"
|
112
|
+
DebugInformationFormat="3"
|
113
|
+
/>
|
114
|
+
<Tool
|
115
|
+
Name="VCLinkerTool"
|
116
|
+
OutputFile="..\..\..\../cybozulib/bin\svd_testd.exe"
|
117
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
118
|
+
LinkIncremental="2"
|
119
|
+
GenerateDebugInformation="true"
|
120
|
+
SubSystem="1"
|
121
|
+
TargetMachine="17"
|
122
|
+
/>
|
123
|
+
<Tool
|
124
|
+
Name="VCLibrarianTool"
|
125
|
+
OutputFile="..\..\..\../cybozulib/bin\svd_testd.exe"
|
126
|
+
/>
|
127
|
+
</Configuration>
|
128
|
+
<Configuration
|
129
|
+
Name="Release|x64"
|
130
|
+
OutputDirectory="$(SolutionDir)$(PlatformName)$(ConfigurationName)"
|
131
|
+
IntermediateDirectory="$(ConfigurationName)\$(RootNamespace)64"
|
132
|
+
ConfigurationType="1"
|
133
|
+
InheritedPropertySheets="..\..\..\../cybozulib/common.vsprops;..\..\..\../cybozulib/release.vsprops"
|
134
|
+
CharacterSet="2"
|
135
|
+
WholeProgramOptimization="1"
|
136
|
+
>
|
137
|
+
<Tool
|
138
|
+
Name="VCMIDLTool"
|
139
|
+
TargetEnvironment="3"
|
140
|
+
/>
|
141
|
+
<Tool
|
142
|
+
Name="VCCLCompilerTool"
|
143
|
+
Optimization="2"
|
144
|
+
EnableIntrinsicFunctions="true"
|
145
|
+
AdditionalIncludeDirectories=""
|
146
|
+
PreprocessorDefinitions=""
|
147
|
+
RuntimeLibrary="2"
|
148
|
+
EnableFunctionLevelLinking="true"
|
149
|
+
UsePrecompiledHeader="0"
|
150
|
+
DebugInformationFormat="3"
|
151
|
+
/>
|
152
|
+
<Tool
|
153
|
+
Name="VCLibrarianTool"
|
154
|
+
OutputFile="..\..\..\../cybozulib/bin\svd_test.exe"
|
155
|
+
/>
|
156
|
+
<Tool
|
157
|
+
Name="VCLinkerTool"
|
158
|
+
OutputFile="..\..\..\../cybozulib/bin\svd_test.exe"
|
159
|
+
AdditionalLibraryDirectories="..\..\..\../cybozulib/lib"
|
160
|
+
LinkIncremental="1"
|
161
|
+
GenerateDebugInformation="true"
|
162
|
+
SubSystem="1"
|
163
|
+
OptimizeReferences="2"
|
164
|
+
EnableCOMDATFolding="2"
|
165
|
+
TargetMachine="17"
|
166
|
+
/>
|
167
|
+
</Configuration>
|
168
|
+
</Configurations>
|
169
|
+
<References>
|
170
|
+
</References>
|
171
|
+
<Files>
|
172
|
+
<Filter
|
173
|
+
Name="Source Files"
|
174
|
+
Filter="cpp;c;cc;cxx">
|
175
|
+
<File RelativePath="..\svd_test.cpp"></File>
|
176
|
+
</Filter>
|
177
|
+
<Filter
|
178
|
+
Name="Header Files"
|
179
|
+
Filter="h;hpp">
|
180
|
+
</Filter>
|
181
|
+
</Files>
|
182
|
+
<Globals>
|
183
|
+
</Globals>
|
184
|
+
</VisualStudioProject>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#include <stdio.h>
|
2
|
+
#include <cybozu/test.hpp>
|
3
|
+
#include <cybozu/nlp/random.hpp>
|
4
|
+
#include <cybozu/random_generator.hpp>
|
5
|
+
#include <math.h>
|
6
|
+
#include <time.h>
|
7
|
+
|
8
|
+
CYBOZU_TEST_AUTO(random)
|
9
|
+
{
|
10
|
+
double sum = 0;
|
11
|
+
double sqsum = 0;
|
12
|
+
const int n = 1000000;
|
13
|
+
|
14
|
+
cybozu::nlp::NormalRandomGenerator g;
|
15
|
+
for (int i = 0; i < n; i++) {
|
16
|
+
double v = g.get();
|
17
|
+
sum += v;
|
18
|
+
sqsum += v * v;
|
19
|
+
}
|
20
|
+
double m = sum / n;
|
21
|
+
double s = sqsum / n - m * m;
|
22
|
+
printf("m=%f, s=%f\n", m, s);
|
23
|
+
CYBOZU_TEST_ASSERT(fabs(m) < 2e-3);
|
24
|
+
CYBOZU_TEST_ASSERT(fabs(s - 1) < 2e-3);
|
25
|
+
}
|
26
|
+
|
27
|
+
template<class RG>
|
28
|
+
struct Benchmark {
|
29
|
+
RG rg;
|
30
|
+
Benchmark()
|
31
|
+
{
|
32
|
+
const int N = 1000000;
|
33
|
+
uint32_t a = 0;
|
34
|
+
clock_t begin = clock();
|
35
|
+
for (int i = 0; i < N; i++) {
|
36
|
+
a += rg();
|
37
|
+
}
|
38
|
+
clock_t end = clock();
|
39
|
+
double time = (end - begin) / double(CLOCKS_PER_SEC) / N * 1e6;
|
40
|
+
printf("%x %.3fusec\n", a, time);
|
41
|
+
}
|
42
|
+
};
|
43
|
+
|
44
|
+
CYBOZU_TEST_AUTO(bench)
|
45
|
+
{
|
46
|
+
Benchmark<cybozu::nlp::UniformRandomGenerator>();
|
47
|
+
Benchmark<cybozu::RandomGenerator>();
|
48
|
+
}
|
49
|
+
|
50
|
+
CYBOZU_TEST_AUTO(urando_bench)
|
51
|
+
{
|
52
|
+
cybozu::RandomGenerator rg;
|
53
|
+
const int N = 1000000;
|
54
|
+
clock_t begin = clock();
|
55
|
+
char buf[20];
|
56
|
+
for (int i = 0; i < N; i++) {
|
57
|
+
rg.read(buf, sizeof(buf));
|
58
|
+
}
|
59
|
+
clock_t end = clock();
|
60
|
+
double time = (end - begin) / double(CLOCKS_PER_SEC) / N * 1e6;
|
61
|
+
printf("%.3fusec\n", time);
|
62
|
+
}
|