Skip to content

Commit 1882b59

Browse files
authored
Make statistical types public (#298)
* Make statistical types public * Make moment_ops/outputRange_ops public * Adjust types/ops to package(mir)
1 parent cc7df88 commit 1882b59

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

source/mir/math/stat.d

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ import mir.primitives;
2626
import std.traits: isArray, isMutable, isIterable, isIntegral, CommonType;
2727
import mir.internal.utility: isFloatingPoint;
2828

29-
package template statType(T, bool checkComplex = true)
29+
///
30+
package(mir)
31+
template statType(T, bool checkComplex = true)
3032
{
3133
import mir.internal.utility: isFloatingPoint, isComplex;
3234

@@ -131,7 +133,9 @@ unittest
131133
static assert(is(statType!Foo == double)); // note: this is not ints
132134
}
133135

134-
package template meanType(T)
136+
///
137+
package(mir)
138+
template meanType(T)
135139
{
136140
import mir.math.sum: sumType;
137141
import mir.internal.utility: isFloatingPoint, isComplex;
@@ -552,7 +556,9 @@ unittest
552556
assert(x.sliced.mean!float == 29.25 / 12);
553557
}
554558

555-
package template hmeanType(T)
559+
///
560+
package(mir)
561+
template hmeanType(T)
556562
{
557563
import mir.math.sum: sumType;
558564

@@ -944,7 +950,9 @@ unittest
944950
assert(x.gmean.approxEqual(2.60517108));
945951
}
946952

947-
package template gmeanType(T)
953+
///
954+
package(mir)
955+
template gmeanType(T)
948956
{
949957
import mir.math.numeric: prodType;
950958

@@ -1839,7 +1847,7 @@ enum VarianceAlgo
18391847
assumeZeroMean
18401848
}
18411849

1842-
private
1850+
package(mir)
18431851
mixin template moment_ops(T,
18441852
Summation summation)
18451853
{
@@ -1859,7 +1867,7 @@ mixin template moment_ops(T,
18591867
}
18601868
}
18611869

1862-
private
1870+
package(mir)
18631871
mixin template outputRange_ops(T)
18641872
{
18651873
///
@@ -2794,7 +2802,9 @@ unittest
27942802
assert(x.sliced.variance!float.approxEqual(54.76562 / 11));
27952803
}
27962804

2797-
package template stdevType(T)
2805+
///
2806+
package(mir)
2807+
template stdevType(T)
27982808
{
27992809
import mir.internal.utility: isFloatingPoint;
28002810

0 commit comments

Comments
 (0)