andresy/torch — pull request #96 by jucor (2012-12-12 13:05:46+00:00)
Title: Allow negative step with range

Allow to specify a negative step size in torch.range() -- much as in Matlab. Tests added and passed, too.

```
[julien@stmartin torch (NegativeStepRange=)]$ torch
Try the IDE: torch -ide
Type help() for more info
Torch 7.0 Copyright (C) 2001-2011 Idiap, NEC Labs, NYU
Lua 5.1 Copyright (C) 1994-2008 Lua.org, PUC-Rio
t7> =torch.range(10,5,-1)
10
9
8
7
6
5
[torch.DoubleTensor of dimension 6]

t7> torch.test()
Running 33 tests
_________________________________ ==> Done

Completed 77 asserts in 33 tests with 0 errors

--------------------------------------------------------------------------------
t7> ```