Re: Digest for numerical-clojure@googlegroups.com - 2 updates in 2 topics

15 views
Skip to first unread message

Jeff Rose

unread,
Jul 23, 2017, 1:48:41 PM7/23/17
to numerica...@googlegroups.com
Ah, sorry Seamus.  Although core.matrix doesn't do the require in cljs, we do still need to set the current implementation in order to automatically use aljabr when creating a matrix. 

app:cljs.user=> (m/new-array [4 5])
[[0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0]]
app:cljs.user=> (type *1)
cljs.core/PersistentVector
app:cljs.user=> (m/set-current-implementation :aljabr)
INFO: No dynamic loading of implementations in Clojurescript.
You must require an implementation explicitly in a namespace, for example thinktopic.aljabr.core
:aljabr
app:cljs.user=> (m/new-array [4 5])
#object[thinktopic.aljabr.core.NDArray2float64]


Alternatively you can always explicitly specify which implementation you want like this:

app:foo.bar=> (m/matrix [1 2])
[1 2]
app:foo.bar=> (m/matrix :aljabr [1 2])
#object[thinktopic.aljabr.core.NDArray1float64]

Cheers,
Jeff



Jeff Rose
CEO / Founder


1050 Walnut st, suite 500
Boulder, Co, USA, 80302


On Sun, Jul 23, 2017 at 7:17 AM, <numerica...@googlegroups.com> wrote:
Seamus O'Keefe <okee...@gmail.com>: Jul 22 12:00PM -0700

Thanks for the great info, Jeff. I switched up the
dependencies/requirements as you demonstrated and things are loading
properly without errors or warnings.
 
This may be my understanding of how aljabr is supposed to work, but when I
run the following
 
(enable-console-print!)
(println (type (m/matrix [[1 2] [3 4]])))
 
the output states that the matrix's type is still a Persistent Vector. It
was my understanding that this is still the default core.matrix
implementation and that aljabr would replace this with a different type
(ndarray, I believe?). Am I mistaken, or is core.matrix still not using
aljabr?
 
On Friday, July 21, 2017 at 4:42:38 PM UTC-4, Jeff Rose wrote:
Mars0i <mars...@logical.net>: Jul 22 05:42AM -0700

Seamus, sorry about that--I forgot that set-current-implementation doesn't
work in Clojurescript. Please see Jeff Rose's response in the next
thread. He certainly knows more than I do.
 
(If you want to use 0.1.2-SNAPSHOT I think you have to get the source by
installing the aljabar git repo locally and then compiling it and
installing the results locally. I haven't done this recently, so I don't
want to give you the wrong advice, so I won't say more, but it's easy to
do.)
 
On Friday, July 21, 2017 at 7:41:35 AM UTC-5, Seamus O'Keefe wrote:
You have received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to numerical-clojure+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages