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@googlegroup

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

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"

Re: Numbers/math in Clojure

2017-06-25 Thread henrik42
ouble, 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 up the corresp

Re: Numbers/math in Clojure

2017-06-24 Thread Alex Miller
ether 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 use them is if you want floatin

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)

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

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)] (fn

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 (e.g.

Boxed math in transducers

2015-09-23 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" grou

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
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. https://gist.github.com/divs1210/b4fcbd48d7697dfd8850#file-maya -- You received this message because you

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 received this message

Re: maya - A DSL for math and numerical stuff

2015-01-08 Thread Mikera
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 clojure@googlegroups.com Note that posts from new

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

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 new members

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 nd])) (set

Re: Composability of Clojure in math-heavy hot loops

2014-04-06 Thread Andy Fingerhut
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 nd])) (set! *warn-on-reflection* true) (defn ^double test1 [a b] (let [^doubles

Re: Composability of Clojure in math-heavy hot loops

2014-04-06 Thread Dmitry Groshev
))) Andy On Sun, Apr 6, 2014 at 9:44 AM, Dmitry Groshev lambda...@gmail.comjavascript: 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. Let's say we have a pretty simple function: (ns testapp.core

Re: Composability of Clojure in math-heavy hot loops

2014-04-06 Thread Gary Trakhman
:44 AM, Dmitry Groshev lambda...@gmail.comwrote: 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

Re: purely functional math renderer

2014-03-16 Thread Jony Hudson
: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). What I find frustrating about existing solutions

Re: purely functional math renderer

2014-03-16 Thread t x
, 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 basic idea is: * my cljs code creates

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 pure clojure math renderer (not just

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

[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 either

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

2013-06-07 Thread Ambrose Bonnaire-Sergeant
-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. But where it does matter, it tends to turn

Re: user math expression evaluation

2013-05-29 Thread Brian Craft
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 expressions like this right now in core.matrix if you don't mind Lisp notation: (use 'clojure.core.matrix) (use

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 x + sin(y), parse and evaluate

Re: user math expression evaluation

2013-05-29 Thread Mikera
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 expressions like this right now in core.matrix if you don't mind Lisp notation: (use 'clojure.core.matrix

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 group. To post

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 craft.br...@gmail.com wrote: Are there any existing libs

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/05/14/infix-math

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 stack.

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 spiderpi...@googlemail.comwrote: You could just write this yourself. It's easier than it looks. First start with an evaluator for rpn (reverse polish notation) expressions.

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 expressions like this right

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

Re: math expression simplifier, kibit implementation

2012-12-02 Thread David Nolen
On Sat, Dec 1, 2012 at 12:24 AM, Jonas jonas.enl...@gmail.com 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)

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 jonas@gmail.com javascript:wrote: * Predicates on logic vars: [(foo (? x number?)) (bar ?x)] = match (foo 42) but not (foo :bar) This is now possible since we have

Re: math expression simplifier, kibit implementation

2012-12-02 Thread David Nolen
On Sun, Dec 2, 2012 at 1:42 PM, Jonas jonas.enl...@gmail.com 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 jonas@gmail.com wrote: * Predicates on logic vars: [(foo (? x number?)) (bar ?x)] = match (foo 42) but not

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

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)

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

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 craft.br...@gmail.com 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

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 help answer questions like

Re: math

2012-10-10 Thread kovas boguta
, and 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 jmg3...@gmail.com wrote: On Tuesday, October 9, 2012 10:38:20 PM UTC-4, Brian Craft wrote: I need some basic math functions, e.g

Re: math

2012-10-10 Thread Michael Klishin
2012/10/11 kovas boguta kovas.bog...@gmail.com 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

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 group. To post

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 craft.br...@gmail.com 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

Re: math

2012-10-09 Thread Devin Walters
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 group. To post to this group

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 7:38 PM, Brian Craft craft.br...@gmail.com 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 kovas boguta
, 2012 at 7:38 PM, Brian Craft craft.br...@gmail.com 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, the old monolithic

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:03 PM, kovas boguta kovas.bog...@gmail.com 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

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 make the new structure

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 Sean Corfield
On Tue, Oct 9, 2012 at 9:22 PM, Brian Craft craft.br...@gmail.com 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

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:23 PM, kovas boguta kovas.bog...@gmail.com 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

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 seancorfi...@gmail.com

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:43 PM, kovas boguta kovas.bog...@gmail.com 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

Re: math

2012-10-09 Thread Mark Engelberg
. The math library hasn't changed. I can't speak to the other libraries. -- 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

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 operations he

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

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 might

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.github.com

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread 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.github.com/clojure-contrib/generic.arithmetic

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread Alan Malloy
!= 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 move Konrad Hinsen's generic math, comparator and arithmetic libraries to new separate 1.3 contrib libs? *http

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 =. There's

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 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 those

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.arithmetic

Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread bOR_
) 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 clojure math library is fastest in general? Is there any wisdom

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

2011-05-03 Thread Alan
On May 3, 12:38 am, bOR_ boris.sch...@gmail.com wrote: user (time (dotimes [i 10] (contribmath-ceil (rand                 Elapsed time: 4500.530303 msecs                                           nil                                                                         user (time

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_ boris.sch...@gmail.com wrote: user (time (dotimes [i 10] (contribmath-ceil (rand Elapsed time: 4500.530303 msecs nil user (time (dotimes [i

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 to clojure@googlegroups.com

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_ boris.sch...@gmail.com 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 operators

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 dnolen.li...@gmail.com wrote: Why not? user (time (dotimes [_ 10] (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 (dotimes [_ 100

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 kwess...@gmail.com 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, maybe not: (do (set! *unchecked-math

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 kwes...@gmail.com wrote: It's optimizing your loop away, or else you're using ridiculously powerful hardware. user= (time (dotimes [_ 100] (Math/ceil (rand Elapsed time

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: math utilities question

2010-12-06 Thread Ken Wesson
On Mon, Dec 6, 2010 at 2:59 AM, Benny Tsai benny.t...@gmail.com wrote: Always nice to see a fellow Neal Stephenson fan! On Dec 5, 10:26 pm, Ken Wesson kwess...@gmail.com wrote: On Mon, Dec 6, 2010 at 12:14 AM, Miki miki.teb...@gmail.com wrote: Have you looked at Incanter?

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 shaz...@gmail.com wrote: On Dec 6, 12:27 am, Robert McIntyre r...@mit.edu wrote: I'm trying to use clojure for scientific

Re: math utilities question

2010-12-06 Thread Johann Hibschman
Robert McIntyre r...@mit.edu 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

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

Re: math utilities question

2010-12-06 Thread Ken Wesson
On Mon, Dec 6, 2010 at 11:45 AM, Konrad Hinsen konrad.hin...@fastmail.net 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

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 is not

Re: math utilities question

2010-12-06 Thread Ken Wesson
On Tue, Dec 7, 2010 at 12:58 AM, Konrad Hinsen konrad.hin...@fastmail.net 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

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 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 Java

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,

Re: math utilities question

2010-12-05 Thread Ken Wesson
On Sun, Dec 5, 2010 at 6:27 PM, Robert McIntyre r...@mit.edu 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:

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

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 r...@mit.edu 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

Re: math utilities question

2010-12-05 Thread Ken Wesson
On Mon, Dec 6, 2010 at 12:14 AM, Miki miki.teb...@gmail.com 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

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 kwess...@gmail.com wrote: On Mon, Dec 6, 2010 at 12:14 AM, Miki miki.teb...@gmail.com wrote: Have you looked at Incanter? (http://incanter.org/) Hmm, interesting. Is there a Rhetor too? -- You received this

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 user= (Math/abs 1/2

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

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 things like

Clojure Math

2009-08-12 Thread Jeff Brown
a clearly defined problem and find the solution. The goal is to have some math fun with Clojure. I found Weiqi's analysis at http://www.weiqigao.com/blog/2009/08/03/jeff_browns_probability_quiz_what_are_the_chances.htmlinteresting. Jeff -- Jeff Brown SpringSource http://www.springsource.com

*math-context*

2009-07-10 Thread John Harrop
It would be useful to have a *math-context* or similar that had a sensible default and could be set with binding to affect bigdec calculations within the temporal scope of said binding. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: *math-context*

2009-07-10 Thread Chouser
On Fri, Jul 10, 2009 at 7:14 AM, John Harropjharrop...@gmail.com wrote: It would be useful to have a *math-context* or similar that had a sensible default and could be set with binding to affect bigdec calculations within the temporal scope of said binding. user= (binding [*math-context

  1   2   >