From d26012691c8ffe42721c0c0b4e1065ee1be8e384 Mon Sep 17 00:00:00 2001 From: Ilya Yaroshenko Date: Thu, 25 Oct 2018 21:24:08 +0700 Subject: [PATCH] Update mir-algorithm version (#103) --- .gitignore | 1 + appveyor.yml | 6 +++--- circle.yml | 3 ++- doc/Makefile | 3 ++- dub.json | 4 ++-- source/mir/random/algorithm.d | 18 +++++++++--------- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 95bbf9d1..e27967f3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ mir-random-test-library docs.json build/ build/mir-algorithm/ +mir-random-test-library.exe diff --git a/appveyor.yml b/appveyor.yml index 59477115..0d5a013a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,13 +2,13 @@ platform: x64 environment: matrix: - DC: dmd - DVersion: 2.080.0 + DVersion: 2.082.1 arch: x64 - DC: dmd - DVersion: 2.080.0 + DVersion: 2.082.1 arch: x86 - DC: ldc - DVersion: '1.10.0' + DVersion: '1.12.0' arch: x64 matrix: diff --git a/circle.yml b/circle.yml index 9587a272..173044af 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,6 @@ machine: environment: - DMD: 2.074.1 + DMD: 2.082.1 PATH: "${HOME}/dmd2/linux/bin64:${PATH}" LD_LIBRARY_PATH: "${HOME}/dmd2/linux/lib64:${LD_LIBRARY_PATH}" checkout: @@ -11,6 +11,7 @@ dependencies: override: - curl -fsSL --retry 3 "http://downloads.dlang.org/releases/2.x/$DMD/dmd.$DMD.linux.tar.xz" | tar -C ~ -Jxf - - dmd --version + - git clone https://github.com/libmir/mir-core - git clone https://github.com/libmir/mir-algorithm - git clone https://github.com/libmir/mir-linux-kernel test: diff --git a/doc/Makefile b/doc/Makefile index 769b8020..f97e257b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -15,6 +15,7 @@ DOC_OUTPUT_DIR=web DOC_SOURCE_DIR=doc GENERATED=.generated RANDOM_DIR=source +CORE_DIR=mir-core/source ALGORITHM_DIR=mir-algorithm/source LINUX_KERNEL_DIR=mir-linux-kernel/source DLANGORG_DIR=$(DOC_SOURCE_DIR)/dlang.org @@ -79,7 +80,7 @@ ADDSOURCE=$(if $(subst index.d,,$1),$(RANDOM_DIR)/$1,$1) # ../web/phobos/std_conv.html : std/conv.d $(STDDOC) ; ... $(foreach p,$(SRC_DOCUMENTABLES),$(eval \ $(DOC_OUTPUT_DIR)/$(call D2HTML,$p) : $(call ADDSOURCE,$p) $(STDDOC) ;\ - $(DDOC) $(STDDOC) -I$(RANDOM_DIR) -I$(ALGORITHM_DIR) -I$(LINUX_KERNEL_DIR) -Df$$@ $$<)) + $(DDOC) $(STDDOC) -I$(RANDOM_DIR) -I$(CORE_DIR) -I$(ALGORITHM_DIR) -I$(LINUX_KERNEL_DIR) -Df$$@ $$<)) ########################################################### # Setup all other resources needed by dlang.org diff --git a/dub.json b/dub.json index fbb236b1..d08a3ab0 100644 --- a/dub.json +++ b/dub.json @@ -12,7 +12,7 @@ "copyright": "Copyright © 2016-2017, Ilya Yaroshenko, see also copyright per file", "license": "BSL-1.0 (default), Apache License, Version 2.0 for PCG", "dependencies": { - "mir-algorithm": ">=2.0.0 <3.0.0" + "mir-algorithm": ">=2.0.0 <3.1.0" }, "dependencies-linux": { "mir-linux-kernel": "~>1.0.0" @@ -31,5 +31,5 @@ "versions": ["mir_random_test"] } }, - "libs-windows": ["advapi32"] + "libs-windows": ["advapi32"] } diff --git a/source/mir/random/algorithm.d b/source/mir/random/algorithm.d index a791ce38..5f031581 100644 --- a/source/mir/random/algorithm.d +++ b/source/mir/random/algorithm.d @@ -185,7 +185,7 @@ nothrow @safe version(mir_random_test) unittest /// Random sample from uniform distribution strictly in the interval `(-1, 1)`. nothrow @safe version(mir_random_test) unittest { - import mir.ndslice.algorithm: all; + import mir.algorithm.iteration: all; import mir.math.common: fabs; // Using default RNE: auto sample = randomSlice!double(10); @@ -282,11 +282,11 @@ struct VitterStrides } /// Returns: `true` if sample length equals to 0. - bool empty()() @property { return n == 0; } + bool empty()() const @property { return n == 0; } /// Returns: `N` (remaining sample length) - size_t length()() @property { return n; } + size_t length()() const @property { return n; } /// Returns: `n` (remaining range length) - size_t tail()() @property { return N; } + size_t tail()() const @property { return N; } /++ Returns: random stride step (`S`). @@ -447,7 +447,7 @@ nothrow @safe version(mir_random_test) unittest /// nothrow @safe version(mir_random_test) unittest { - import mir.ndslice.algorithm: equal; + import mir.algorithm.iteration: equal; import mir.ndslice.topology: iota; import mir.random.engine.xorshift; @@ -526,9 +526,9 @@ struct RandomSample(G, Range) } /// Range primitives - size_t length()() @property { return strides.length + 1; } + size_t length() const @property { return strides.length + 1; } /// ditto - bool empty()() @property { return length == 0; } + bool empty()() const @property { return length == 0; } /// ditto auto ref front()() @property { return range.front; } /// ditto @@ -554,9 +554,9 @@ struct RandomSample(Range, alias gen) } /// Range primitives - size_t length()() @property { return strides.length + 1; } + size_t length()() const @property { return strides.length + 1; } /// ditto - bool empty()() @property { return length == 0; } + bool empty()() const @property { return length == 0; } /// ditto auto ref front()() @property { return range.front; } /// ditto