Re: Scicloj meeting: Sicmutils #1 - geometry, symbolic math, and physics in Clojure(script)

2020-12-07 Thread Daniel Slutsky
Here is the meeting video: https://twitter.com/lambduhh/status/1336027036574429185 On Friday, 20 November 2020 at 01:55:25 UTC+2 Daniel Slutsky wrote: > Background and RSVP: > https://clojureverse.org/t/scicloj-meeting-sicmutils-1-geometry-symbolic-math-and-physics-in-clojure-script/ >

Scicloj meeting: Sicmutils #1 - geometry, symbolic math, and physics in Clojure(script)

2020-11-19 Thread Daniel Slutsky
Background and RSVP: https://clojureverse.org/t/scicloj-meeting-sicmutils-1-geometry-symbolic-math-and-physics-in-clojure-script/ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com

Re: Numbers/math in Clojure

2017-06-27 Thread Phillip Lord
Alex Miller writes: > On Sunday, June 25, 2017 at 1:55:42 AM UTC-5, henrik42 wrote: >>> Oh, I thought because there is the float-function floats are supported. >> Clojure could use "0.2f" to print/read floats and still use double "0.2" as >> the default (but float's "Infinity" may be challengin

Re: Numbers/math in Clojure

2017-06-25 Thread Alex Miller
On Sunday, June 25, 2017 at 1:55:42 AM UTC-5, henrik42 wrote: > > Alex, > > Am Samstag, 24. Juni 2017 13:38:55 UTC schrieb Alex Miller: >> >> >> >> Oh, I thought because there is the float-function floats are supported. > Clojure could use "0.2f" to print/read floats and still use double "0.2" a

Re: Numbers/math in Clojure

2017-06-24 Thread henrik42
or a double, which is inherently > sketchy. The use cases for single precision floats even in Java are almost > entirely gone at this point. The only time you'd want to use them is if you > want floating point math with the smallest possible memory (and are willing > to give

Re: Numbers/math in Clojure

2017-06-24 Thread Alex Miller
the reader know whether to read single or double precision? It would have to make a decision on whether to make a float or a double, which is inherently sketchy. The use cases for single precision floats even in Java are almost entirely gone at this point. The only time you'd want to us

Numbers/math in Clojure

2017-06-24 Thread henrik42
Hi, I'm doing a little write-up on Java basics and comparing some of them to Clojure (things like mutable shared state, side effects and so on). When I came to "numbers" I was surprised by some of the things I found in Clojure. (== (double 0.5) (float 0.5)) ;; -> true (== (double 0.2) (fl

Re: Boxed math in transducers

2015-09-23 Thread Peter Taoussanis
Sorry- that should read "a little better", not "little better" ;-) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with yo

Re: Boxed math in transducers

2015-09-23 Thread Peter Taoussanis
Hey Alex, Not sure I follow. If we deref (volatile! 5), the dereffed val is a number. `(inc @(volatile! 5))` will involve boxed math but `(inc ^long @(volatile! 5))` won't. So, for example: (defn core-take ; As in clojure.core ([n] (fn [rf] (let [nv (volatile! n)]

Re: Boxed math in transducers

2015-09-23 Thread Alex Miller
Given that the counter is held in a volatile (boxed) object, I don't think a hint would help. On Wednesday, September 23, 2015 at 1:14:39 AM UTC-5, Peter Taoussanis wrote: > > Hi all, > > Just noticed some use of boxed math in a couple of the Clojure 1.7 > transducers

Boxed math in transducers

2015-09-22 Thread Peter Taoussanis
Hi all, Just noticed some use of boxed math in a couple of the Clojure 1.7 transducers (e.g. `take`). Would there be interest in a PR to add some numerical type hints? Cheers :-) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Experimental lightweight library for unit-checked math

2015-05-05 Thread 'wparke...@yahoo.com' via Clojure
I have created a *highly experimental* library for unit-checked math. I realize that there are some existing solutions, but I wanted something more lightweight that would layer on top of the existing Clojure/Java numeric system rather than create a new one. This is designed to provide

Re: maya - A DSL for math and numerical stuff

2015-01-09 Thread Jacob Goodson
n do this) > - The ability to "compile" expressions for different targets (GPU, native, > core.matrix implementation stc.) > > > > On Thursday, 8 January 2015 02:29:10 UTC+8, Divyansh Prakash wrote: >> >> maya - A DSL for math and numerical stuff. >&

Re: maya - A DSL for math and numerical stuff

2015-01-08 Thread Mikera
, Divyansh Prakash wrote: > > maya - A DSL for math and numerical stuff. > > https://gist.github.com/divs1210/b4fcbd48d7697dfd8850#file-maya > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: maya - A DSL for math and numerical stuff

2015-01-08 Thread Jacob Goodson
It's nice but take it a step further and include the order of operations On Wednesday, January 7, 2015 at 1:29:10 PM UTC-5, Divyansh Prakash wrote: > > maya - A DSL for math and numerical stuff. > > https://gist.github.com/divs1210/b4fcbd48d7697dfd8850#file-maya > -- You r

maya - A DSL for math and numerical stuff

2015-01-07 Thread Ivan L
Lovely. It also seems like a stones throw away to a succint let macro. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient wi

maya - A DSL for math and numerical stuff

2015-01-07 Thread Divyansh Prakash
maya - A DSL for math and numerical stuff. https://gist.github.com/divs1210/b4fcbd48d7697dfd8850#file-maya -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from n

Re: Composability of Clojure in math-heavy hot loops

2014-04-06 Thread Gary Trakhman
, and >>> similarly for any other functions with double return value: >>> >>> (defn abs-diff ^double [^double x ^double y] >>> (if (p/> x y) (p/- x y) (p/- y x))) >>> >>> Andy >>> >>> >>> On Sun, Apr 6, 201

Re: Composability of Clojure in math-heavy hot loops

2014-04-06 Thread Andy Fingerhut
abs-diff ^double [^double x ^double y] >> (if (p/> x y) (p/- x y) (p/- y x))) >> >> Andy >> >> >> On Sun, Apr 6, 2014 at 9:44 AM, Dmitry Groshev wrote: >> >>> For some time I had a suspicion that in Clojure we have a fundamental >>>

Re: Composability of Clojure in math-heavy hot loops

2014-04-06 Thread Dmitry Groshev
(p/> x y) (p/- x y) (p/- y x))) > > Andy > > > On Sun, Apr 6, 2014 at 9:44 AM, Dmitry Groshev > > > wrote: > >> For some time I had a suspicion that in Clojure we have a fundamental >> problem with efficient math and today I've tried to test it

Re: Composability of Clojure in math-heavy hot loops

2014-04-06 Thread Andy Fingerhut
any other functions with double return value: (defn abs-diff ^double [^double x ^double y] (if (p/> x y) (p/- x y) (p/- y x))) Andy On Sun, Apr 6, 2014 at 9:44 AM, Dmitry Groshev wrote: > For some time I had a suspicion that in Clojure we have a fundamental > problem with efficient

Composability of Clojure in math-heavy hot loops

2014-04-06 Thread Dmitry Groshev
For some time I had a suspicion that in Clojure we have a fundamental problem with efficient math and today I've tried to test it. Let's say we have a pretty simple function: (ns testapp.core (:require [criterium.core :as cr] [primitive-math :as p] [no.disassemble :as n

Re: purely functional math renderer

2014-03-16 Thread t x
04 UTC, t x wrote: >> >> Hi, >> >> >> I'm aware of MathJax, JsMath, MathQuill, MathDox. >> >> >> However, I'm wondering if anyone have implemented a pure clojure >> math renderer (not just a binding, but with the actual renderi

Re: purely functional math renderer

2014-03-16 Thread Jony Hudson
ch 2014 03:36:04 UTC, t x wrote: > > Hi, > > > I'm aware of MathJax, JsMath, MathQuill, MathDox. > > > However, I'm wondering if anyone have implemented a pure clojure > math renderer (not just a binding, but with the actual rendering in > Clojure).

Re: purely functional math renderer

2014-03-15 Thread Mikera
way of representing expressions so that these kind of tools can plug+play nicely. On Saturday, 15 March 2014 11:36:04 UTC+8, t x wrote: > > Hi, > > > I'm aware of MathJax, JsMath, MathQuill, MathDox. > > > However, I'm wondering if anyone have implemented a

purely functional math renderer

2014-03-14 Thread t x
Hi, I'm aware of MathJax, JsMath, MathQuill, MathDox. However, I'm wondering if anyone have implemented a pure clojure math renderer (not just a binding, but with the actual rendering in Clojure). What I find frustrating about existing solutions is their im-pureness. The bas

light-table doesn't like (set! *unchecked-math* true)

2013-09-24 Thread Jim - FooBar();
Hi all, does anyone have a clue why light-table 0.5.3 throws exception whenever it sees a (set! *unchecked-math* true)? I mean it swallows (set! *warn-on-reflection* true) just fine! Is this a bug? the actual exception is (set! *warn-on-reflection* true) (set! *unchecked-math* true

Re: [ANN] 'primitive-math', a library for predictable arithmetic operations

2013-06-07 Thread Ambrose Bonnaire-Sergeant
d to the local type-hints and the value of > *unchecked-math*. Actually verifying that it's calling the primitive, > unboxed, easily inlined clojure.lang.Numbers.add(long, long) requires > either a profiler or a decompiler. > > For a lot of use cases, this doesn't matter. Bu

[ANN] 'primitive-math', a library for predictable arithmetic operations

2013-06-07 Thread Zach Tellman
What (+ x y) compiles down is highly dependent on the surrounding context, including but not limited to the local type-hints and the value of *unchecked-math*. Actually verifying that it's calling the primitive, unboxed, easily inlined clojure.lang.Numbers.add(long, long) requires eit

Re: user math expression evaluation

2013-05-29 Thread Mikera
Craft wrote: >> >>> Are there any existing libs for the evaluation of math expressions? For >>> example, if the user enters "x + sin(y)", parse and evaluate the >>> expression, given vectors of floats for x and y. >> >> >> You can e

Re: user math expression evaluation

2013-05-29 Thread Brian Craft
gt; Are there any existing libs for the evaluation of math expressions? For >>> example, if the user enters "x + sin(y)", parse and evaluate the >>> expression, given vectors of floats for x and y. >> >> >> You can evaluate expressio

Re: user math expression evaluation

2013-05-29 Thread Brian Craft
This looks useful. Is it tied to jvm? On Tuesday, May 28, 2013 6:21:30 PM UTC-7, Mikera wrote: > > On Wednesday, 29 May 2013 02:19:41 UTC+8, Brian Craft wrote: > >> Are there any existing libs for the evaluation of math expressions? For >> example, if the user enters &q

Re: user math expression evaluation

2013-05-28 Thread SpiderPig
Here is some example code http://pastebin.com/HG2bWWms This allows you to evaluate infix or rpn expressions. It also demonstrates the use of eval to turn the expression into a clojure function which should give more performance. It is very simple though, so all the elements in the expressions hav

Re: user math expression evaluation

2013-05-28 Thread Mikera
On Wednesday, 29 May 2013 02:19:41 UTC+8, Brian Craft wrote: > Are there any existing libs for the evaluation of math expressions? For > example, if the user enters "x + sin(y)", parse and evaluate the > expression, given vectors of floats for x and y. You can evaluate ex

Re: user math expression evaluation

2013-05-28 Thread Jonathan Fischer Friberg
Found this: http://www.objecthunter.net/exp4j/ Might be useful. Jonathan On Wed, May 29, 2013 at 12:45 AM, SpiderPig wrote: > You could just write this yourself. > It's easier than it looks. > First start with an evaluator for rpn (reverse polish notation) > expressions. > "x + sin(y)" in rpn w

Re: user math expression evaluation

2013-05-28 Thread SpiderPig
You could just write this yourself. It's easier than it looks. First start with an evaluator for rpn (reverse polish notation) expressions. "x + sin(y)" in rpn would be "y sin x +". First you split that string and make it into a list. Then you can evaluate that with a few lines of code using a stac

Re: user math expression evaluation

2013-05-28 Thread Brian Craft
Thanks, I'd seen those. Incanter is jvm only, I think, which is less useful to me. clojure-infix looks dead, but maybe I can adapt it. On Tuesday, May 28, 2013 12:42:11 PM UTC-7, travis vachon wrote: > > Incanter has some stuff that does this: > > http://data-sorcery.org/2010

Re: user math expression evaluation

2013-05-28 Thread Travis Vachon
Incanter has some stuff that does this: http://data-sorcery.org/2010/05/14/infix-math/ this looks even closer to what you're looking for: https://github.com/tristan/clojure-infix On Tue, May 28, 2013 at 2:19 PM, Brian Craft wrote: > Are there any existing libs for the evaluation

user math expression evaluation

2013-05-28 Thread Brian Craft
Are there any existing libs for the evaluation of math expressions? For example, if the user enters "x + sin(y)", parse and evaluate the expression, given vectors of floats for x and y. -- -- You received this message because you are subscribed to the Google Groups "Clojure&quo

Re: math expression simplifier, kibit implementation

2012-12-02 Thread David Nolen
On Sun, Dec 2, 2012 at 1:42 PM, Jonas wrote: > > > On Sunday, December 2, 2012 7:33:17 PM UTC+2, David Nolen wrote: > >> On Sat, Dec 1, 2012 at 12:24 AM, Jonas wrote: >> >>> >>> * Predicates on logic vars: >>> [(foo (? x number?)) (bar ?x)] => match (foo 42) but not (foo :bar) >>> >> >> This

Re: math expression simplifier, kibit implementation

2012-12-02 Thread Jonas
On Sunday, December 2, 2012 7:33:17 PM UTC+2, David Nolen wrote: > > On Sat, Dec 1, 2012 at 12:24 AM, Jonas >wrote: > >> >> * Predicates on logic vars: >> [(foo (? x number?)) (bar ?x)] => match (foo 42) but not (foo :bar) >> > > This is now possible since we have constraints. > Awesome. I

Re: math expression simplifier, kibit implementation

2012-12-02 Thread David Nolen
On Sat, Dec 1, 2012 at 12:24 AM, Jonas wrote: > > * Predicates on logic vars: > [(foo (? x number?)) (bar ?x)] => match (foo 42) but not (foo :bar) > This is now possible since we have constraints. > * Segment vars: > [(* ??x 1 ??y) (* ??x ??y)] => (* 4 3 2 1 2 3 4) would turn into (*

Re: math expression simplifier, kibit implementation

2012-11-30 Thread Jonas
Hi The function `simplify-one` in kibit.core is the “brain” behind kibit: (defn simplify-one [expr rules] (let [alts (logic/run* [q] (logic/fresh [pat subst] (logic/membero [pat subst] rules) (logic/project [pat subst] (logic/all (pat expr)

math expression simplifier, kibit implementation

2012-11-30 Thread Brent Millare
Hey all, Before I diving in detail into the code, can someone provide me a high level explanation of how kibit simplifies code? I understand underneath it uses core.logic and rules but its not clear to me how it picks one form over the other. I'm trying to extend this to data that represents m

Re: math

2012-10-10 Thread Michael Klishin
2012/10/11 kovas boguta > Looks neat. Can I make a suggestion? > > For these cookbooks, it would be very help to know exactly which > version of clojure (and any libraries used) were used. You can even > just put the associated project.clj content at the top. > > putting project.clj in them is co

Re: math

2012-10-10 Thread kovas boguta
know exactly what to do to reproduce. And it will be obvious what needs to be updated when future versions are released. On Wed, Oct 10, 2012 at 6:37 PM, John Gabriele wrote: > On Tuesday, October 9, 2012 10:38:20 PM UTC-4, Brian Craft wrote: >> >> I need some basic math functions

Re: math

2012-10-10 Thread John Gabriele
On Tuesday, October 9, 2012 10:38:20 PM UTC-4, Brian Craft wrote: > > I need some basic math functions, e.g. floor. I see there are some in > contrib, but I'm unable to figure out the status of contrib. Seems like > it's deprecated, or in transition, or something? To

Re: math

2012-10-10 Thread Tom Clark
Probably the best way to get basic maths functions in Clojure is to use java.lang.Math. Cheers, Tom On Wed, Oct 10, 2012 at 3:38 PM, Brian Craft wrote: > I need some basic math functions, e.g. floor. I see there are some in > contrib, but I'm unable to figure out the status of con

Re: math

2012-10-10 Thread zcaudate
The apache commons library - http://commons.apache.org/math/ is really rock solid. all the utilities can be found in: http://commons.apache.org/math/apidocs/org/apache/commons/math3/util/FastMath.html see http://stackoverflow.com/questions/12327120/finding-all-the-power-roots-in-clojure for

Re: math

2012-10-09 Thread Mark Engelberg
On Tue, Oct 9, 2012 at 9:03 PM, kovas boguta wrote: > The reality is that the function names and signatures are often > totally different. Just switching the namespaces ain't gonna work. > These are basically new libraries, that are thematically similar to > the old ones. >

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:43 PM, kovas boguta wrote: > Actually all the examples I had in mind where from 1.2 (I migrated > from 1.1 so it all seemed part of a piece to me) > I think the migration from 1.2 to 1.3 is better documented than the migration from 1.1 to 1.2... > So should we expect t

Re: math

2012-10-09 Thread kovas boguta
Alright, you got me on that one. Actually all the examples I had in mind where from 1.2 (I migrated from 1.1 so it all seemed part of a piece to me) So should we expect the function and their signatures to be the same then? On Wed, Oct 10, 2012 at 12:34 AM, Sean Corfield wrote: > On Tue, Oct 9

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:23 PM, kovas boguta wrote: > The one that bit me specifically was clojure.contrib.string => > clojure.string . Not criticising the new design, its just a fact that > its not backwards compatible. > I believe that happened in Clojure 1.2, even before monolithic contrib wa

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:22 PM, Brian Craft wrote: > Top hits on google. "clojure math floor", top three hits are contrib docs. > Thanx. I Googled that phrased and the first result was the old richhickey repo. We should be able to get that fixed - or at least a notice added li

Re: math

2012-10-09 Thread kovas boguta
The one that bit me specifically was clojure.contrib.string => clojure.string . Not criticising the new design, its just a fact that its not backwards compatible. Anyway the point is: we should make clear that this isn't a 1-to-1 migration. 50% (or even 90%) compatibility is not the same as 100%.

Re: math

2012-10-09 Thread Brian Craft
On Tuesday, October 9, 2012 8:35:28 PM UTC-7, Sean Corfield wrote: > > What would help us is knowing what path you took in looking for > information about the math functions that led you to old contrib... so we > can make adjustments to what documentation is out there to

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:03 PM, kovas boguta wrote: > Most of the time you are using the contrib for some convenience > function. Its way easier to just copy that function into your own > project, than to worry about tracking down the new library, and then > checking that the function in question

Re: math

2012-10-09 Thread kovas boguta
M, Brian Craft wrote: >> >> I need some basic math functions, e.g. floor. I see there are some in >> contrib, but I'm unable to figure out the status of contrib. Seems like it's >> deprecated, or in transition, or something? > > > Back with Clojure 1.3, t

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 7:38 PM, Brian Craft wrote: > I need some basic math functions, e.g. floor. I see there are some in > contrib, but I'm unable to figure out the status of contrib. Seems like > it's deprecated, or in transition, or something? Back with Clojure 1.3,

Re: math

2012-10-09 Thread Devin Walters
e need for understanding altogether? '(Devin Walters) On Oct 9, 2012, at 9:44 PM, Mark Engelberg wrote: > https://github.com/clojure/math.numeric-tower > [org.clojure/math.numeric-tower "0.0.1"] > > > > > On Tue, Oct 9, 2012 at 7:38 PM, Brian Craft wrote: > I

Re: math

2012-10-09 Thread Mark Engelberg
https://github.com/clojure/math.numeric-tower [org.clojure/math.numeric-tower "0.0.1"] On Tue, Oct 9, 2012 at 7:38 PM, Brian Craft wrote: > I need some basic math functions, e.g. floor. I see there are some in > contrib, but I'm unable to figure out the status of contr

math

2012-10-09 Thread Brian Craft
I need some basic math functions, e.g. floor. I see there are some in contrib, but I'm unable to figure out the status of contrib. Seems like it's deprecated, or in transition, or something? -- You received this message because you are subscribed to the Google Groups "Clojure&

Re: generic math, comparator and arithmetic libs

2011-09-06 Thread Konrad Hinsen
On 6 Sep, 2011, at 12:43 , Sam Aaron wrote: >> I have added a plain function not= to clojure.algo.generic.comparison as a >> convenience, it is just the negation of generic =. > > Would this still allow the overriding of not= to do somethign different to > the negation of generic =. If not, how

Re: generic math, comparator and arithmetic libs

2011-09-06 Thread Sam Aaron
On 6 Sep 2011, at 11:33, Konrad Hinsen wrote: > > I must assume that nobody read that message, as there should have been loud > complaints. There is obviously no difference in performance between = and > not=, as the result of either one is known as soon as one can decide equality > OR non-equ

Re: generic math, comparator and arithmetic libs

2011-09-06 Thread Konrad Hinsen
On 1 Sep, 2011, at 14:51 , Konrad Hinsen wrote: > On 1 Sep, 2011, at 10:35 , Alan Malloy wrote: > >> I don't see any reason for it to include !=, which can be implemented >> as (not (= a b)). Conversely, <= could be implemented as (or (< a b) >> (= a b)), but if either of those is expensive opera

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread Jason Wolfe
A couple nitpicks: > Right, and that's also the reason why there should be not=, with a default > implementation that does (not (= ...)). It can be expensive to establish > equality for a complex data structure, whereas inequality can be ascertained > at the first difference encountered. In th

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread Konrad Hinsen
On 1 Sep, 2011, at 10:35 , Alan Malloy wrote: > I don't see any reason for it to include !=, which can be implemented > as (not (= a b)). Conversely, <= could be implemented as (or (< a b) > (= a b)), but if either of those is expensive operations he gives you > a chance to do a more-optimized <=.

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread Sam Aaron
On 1 Sep 2011, at 09:35, Alan Malloy wrote: > I don't see any reason for it to include !=, which can be implemented > as (not (= a b)). Conversely, <= could be implemented as (or (< a b) > (= a b)), but if either of those is expensive operations he gives you > a chance to do a more-optimized <=. T

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread Alan Malloy
y generic.comparison doesn't include != > > Sam > > ---http://sam.aaron.name > > On 1 Sep 2011, at 08:29, Konrad Hinsen wrote: > > > > > > > > > On 31 août 11, at 17:04, Sam Aaron wrote: > > >> is anyone aware of any plans to

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread Sam Aaron
t 17:04, Sam Aaron wrote: > >> is anyone aware of any plans to move Konrad Hinsen's generic math, >> comparator and arithmetic libraries to new separate 1.3 contrib libs? >> >> * >> http://richhickey.github.com/clojure-contrib/generic.math-functions-ap

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread Konrad Hinsen
On 31 août 11, at 17:04, Sam Aaron wrote: is anyone aware of any plans to move Konrad Hinsen's generic math, comparator and arithmetic libraries to new separate 1.3 contrib libs? * http://richhickey.github.com/clojure-contrib/generic.math-functions-api.html * http://richhickey.githu

generic math, comparator and arithmetic libs

2011-08-31 Thread Sam Aaron
Hi there, is anyone aware of any plans to move Konrad Hinsen's generic math, comparator and arithmetic libraries to new separate 1.3 contrib libs? * http://richhickey.github.com/clojure-contrib/generic.math-functions-api.html * http://richhickey.github.com/clojure-contrib/generic.arith

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread Stuart Sierra
Anything implemented with multimethods (contrib.generic) will be slow compared to primitives and Java methods invoked on primitives. Also try out the better primitive math ops in the 1.3.0-alphas. -Stuart clojure.com -- You received this message because you are subscribed to the Google

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread Jeffrey Schwab
On Tuesday, May 3, 2011 3:20:25 PM UTC-4, David Nolen wrote: > > On Tue, May 3, 2011 at 2:51 PM, Ken Wesson wrote: > >> It's optimizing your loop away, or else you're using ridiculously >> powerful hardware. >> >> user=> (time (dotimes [_

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread David Nolen
On Tue, May 3, 2011 at 2:51 PM, Ken Wesson wrote: > It's optimizing your loop away, or else you're using ridiculously > powerful hardware. > > user=> (time (dotimes [_ 100] (Math/ceil (rand > "Elapsed time: 142.86748 msecs" > nil Maybe, mayb

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread Ken Wesson
On Tue, May 3, 2011 at 8:03 AM, David Nolen wrote: > Why not? > user> (time (dotimes [_ 100000] (Math/ceil 0.1))) > "Elapsed time: 626.867 msecs" > David It's optimizing your loop away, or else you're using ridiculously powerful hardware. user=> (time

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread David Nolen
On Tue, May 3, 2011 at 9:50 AM, bOR_ wrote: > Because I did not remember Math/ceil :-). > > Point is, is there any consensus on what math library to use? Is (Math/... > in general the fastest? > For basic math, I'm not sure what could be faster than Java primitive operat

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread bOR_
Because I did not remember Math/ceil :-). Point is, is there any consensus on what math library to use? Is (Math/... in general the fastest? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread David Nolen
Why not? user> (time (dotimes [_ 10] (Math/ceil 0.1))) "Elapsed time: 626.867 msecs" David On Tue, May 3, 2011 at 3:38 AM, bOR_ wrote: > user> (time (dotimes [i 10] (contribmath-ceil (rand > > > "Elapsed time: 4500.530303 msecs" > >

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread Alan
On May 3, 12:38 am, bOR_ wrote: > user> (time (dotimes [i 10] (contribmath-ceil (rand                 > > "Elapsed time: 4500.530303 msecs"                                           > > nil                                                                         > > user> (time (dotimes [i

Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread bOR_
(time (dotimes [i 10] (inc (int (rand) "Elapsed time: 28.939557 msecs" Observing the huge differences in speed of certain math functions in different clojure libraries, I was wondering if anyone knows which c

Re: math utilities question

2010-12-06 Thread Joonas Pulakka
Standard way, definitely no. As others have pointed out, Incanter is The Clojure Math Tool, but strongly biased towards statistics and linear algebra, and outside those fields you'll need other tools. Apache Commons Math (http://commons.apache.org/math/) is one of the better self-contained

Re: math utilities question

2010-12-06 Thread Ken Wesson
(defmacro defchunk [name tps] `(def ~name (quote ~tps))) (defmacro let-chunk [vname name val-vec & body] (let [chunk-def @(resolve name) types (map first chunk-def) part-names (map (comp symbol (partial str vname "!") second) chunk-def)] `(let [~vname ~val-vec ~@

Re: math utilities question

2010-12-06 Thread Ken Wesson
On Tue, Dec 7, 2010 at 12:58 AM, Konrad Hinsen wrote: > On 06.12.2010, at 22:35, Ken Wesson wrote: > >>> I'd say what Java needs is not complex numbers as a value type, but a way >>> to define additional value types. Complex numbers are just one >>> applications. Another one is points (2D or 3D)

Re: math utilities question

2010-12-06 Thread Konrad Hinsen
On 06.12.2010, at 22:35, Ken Wesson wrote: >> I'd say what Java needs is not complex numbers as a value type, but a way to >> define additional value types. Complex numbers are just one applications. >> Another one is points (2D or 3D) for geometry and graphics. >> >> Unfortunately the problem

Re: math utilities question

2010-12-06 Thread Ken Wesson
On Mon, Dec 6, 2010 at 11:45 AM, Konrad Hinsen wrote: > On 06.12.2010, at 16:02, Johann Hibschman wrote: >> Maybe I'm not reading the right news, but I've not seen all that much on >> using Java for scientific work for a while now.  The NIST JavaNumerics >> guys seem to have given up, but if I rem

Re: math utilities question

2010-12-06 Thread Konrad Hinsen
On 06.12.2010, at 16:02, Johann Hibschman wrote: > (Konrad Hinsen had started some work on multiarrays in Clojure, but I've > not been following his progress.) There hasn't been much, unfortunately. I haven't found much time for serious Clojure hacking for a few months. But the project is not ab

Re: math utilities question

2010-12-06 Thread Johann Hibschman
Robert McIntyre writes: > I'm wondering if people have had experience with java libraries of > that sort and might have some recommendations. > > Anyone use clojure for scientific data analysis? What do you find > helpful to use? I'm still just evaluating clojure for scientific data analysis, bu

Re: math utilities question

2010-12-06 Thread Robert McIntyre
I have looked at incanter and like it very much, but these are all things that incanter can't currently do. --Robert McIntyre On Mon, Dec 6, 2010 at 3:15 AM, Saul Hazledine wrote: > On Dec 6, 12:27 am, Robert McIntyre wrote: >> I'm trying to use clojure for scientific data analysis but I keep >

Re: math utilities question

2010-12-06 Thread Saul Hazledine
On Dec 6, 12:27 am, Robert McIntyre wrote: > I'm trying to use clojure for scientific data analysis but I keep > running into lacunas of functionality. > > 6. symbolic manipulation as in sage This is something that would be awesome to have in Clojure because, unlike most non-lisps, you can compil

Re: math utilities question

2010-12-06 Thread Ken Wesson
On Mon, Dec 6, 2010 at 2:59 AM, Benny Tsai wrote: > Always nice to see a fellow Neal Stephenson fan! > > On Dec 5, 10:26 pm, Ken Wesson wrote: >> On Mon, Dec 6, 2010 at 12:14 AM, Miki wrote: >> > Have you looked at Incanter? (http://incanter.org/) >> >> Hmm, interesting. Is there a Rhetor too?

Re: math utilities question

2010-12-05 Thread Benny Tsai
Always nice to see a fellow Neal Stephenson fan! On Dec 5, 10:26 pm, Ken Wesson wrote: > On Mon, Dec 6, 2010 at 12:14 AM, Miki wrote: > > Have you looked at Incanter? (http://incanter.org/) > > Hmm, interesting. Is there a Rhetor too? -- You received this message because you are subscribed to

Re: math utilities question

2010-12-05 Thread Ken Wesson
On Mon, Dec 6, 2010 at 12:14 AM, Miki wrote: > Have you looked at Incanter? (http://incanter.org/) Hmm, interesting. Is there a Rhetor too? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com

Re: math utilities question

2010-12-05 Thread Miki
Have you looked at Incanter? (http://incanter.org/) On Dec 5, 3:27 pm, Robert McIntyre wrote: > I'm trying to use clojure for scientific data analysis but I keep > running into lacunas of functionality. > > I'd love to hear the community's recommendations and experiences with this: > > Is there a

Re: math utilities question

2010-12-05 Thread Robert McIntyre
Thanks for your input --- I'm hoping that some of this stuff is already written with performance optimizations and the like. I'm wondering if people have had experience with java libraries of that sort and might have some recommendations. Anyone use clojure for scientific data analysis? What do y

Re: math utilities question

2010-12-05 Thread Ken Wesson
On Sun, Dec 5, 2010 at 6:27 PM, Robert McIntyre wrote: > I'm trying to use clojure for scientific data analysis but I keep > running into lacunas of functionality. > > I'd love to hear the community's recommendations and experiences with this: > > Is there a standard way to do things like: > 1. ta

math utilities question

2010-12-05 Thread Robert McIntyre
I'm trying to use clojure for scientific data analysis but I keep running into lacunas of functionality. I'd love to hear the community's recommendations and experiences with this: Is there a standard way to do things like: 1. take the convolution of two vectors 2. work with imaginary numbers, qu

Re: Should Math/abs be able to accept Ratios?

2010-11-14 Thread Eric Lavigne
There are four separate methods called Math/abs, to handle the following types: int, long, float, double. So when you use Math/abs on a different Number type, it is not clear which of those methods it should use. The other examples you gave can only accept double. Maybe in that case Clojure is

Should Math/abs be able to accept Ratios?

2010-11-14 Thread Jarl Haggerty
Math/abs won't accept ratios, so I assumed the Java Math functions only took base number types but all the other methods I tried accept ratios just fine. user=> (Math/sin 1/2) 0.479425538604203 user=> (Math/sqrt 1/2) 0.7071067811865476 user=> (Math/pow 1/2 1/2) 0.7071067811865476 us

Simple macro hack for converting to fast primitive math

2010-04-13 Thread David Nolen
Recently I've been working on bits of code that require me to type in fairly long sequences of math operations. I found it tedious to convert these to type hinted binary operations so I've created the following truly simplistic macro: http://gist.github.com/364328 It lets you write t

  1   2   >