Git Product home page Git Product logo

fastmath's People

Contributors

behrica avatar genmeblog avatar mdgrs avatar pepe avatar tsulej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fastmath's Issues

Question about license

Since the code of this library includes primitive-math, which is MIT licensed, does fastmathโ€™s license need to be something which at a minimum retains the attribution requirements of MIT, like MIT or Apache? It seems like the Unlicense canโ€™t public domain something which is already MIT.

add ZAGA distribution

As per discussion on Slack, useful distributions might be added to the already available list.

A somewhat exhaustive list for implementation might be here as described in the gamlss.dist R package, including the ZAGA (Zero Adjusted Gamma) distribution.

Thanks for this excellent library!

Error when creating a list of vectors

In testing a function that returns random vectors I came across the following issue, but I'm not sure what's going wrong here.

(repeat 5 (v/vec2 10 10))

; Error printing return value (ClassCastException) at fastmath.vector.Vec2/equals (vector.clj:333).
; clojure.lang.Symbol cannot be cast to fastmath.vector.Vec2

Doing this with normal Clojure vectors gives the correct result
(repeat 5 [10 10])

([10 10] [10 10] [10 10] [10 10] [10 10])

How to call frandom with 2-3 arguments wihout getting ArityException?

According to https://generateme.github.io/fastmath/fastmath.random.html#var-frandom, frandom can be called with 1-3 params. Yet when I try to provide mx and send it two, it fails:

๐ŸŸ  clj -Sdeps '{:deps {generateme/fastmath {:mvn/version "2.0.5"}}}'
user=> (require '[fastmath.random :as fm.rand])
user=> (fm.rand/frandom (fm.rand/distribution :gamma) 1)
Execution error (ArityException) at fastmath.protocols/eval1001$fn$G (protocols.clj:10).
Wrong number of args (2) passed to: fastmath.random/eval4162/fn--4185

What am I doing wrong? Thank you!

Fastmath always loads MKL binaries

Hi there!
We love fastmath! ๐Ÿ™
Just a small nitpick (it actually broke our deployment pipeline ๐Ÿ˜„ ):
Fastmath includes com.github.haifengl/smile-mkl dependency which may lead to substantial resources (~800MB) being downloaded and included in the build.

image

This should be either configurable or at least mentioned in the Readme so as users may plan for this and optionally exclude this dependency from their deps tree.

Cheers
Miro

Is vector4 intended to be = to clojure persistent vector?

Messing with some pixel operations, scanning to eliminate blank pixels (naively), I want to filter out
[255.0 255.0 255.0 255.0] and record [x y] coords that are non-blank...

(defn extract-outline [pixels]
  (let [blank [255.0 255.0 255.0 255.0]
        [w h] ((juxt c2d/width c2d/height)  pixels)]
    (->> (for  [x (range w)
                y (range h)]
           (let [p (p/get-color pixels x y)]
             (when (not= p blank)
               [x y])))
         (filter identity)
         vec)))

Input pixels is a result of to-pixels from an image. I believe a vector4 buffer.

The problem is, = between the vec4 that's stored in pixels and the literal 4-element vector I denoted is not considered structurally equal. So, every pixel is returned. I'm guessing the simple way out is to to use vec4 explicitly instead of clojure's vector. Is this intentional?

result of clustering is inconsistent regarding "sizes"

I noticed that the map comming back from clustering is "structurally different", depending how many (non-empty !) clusters it finds.

If I ask for 5 clusters, I would expect that the map I get back always has:

:clusters = 5
:sizes (s1 s2 s3 s4 s5)

I get sometimes this:

  :sizes = ( 97 53 0 )
  :clusters = 2

[signal] Question about filter sweeps

Hi! Thanks for this library, it has lots of great stuff in it and I'm enjoying playing around.

I have some existing code that generates audio waveforms as sequences of samples, so the design of the effect nodes as closures that operate sequentially on samples is great.

I am able to make a :simple-lowpass effect and apply it to my sounds and it works as expected.

What I'd like to be able to do is vary (sweep) the cutoff frequency over time, and I don't see a way to do that currently.

(let [alpha (calc-filter-alpha rate cutoff)]

Maybe it would be good if (fastmath.signal/effect ...) returned something that could update its parameters - I have in mind something akin to a VST effect, so parameters could be changed "during" processing.

Regardless, thank you again for this library, many useful functions here and I look forward to exploring it more.

Take care.

ClojureScript support

It would be great to have ClojureScript support for parts of fastmath, especially fastmath.random.

unable to use the v1.3.0-SNAPSHOT due to `[clj-boost "0.0.4"]`

If I try to launch lein repl in master branch I get this error. I managed to pinpoint it to [clj-boost "0.0.4"] dependency by commenting them out one by one. I am not an expert. I got to this problem when I tried to run the current version of Clojure2D/clojure2d-examples.

Could not find artifact jdk.tools:jdk.tools:jar:1.8 at specified path C:\Program Files\Java\jre1.8.0_191/../lib/tools.jar
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

Regards,
Adrian

Using the triangle grid - possible bug?

Hello, I'm not sure whether I am using the library wrong, but I seem unable to get all triangles addressed, only every second one. I tried passing a third coordinate to toggle up/down triangles to cell->mid without effect. Can you give a hint on how to work with the triangle grid correctly?

What seems weird is that e.g.

user=> (g/corners gr (g/cell->mid gr [0 0]))

and

user=> (g/corners gr (g/cell->mid gr [1 0]))

give the same results for triangular grids. (Same for 2/3, 4/5 etc.) I thought maybe even/odd x coordinates are supposed to alternate up/down triangles? But this seems to be broken broken.

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.