Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated vebosity #69

Merged
merged 4 commits into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions source/dcv/core/algorithm.d
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ Params:
Returns:
Calculated norm value.
*/
deprecated @nogc pure nothrow auto norm(Range, size_t N)(auto ref Slice!(N, Range) tensor, NormType normType)
deprecated("Use mir.glas.l1 functions: amax(INF), asum(L1), and nrm2(L2)")
@nogc pure nothrow auto norm(Range, size_t N)(auto ref Slice!(N, Range) tensor, NormType normType)
{
import mir.glas.l1;
final switch (normType)
Expand Down Expand Up @@ -133,7 +134,8 @@ Params:
Returns:
Returns normalized input tensor.
*/
deprecated @nogc nothrow auto normalized(Range, size_t N)(auto ref Slice!(N, Range) tensor, NormType normType = NormType.L2)
deprecated("Use array based division: tensor[] /= norm, or mir.ndslice.algorithm: tensor.ndEach!( (ref v) { v /= norm; } )")
@nogc nothrow auto normalized(Range, size_t N)(auto ref Slice!(N, Range) tensor, NormType normType = NormType.L2)
{
alias T = DeepElementType!(typeof(tensor));
auto n = tensor.norm(normType);
Expand Down Expand Up @@ -168,7 +170,7 @@ Returns:
Scaled input tensor.

*/
deprecated @nogc nothrow auto scaled(Scalar, Range, size_t N)(auto ref Slice!(N, Range) tensor, Scalar alpha = 1, Scalar beta = 0)
@nogc nothrow auto scaled(Scalar, Range, size_t N)(auto ref Slice!(N, Range) tensor, Scalar alpha = 1, Scalar beta = 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do not deprecate what is not in already in Mir

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mkay - done!

if (isNumeric!Scalar)
{
tensor.ndEach!((ref v) { v = alpha * (v) + beta; }, Yes.vectorized);
Expand Down
3 changes: 2 additions & 1 deletion source/dcv/core/utils.d
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Returns:
Return a slice with newly allocated data of type O, with same
shape as input slice.
*/
deprecated("Use mir.ndslice.slice.as instead: e.g. mySlice.as!T.slice") static Slice!(N, O*) asType(O, V, size_t N)(Slice!(N, V*) inslice)
deprecated("Use mir.ndslice.slice.as instead: e.g. mySlice.as!T.slice")
static Slice!(N, O*) asType(O, V, size_t N)(Slice!(N, V*) inslice)
{
static if (__traits(compiles, cast(O)V.init))
{
Expand Down