Skip to content

Commit

Permalink
Update mir-algorithm version (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
9il authored Oct 25, 2018
1 parent 3b95da6 commit d260126
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ mir-random-test-library
docs.json
build/
build/mir-algorithm/
mir-random-test-library.exe
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -31,5 +31,5 @@
"versions": ["mir_random_test"]
}
},
"libs-windows": ["advapi32"]
"libs-windows": ["advapi32"]
}
18 changes: 9 additions & 9 deletions source/mir/random/algorithm.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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`).
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d260126

Please sign in to comment.