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

Add vector-set, slight tidying in structure (autodiff #3) #220

Merged
merged 22 commits into from Jan 21, 2021

Conversation

sritchie
Copy link
Member

@sritchie sritchie commented Dec 26, 2020

This PR adds a "vector set" implementation that we'll use in #221 to implement Differential. A "vector set" is a vector of distinct, sorted elements, used to represent a set more cheaply than an actual set.

Rather than make a deftype and make this a real thing that matches the set interface (and perhaps discover in the process that Clojure has already optimized small sets to work just as fast, gulp!), vector sets you make with make stay correct if you stay inside the supplied API.

NOTE for @littleredcomputer - a (sorted-set) is actually very fast for conj, disj, set operations... but slower to return its greatest element.

Also, from the CHANGELOG:

NOTE: for reference, this idea is also called a "flat set" in boost. Technically a Clojure vector-based set is NOT flat, since vectors are implemented with a hash trie... whatever. Once we start benchmarking maybe we can replace this with a set.

@sritchie sritchie changed the base branch from master to sritchie/diff_two December 26, 2020 20:25
@codecov-io
Copy link

codecov-io commented Dec 26, 2020

Codecov Report

❗ No coverage uploaded for pull request base (sritchie/diff_two@ea870c0). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                 Coverage Diff                  @@
##             sritchie/diff_two     #220   +/-   ##
====================================================
  Coverage                     ?   84.20%           
====================================================
  Files                        ?       79           
  Lines                        ?     8072           
  Branches                     ?      440           
====================================================
  Hits                         ?     6797           
  Misses                       ?      835           
  Partials                     ?      440           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea870c0...9ec861f. Read the comment docs.

Base automatically changed from sritchie/diff_two to master January 21, 2021 16:01
@@ -0,0 +1,130 @@
;;
Copy link
Collaborator

Choose a reason for hiding this comment

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

for optimization of differential tags? I wonder if it is worth specializing it to numbers

@sritchie sritchie merged commit 06a7e69 into master Jan 21, 2021
@sritchie sritchie deleted the sritchie/diff_three branch May 3, 2021 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants