<< Back to previous view

[CRRBV-2] Efficient reverse resulting in reversed rrb-vector Created: 20/Dec/13  Updated: 20/Dec/13

Status: Open
Project: core.rrb-vector
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Gunnar Völkel Assignee: Michał Marczyk
Resolution: Unresolved Votes: 0
Labels: enhancement


 Description   

Is it possible to implement an efficient reverse on a rrb-vector resulting in an rrb-vector? This would be pretty useful in scenarios like the 2-opt neighborhood for local search for the Traveling Salesman Problem. The complete operation is as follows.

Given: a = [a_0, a_1, ..., a_{n-1}, a_{n}, a_{n+1}, ..., a_{n+k-2}, a_{n+k-1}, a_{n+k}, ..., a_{n+k+m-1}]
Goal: [a_0, a_1, ..., a_{n-1}, a_{n+k-1}, a_{n+k-2}, ..., a_{n+1}, a_{n}, a_{n+k}, ..., a_{n+k+m-1}]

Possible Clojure implementation of the described operation:

(let [x (subvec a 0 n), y (subvec a n (+ n k)), z (subvec a (+ n k))]
 (catvec x, (reverse-vec y), z))





[CRRBV-7] test name test-reduce redef's in tests, reducing test coverage Created: 27/Dec/14  Updated: 06/Jan/15

Status: Open
Project: core.rrb-vector
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Andy Fingerhut Assignee: Michał Marczyk
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File crrbv-7-v1.patch    

 Description   

If two deftest's have the same name, only the tests in the last one with the same name are actually run. test-reduce is used as a deftest name twice in file src/test/clojure/clojure/core/rrb_vector_test.clj

Also there is an unnecessary [] in test-assoc!

Found via Eastwood Clojure lint tool: https://github.com/jonase/eastwood



 Comments   
Comment by Andy Fingerhut [ 27/Dec/14 1:30 PM ]

Patch crrbv-7-v1.patch dated Dec 27 2014 corrects the two issues mentioned in the description, and passes all tests, including the ones that were not being run before.

Comment by Michał Marczyk [ 06/Jan/15 2:57 PM ]

Oddly enough, I have these corrected locally, but never got round to pushing a commit. It's only right that I should apply your patch for it, though – I found both issues using Eastwood myself! I'll do that in time for the next release. Thanks!

Comment by Andy Fingerhut [ 06/Jan/15 3:21 PM ]

Please do whatever is easiest – I don't mind if my name isn't on the commit.





Generated at Tue Mar 03 09:03:50 CST 2015 using JIRA 4.4#649-r158309.