[julia-users] Re: newest stable version of julia on EC2 AWS instances - starcluster

2016-09-10 Thread Viral Shah
You should use the generic linux tarballs. The ubuntu binaries are no 
longer maintained, which is why they are not listed on the downloads page, 
and instead buried deeper on the platforms page. Perhaps we should remove 
them altogether.

-viral

On Saturday, September 10, 2016 at 5:51:33 AM UTC+5:30, Alexandros Fakos 
wrote:
>
> Hi,
>
> I am trying to run julia in parallel on EC2 AWS. I use the starcluster 
> package to create a cluster of instances.
>
> The problem is that the instances have already installed the 0.3.0 
> prerelease. 
>
> I log in the starcluster master node and use the instructions from 
> http://julialang.org/downloads/platform.html 
>
> sudo add-apt-repository ppa:staticfloat/juliareleases
> sudo add-apt-repository ppa:staticfloat/julia-deps
> sudo apt-get update   (this command is giving me errors: W:Failed to fetch 
> http://us-west-1.ec2.archive.ubuntu.com/ubuntu/distrs/raring etc. and 
> other similar messages)
> sudo apt-get install julia
>
> Unfortunately, when  I type  julia in the terminal the 0.3.0 prerelease 
> comes up. 
>
> Note that in my regular EC2 instance the above commands work and install 
> julia 0.4.6
>
> As a general question, how can I launch instances with the latest stable 
> version of julia preinstalled? If I cannot do that, how can I install the 
> latest version of julia in all my cluster nodes?
>
> Thanks a lot,
> Alex
>


Re: [julia-users] Is there a function to count the number of rows containing a particular value in a column in a 1 column Data Array ?

2016-09-10 Thread Tamas Papp
Perhaps something like

age = rand(24:55, 100)
count(a -> (35 <= a <= 40),  age)

If you are using DataArrays with NA values, you need to account for
that, eg

using DataArrays
age = DataArray(rand(24:55, 100))
age[5:5:100] = NA
count(a -> (!isna(a) && 35 <= a <= 40),  age)

On Sun, Sep 11 2016, Deepti Sabnani wrote:

> I have a single column array of numeric values of age.
> Is there a function in Julia I could use to retrieve the number of rows 
> with a particular numeric value or may be in the range of values?
>
> Thank you.



Re: [julia-users] Want to contribute to Julia

2016-09-10 Thread Tamas Papp
You could submit pull requests for outstanding issues. See

https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md

Note the "intro issue" tags, especially suitable for newbies:

https://github.com/JuliaLang/julia/issues?q=is%3Aissue+is%3Aopen+label%3A%22intro+issue%22

On Sun, Sep 11 2016, rishucoding wrote:

> Hi everyone!
>
> I found Julia interesting and so, I want to contribute to it. I am learning 
> OOP , web development. I have done a course in C language. My mathematics 
> is good. Please suggest in detail, how can I contribute and where and how 
> to start? I haven't contributed anything till now but have a urge to do so. 
> Please give directions. Your help is highly appreciated. 



[julia-users] Julia on Research Computing Podcast RCE

2016-09-10 Thread Brock Palen
I am one half of the HPC/Research Computing podcast http://www.rce-cast.com/

We would like to feature Julia on the show.  This takes a developer or two 
and is a friendly interview, takes about an hour over the phone or skype 
and aims to educate our community.

Feel free to contact me off list.

Thank you !

Brock Palen



[julia-users] Want to contribute to Julia

2016-09-10 Thread rishucoding


Hi everyone!

I found Julia interesting and so, I want to contribute to it. I am learning 
OOP , web development. I have done a course in C language. My mathematics 
is good. Please suggest in detail, how can I contribute and where and how 
to start? I haven't contributed anything till now but have a urge to do so. 
Please give directions. Your help is highly appreciated. 


[julia-users] Is there a function to count the number of rows containing a particular value in a column in a 1 column Data Array ?

2016-09-10 Thread Deepti Sabnani
I have a single column array of numeric values of age.
Is there a function in Julia I could use to retrieve the number of rows 
with a particular numeric value or may be in the range of values?

Thank you.


Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread K leo
Thanks for clearing.  I see that I used wrong word, "clear" instead of 
"collect".  Then can I rephrase my questions below:

On Sunday, September 11, 2016 at 9:31:35 AM UTC+8, Yichao Yu wrote:
>
>
>
> On Sat, Sep 10, 2016 at 8:00 PM, K leo  
> wrote:
>
>>
>>
>> On Sunday, September 11, 2016 at 7:35:41 AM UTC+8, Yichao Yu wrote:
>>>
>>>
>>>
>>> On Sat, Sep 10, 2016 at 6:46 PM, K leo  wrote:
>>>
 Thanks for the reply.  A couple questions: 

>>>
 1) When I quit Julia and do a fresh start, is the tally set to zero?

>>>
>>> Memory in different processes are totally unrelated.
>>>
>> So when I start a new Julia process, the tally starts at zero?
>>
>
> The GC uses a number of counters to decide when to do a collection. They 
> are maintained differently and "start at zero" is almost a meaningless. 
> They are independent and almost start in the same state.
>  
>
>>  
>>
>>>  
>>>
 2) When GC does a pass, does it clear out everything so the tally is 
 set to zero, or does it do a partial clearance?

>>>
>>> Neither
>>>
>> How can it be neither?  What can be a third choice with this question?
>>
>
> Nothing is cleared. Dead objects are collected to be reused later without 
> clearing.
>  
>
 
When GC does a pass, does it collect everything so the tally is set to 
zero, or does it do a partial collection?
 

>  
>>
>>>  
>>>
 3) I presume it is the latter case in question 2).  So does GC clear 
 out things on first-in-first-out bases or what?

>>>
>>> Not applicable.
>>>
>>
I presume it is the latter case in question 2).  So does GC collect things 
on first-in-first-out bases or what?
 

>  
>>>
 4) When the tally becomes big enough, does GC make sure to keep objects 
 that are referenced for future use in (Julia) code?

>>>
>>> See the link below
>>>  
>>>
 5) Do local objects (things allocated and only used within functions 
 for instance) get cleared out immediately when the functions terminate so 
 they don't take up quota in the tally?


>>> No
>>>
>> Or perhaps those local objects have higher priorities of getting cleared 
>> out?
>>
>
> No.
>

 Do local objects (things allocated and only used within functions for 
instance) get collected immediately when the functions terminate so they 
don't take up quota in the tally?  Or perhaps those local objects have 
higher priorities of getting collected?

 
>
>>  
>>
>>>  
>>>
>>>
>>> Please check https://en.wikipedia.org/wiki/Tracing_garbage_collection 
>>> for basic concepts related to garbage collection.
>>>
>>>  
>>>



Re: [julia-users] Is JL_GC_PUSH not allowed to be nested?

2016-09-10 Thread K leo
Then how do we protect different objects that get allocated at different 
points in code?

On Sunday, September 11, 2016 at 9:33:00 AM UTC+8, Yichao Yu wrote:
>
>
>
> No, there can only be one `JL_GC_PUSH` in a C scope (and the corresponding 
> `JL_GC_POP` must happen before the program exit from the scope)
>  
>
>>
>>

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 8:41 PM, K leo  wrote:

> Hi Bart,
>
> Do you think "jl_A" should also be rooted as it is later used as the
> argument?
>

Yes. When you use it.


>
> On Saturday, September 10, 2016 at 3:38:27 AM UTC+8, Bart Janssens wrote:
>>
>>
>>
>> On Fri, Sep 9, 2016 at 6:44 PM Isaiah Norton  wrote:
>>
>>>// construct a TestType instance
>>>
>>> jl_value_t* jl_A = jl_new_struct((jl_datatype_t*)
>>> jl_get_function((jl_module_t*)mod, "TestType"),
>>>  jl_box_float64(A.a),
>>> jl_box_float64(A.b));
>>>
>>>
>> The arguments to jl_new_struct need to be rooted, so you should do
>> something like:
>> jl_value_t* a = NULL;
>> jl_value_t* b = NULL;
>> JL_GC_PUSH2(a,b);
>> a = jl_box_float64(A.a);
>> b = jl_box_float64(A.b);
>> // use a and b in the new struct call
>> JL_GC_POP();
>>
>> What is the objective here? If this is still to be used from C++, there
>> may be easier ways using Cxx.jl or CxxWrap.jl.
>>
>> Cheers,
>>
>> Bart
>>
>


Re: [julia-users] Is JL_GC_PUSH not allowed to be nested?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 8:37 PM, K leo  wrote:

> I tried to nest the GC pairs (JL_GC_PUSH, JL_GC_POP), but got some compile
> errors regarding julia.h.
>
> In file included from test6.cpp:11:0:
>> test6.cpp: In function ‘int main(int, char**)’:
>> /home/xxx/Software/julia-9c76c3e89a/include/julia/julia.h:609:19: error:
>> redeclaration of ‘void* __gc_stkf []’
>>void *__gc_stkf[] = {(void*)3, jl_pgcstack, arg1};
>>  \
>>^
>> test6.cpp:44:5: note: in expansion of macro ‘JL_GC_PUSH1’
>>  JL_GC_PUSH1();
>>  ^
>> /home/xxx/Software/julia-9c76c3e89a/include/julia/julia.h:613:9: note:
>> ‘void* __gc_stkf [4]’ previously declared here
>>void *__gc_stkf[] = {(void*)5, jl_pgcstack, arg1, arg2};
>>  \
>>  ^
>> test6.cpp:35:5: note: in expansion of macro ‘JL_GC_PUSH2’
>>  JL_GC_PUSH2(,);
>
>
> So is nesting them not allowed, or is it a bug in julia.h?
>

No, there can only be one `JL_GC_PUSH` in a C scope (and the corresponding
`JL_GC_POP` must happen before the program exit from the scope)


>
> My test C++ code is here:
>
> #include 
> #include 
> #include 
> using namespace std;
> #include 
> #include 
> using namespace std;
> struct TestType {
> double a;
> double b;
> };
> int main(int argc, char *argv[])
> {
> TestType A, *ret;
> A.a=2.;
> A.b=3.;
> jl_init(NULL);
> jl_load("TestArg.jl");
> jl_value_t * mod = (jl_value_t*)jl_eval_string("TestArg");
> jl_value_t* a=NULL;
> jl_value_t* b=NULL;
> JL_GC_PUSH2(,);
> a = jl_box_float64(A.a);
> b = jl_box_float64(A.b);
> jl_value_t* jl_A = jl_new_struct((jl_datatype_t*)
> jl_get_function((jl_module_t*)mod, "TestType"), a, b);
>// construct a TestType instance
> jl_function_t * func = jl_get_function((jl_module_t*)mod,"TestFunc");
> ret = (TestType*) jl_call1(func, jl_A);
> JL_GC_PUSH1();
> cout JL_GC_POP();
> JL_GC_POP();
> jl_atexit_hook(0);
> return 0;
> }
>
>
>


Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 8:00 PM, K leo  wrote:

>
>
> On Sunday, September 11, 2016 at 7:35:41 AM UTC+8, Yichao Yu wrote:
>>
>>
>>
>> On Sat, Sep 10, 2016 at 6:46 PM, K leo  wrote:
>>
>>> Thanks for the reply.  A couple questions:
>>>
>>
>>> 1) When I quit Julia and do a fresh start, is the tally set to zero?
>>>
>>
>> Memory in different processes are totally unrelated.
>>
> So when I start a new Julia process, the tally starts at zero?
>

The GC uses a number of counters to decide when to do a collection. They
are maintained differently and "start at zero" is almost a meaningless.
They are independent and almost start in the same state.


>
>
>>
>>
>>> 2) When GC does a pass, does it clear out everything so the tally is set
>>> to zero, or does it do a partial clearance?
>>>
>>
>> Neither
>>
> How can it be neither?  What can be a third choice with this question?
>

Nothing is cleared. Dead objects are collected to be reused later without
clearing.


>
>
>>
>>
>>> 3) I presume it is the latter case in question 2).  So does GC clear out
>>> things on first-in-first-out bases or what?
>>>
>>
>> Not applicable.
>>
>>
>>> 4) When the tally becomes big enough, does GC make sure to keep objects
>>> that are referenced for future use in (Julia) code?
>>>
>>
>> See the link below
>>
>>
>>> 5) Do local objects (things allocated and only used within functions for
>>> instance) get cleared out immediately when the functions terminate so they
>>> don't take up quota in the tally?
>>>
>>>
>> No
>>
> Or perhaps those local objects have higher priorities of getting cleared
> out?
>

No.


>
>
>>
>>
>>
>> Please check https://en.wikipedia.org/wiki/Tracing_garbage_collection
>> for basic concepts related to garbage collection.
>>
>>
>>
>>>
>>> On Sunday, September 11, 2016 at 12:16:05 AM UTC+8, Tim Holy wrote:

 Every time julia allocates memory, it adds the number of bytes to a
 running tally; once that tally gets big enough, it does a
 garbage-collection pass (and resets the tally). Consequently GC is
 triggered only when you allocate, but even the smallest allocation can
 trigger GC if it pushes the tally over the threshold. It thus depends on
 where that tally was when you started. Keep in mind that there are many
 uses of memory that may not be obvious; for example, JIT compilation uses
 memory because julia code is compiled by julia code.



 Best,

 --Tim



 On Saturday, September 10, 2016 7:05:18 AM CDT K leo wrote:

 > Let's say in REPL you define an object, then after many many other

 > operations, Julia's GC wouldn't free the object you defined earlier
 until

 > you exit Julia or you somehow really run out of memory or something.
 Is

 > that the correct understanding?

 >

 > Now I am trying to think what happens with the jl_... calls one
 performs

 > from C/C++ code. The procedure is that one calls jl_init first to
 start a

 > Julia session, then a bunch other jl_... calls to handle some data,
 and

 > then at last jl_atexit_hook to stop using Julia. Is the mechanism here

 > similar to REPL in the sense that the Julia session is up and running

 > before one calls jl_atexit_hook? So Julia GC would not free objects
 you

 > created with jl_... calls until you exit or you somehow really run
 out of

 > memory or something.

 >

 > Having read the section in Embedding Julia, I get the sense that it
 is the

 > case. So we only need to worry about GC after all jl_... calls, not in

 >

 > between jl_... calls. So here it says :

 > > “However, it is generally safe to use pointers in between jl_...
 calls.

 > >

 > >> But in order to make sure that values can survive jl_... calls, we
 have

 > >> to

 > >> tell Julia that we hold a reference to a Julia value. ”

 > >

 > > Excerpt From: unknown. “Julia Language 0.6.0-dev documentation.”
 iBooks.

 > >

 > > Is my understanding correct? Or can anyone please explain otherwise?





>>>
>>


[julia-users] Re: Error in call to eigs--0 index in arpack wrapper

2016-09-10 Thread Ralph Smith
`ipntr` is modified by the call to `[ns]aupd`, normally to make a sane 
index set (the line you quote is there to initialize memory).  I find that 
the example using `eigs()` at the bottom of the LinearMap README still 
works, and have not encountered trouble in other use of Arpack under Julia. 
Can you provide more specifics of the case where you had trouble?

On Saturday, September 10, 2016 at 7:08:43 PM UTC-4, Steven White wrote:
>
> I am calling eigs and I am getting an out of bounds, which looks like an 
> obvious mistake in the Arpack wrapper.  
>
> calling eigs
>
> ERROR: LoadError: LoadError: BoundsError: attempt to access 2169-element 
> Array{Float64,1}:
>
>0.0 
>
>
>   at index [0:722]
>
>  in throw_boundserror at abstractarray.jl:156
>
>  in getindex at array.jl:289
>
>  in aupd_wrapper at linalg/arpack.jl:55
>
>  in _eigs at linalg/arnoldi.jl:228
>
>
> In the file arpack.jl I see line 55 is:
>
>
> x = workd[load_idx]
>
>
> Before that, load_idx is defined with:
>
> zernm1 = 0:(n-1)
>
> ...
>
> ipntr  = zeros(BlasInt, (sym && !cmplx) ? 11 : 14)
>
> ...
>
> load_idx = ipntr[1]+zernm1
>
>
> and workd was previously initialized with:
>
> workd  = Array(T, 3*n)
>
>
> So it looks like an attempt to get a section of an array with index
>
> starting at zero???
>
>
> This is on a Mac, Julia version 0.4.6, in the directory:
>
>
> /Applications/Julia-0.4.6.app/Contents/Resources/julia/share/julia/base/linalg
>
>
> If it matters, I was calling eigs with a LinearMap object (Package 
> LinearMaps)
>


Re: [julia-users] Re: ProfileView not compatible with julia-0.5?

2016-09-10 Thread Chris Rackauckas
Is this after updating? Do you also have an error when you do it from the 
REPL?

On Saturday, September 10, 2016 at 2:34:03 PM UTC-7, Christoph Ortner wrote:
>
> And here the error message I get in a notebook:
>
> type Array has no field func
>
>  in 
> (::ProfileView.#printrec#26{Dict{UInt64,Array{StackFrame,1}}})(::IOContext{Base.AbstractIOBuffer{Array{UInt8,1}}},
>  ::Int64, ::Float64, ::Float64, ::Float64, ::ProfileView.TagData, 
> ::ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}}) at 
> /Users/ortner/.julia/v0.5/ProfileView/src/ProfileView.jl:213
>  in show(::IOContext{Base.AbstractIOBuffer{Array{UInt8,1}}}, 
> ::MIME{Symbol("image/svg+xml")}, ::ProfileView.ProfileData) at 
> /Users/ortner/.julia/v0.5/ProfileView/src/ProfileView.jl:255
>  in verbose_show(::Base.AbstractIOBuffer{Array{UInt8,1}}, 
> ::MIME{Symbol("image/svg+xml")}, ::ProfileView.ProfileData) at 
> ./multimedia.jl:50
>  in #sprint#304(::Void, ::Function, ::Int64, ::Function, 
> ::MIME{Symbol("image/svg+xml")}, ::Vararg{Any,N}) at ./strings/io.jl:37
>  in display_dict(::ProfileView.ProfileData) at 
> /Users/ortner/.julia/v0.5/IJulia/src/execute_request.jl:28
>  in execute_request(::ZMQ.Socket, ::IJulia.Msg) at 
> /Users/ortner/.julia/v0.5/IJulia/src/execute_request.jl:195
>  in eventloop(::ZMQ.Socket) at 
> /Users/ortner/.julia/v0.5/IJulia/src/IJulia.jl:138
>  in (::IJulia.##25#31)() at ./task.jl:360
>
>
> In [ ]:
>


[julia-users] Re: Cannot start Julia in Atom

2016-09-10 Thread Chris Rackauckas
Yeah it should be all good now. The latest release was untagged.

On Saturday, September 10, 2016 at 10:15:59 AM UTC-7, Uwe Fechner wrote:
>
> I uninstalled julia-client and reinstalled it from within Atom as 
> suggested by rogerwhitney.
> (
> http://discuss.junolab.org/t/start-julia-error-loading-atom-jl-package/853/2) 
> This fixed it for me.
>
> On Saturday, September 10, 2016 at 9:39:39 AM UTC+2, Chris Rackauckas 
> wrote:
>>
>> The context is important: 
>> http://stackoverflow.com/questions/39419502/cannot-start-julia-in-atom-loaderror-argumenterror-juno-not-found-in-path/39420874#39420874
>>
>> Or the bottom of this: 
>> https://gitter.im/JunoLab/atom-ink/archives/2016/09/09
>>
>> It's known. It's a bad tag. Either just clone Juno.jl or wait for the tag.
>>
>> On Friday, September 9, 2016 at 8:13:05 PM UTC-7, Yuanchu Dang wrote:
>>>
>>> ERROR: LoadError: ArgumentError: Juno not found in path
>>>  in require at loading.jl:249
>>>  in include at boot.jl:261
>>>  in include_from_node1 at loading.jl:320
>>>  in process_options at client.jl:280
>>>  in _start at client.jl:378
>>> while loading C:\Users\think\.atom\packages\julia-client\script\boot.jl, 
>>> in expression starting on line 36
>>>
>>

[julia-users] Re: Preferred MIME type for Julia

2016-09-10 Thread Steven G. Johnson
Maybe.

But the more I read about this the less consistent IANA seems to be on this 
issue, and the more inclined I am to say that one should just use text/julia


Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread K leo
Hi Bart,

These are meant to call Julia code from C++.  You mentioned "there may be 
easier ways using Cxx.jl or CxxWrap.jl".  Are the two packages only for 
calling C/C++ from Julia, and not the otherway around?  Am I missing 
something?

On Saturday, September 10, 2016 at 3:38:27 AM UTC+8, Bart Janssens wrote:
>
>
>
> On Fri, Sep 9, 2016 at 6:44 PM Isaiah Norton  > wrote:
>
>>// construct a TestType instance
>>
>> jl_value_t* jl_A = 
>> jl_new_struct((jl_datatype_t*)jl_get_function((jl_module_t*)mod, 
>> "TestType"),
>>  jl_box_float64(A.a), 
>> jl_box_float64(A.b));
>>
>>
> The arguments to jl_new_struct need to be rooted, so you should do 
> something like:
> jl_value_t* a = NULL;
> jl_value_t* b = NULL;
> JL_GC_PUSH2(a,b);
> a = jl_box_float64(A.a);
> b = jl_box_float64(A.b);
> // use a and b in the new struct call
> JL_GC_POP();
>
> What is the objective here? If this is still to be used from C++, there 
> may be easier ways using Cxx.jl or CxxWrap.jl.
>
> Cheers,
>
> Bart
>


Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread K leo
Hi Bart,

Do you think "jl_A" should also be rooted as it is later used as the 
argument?

On Saturday, September 10, 2016 at 3:38:27 AM UTC+8, Bart Janssens wrote:
>
>
>
> On Fri, Sep 9, 2016 at 6:44 PM Isaiah Norton  > wrote:
>
>>// construct a TestType instance
>>
>> jl_value_t* jl_A = 
>> jl_new_struct((jl_datatype_t*)jl_get_function((jl_module_t*)mod, 
>> "TestType"),
>>  jl_box_float64(A.a), 
>> jl_box_float64(A.b));
>>
>>
> The arguments to jl_new_struct need to be rooted, so you should do 
> something like:
> jl_value_t* a = NULL;
> jl_value_t* b = NULL;
> JL_GC_PUSH2(a,b);
> a = jl_box_float64(A.a);
> b = jl_box_float64(A.b);
> // use a and b in the new struct call
> JL_GC_POP();
>
> What is the objective here? If this is still to be used from C++, there 
> may be easier ways using Cxx.jl or CxxWrap.jl.
>
> Cheers,
>
> Bart
>


[julia-users] Is JL_GC_PUSH not allowed to be nested?

2016-09-10 Thread K leo
I tried to nest the GC pairs (JL_GC_PUSH, JL_GC_POP), but got some compile 
errors regarding julia.h.

In file included from test6.cpp:11:0:
> test6.cpp: In function ‘int main(int, char**)’:
> /home/xxx/Software/julia-9c76c3e89a/include/julia/julia.h:609:19: error: 
> redeclaration of ‘void* __gc_stkf []’
>void *__gc_stkf[] = {(void*)3, jl_pgcstack, arg1}; 
>  \
>^
> test6.cpp:44:5: note: in expansion of macro ‘JL_GC_PUSH1’
>  JL_GC_PUSH1();
>  ^
> /home/xxx/Software/julia-9c76c3e89a/include/julia/julia.h:613:9: note: 
> ‘void* __gc_stkf [4]’ previously declared here
>void *__gc_stkf[] = {(void*)5, jl_pgcstack, arg1, arg2};   
>  \
>  ^
> test6.cpp:35:5: note: in expansion of macro ‘JL_GC_PUSH2’
>  JL_GC_PUSH2(,);


So is nesting them not allowed, or is it a bug in julia.h?

My test C++ code is here:

#include 
#include 
#include 
using namespace std;
#include 
#include 
using namespace std;
struct TestType {
double a;
double b;
};
int main(int argc, char *argv[])
{
TestType A, *ret;
A.a=2.;
A.b=3.;
jl_init(NULL);
jl_load("TestArg.jl");
jl_value_t * mod = (jl_value_t*)jl_eval_string("TestArg");
jl_value_t* a=NULL;
jl_value_t* b=NULL;
JL_GC_PUSH2(,);
a = jl_box_float64(A.a);
b = jl_box_float64(A.b);
jl_value_t* jl_A = 
jl_new_struct((jl_datatype_t*)jl_get_function((jl_module_t*)mod, 
"TestType"), a, b);
   // construct a TestType instance
jl_function_t * func = jl_get_function((jl_module_t*)mod,"TestFunc");
ret = (TestType*) jl_call1(func, jl_A);
JL_GC_PUSH1();
cout

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread K leo


On Sunday, September 11, 2016 at 7:35:41 AM UTC+8, Yichao Yu wrote:
>
>
>
> On Sat, Sep 10, 2016 at 6:46 PM, K leo  
> wrote:
>
>> Thanks for the reply.  A couple questions: 
>>
>
>> 1) When I quit Julia and do a fresh start, is the tally set to zero?
>>
>
> Memory in different processes are totally unrelated.
>
So when I start a new Julia process, the tally starts at zero?
 

>  
>
>> 2) When GC does a pass, does it clear out everything so the tally is set 
>> to zero, or does it do a partial clearance?
>>
>
> Neither
>
How can it be neither?  What can be a third choice with this question?
 

>  
>
>> 3) I presume it is the latter case in question 2).  So does GC clear out 
>> things on first-in-first-out bases or what?
>>
>
> Not applicable.
>  
>
>> 4) When the tally becomes big enough, does GC make sure to keep objects 
>> that are referenced for future use in (Julia) code?
>>
>
> See the link below
>  
>
>> 5) Do local objects (things allocated and only used within functions for 
>> instance) get cleared out immediately when the functions terminate so they 
>> don't take up quota in the tally?
>>
>>
> No
>
Or perhaps those local objects have higher priorities of getting cleared 
out?
 

>  
>
>
> Please check https://en.wikipedia.org/wiki/Tracing_garbage_collection for 
> basic concepts related to garbage collection.
>
>  
>
>>
>> On Sunday, September 11, 2016 at 12:16:05 AM UTC+8, Tim Holy wrote:
>>>
>>> Every time julia allocates memory, it adds the number of bytes to a 
>>> running tally; once that tally gets big enough, it does a 
>>> garbage-collection pass (and resets the tally). Consequently GC is 
>>> triggered only when you allocate, but even the smallest allocation can 
>>> trigger GC if it pushes the tally over the threshold. It thus depends on 
>>> where that tally was when you started. Keep in mind that there are many 
>>> uses of memory that may not be obvious; for example, JIT compilation uses 
>>> memory because julia code is compiled by julia code.
>>>
>>>  
>>>
>>> Best,
>>>
>>> --Tim
>>>
>>>  
>>>
>>> On Saturday, September 10, 2016 7:05:18 AM CDT K leo wrote:
>>>
>>> > Let's say in REPL you define an object, then after many many other
>>>
>>> > operations, Julia's GC wouldn't free the object you defined earlier 
>>> until
>>>
>>> > you exit Julia or you somehow really run out of memory or something. Is
>>>
>>> > that the correct understanding?
>>>
>>> > 
>>>
>>> > Now I am trying to think what happens with the jl_... calls one 
>>> performs
>>>
>>> > from C/C++ code. The procedure is that one calls jl_init first to 
>>> start a
>>>
>>> > Julia session, then a bunch other jl_... calls to handle some data, and
>>>
>>> > then at last jl_atexit_hook to stop using Julia. Is the mechanism here
>>>
>>> > similar to REPL in the sense that the Julia session is up and running
>>>
>>> > before one calls jl_atexit_hook? So Julia GC would not free objects you
>>>
>>> > created with jl_... calls until you exit or you somehow really run out 
>>> of
>>>
>>> > memory or something.
>>>
>>> > 
>>>
>>> > Having read the section in Embedding Julia, I get the sense that it is 
>>> the
>>>
>>> > case. So we only need to worry about GC after all jl_... calls, not in
>>>
>>> > 
>>>
>>> > between jl_... calls. So here it says :
>>>
>>> > > “However, it is generally safe to use pointers in between jl_... 
>>> calls.
>>>
>>> > > 
>>>
>>> > >> But in order to make sure that values can survive jl_... calls, we 
>>> have
>>>
>>> > >> to
>>>
>>> > >> tell Julia that we hold a reference to a Julia value. ”
>>>
>>> > > 
>>>
>>> > > Excerpt From: unknown. “Julia Language 0.6.0-dev documentation.” 
>>> iBooks.
>>>
>>> > > 
>>>
>>> > > Is my understanding correct? Or can anyone please explain otherwise?
>>>
>>>  
>>>
>>>  
>>>
>>
>

[julia-users] Re: Preferred MIME type for Julia

2016-09-10 Thread Fengyang Wang
Should application/julia perhaps be recognized as a text MIME, then?

julia> istextmime("application/julia")
false

julia> istextmime("application/javascript")
true

A PR making this change: https://github.com/JuliaLang/julia/pull/18441


Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 6:46 PM, K leo  wrote:

> Thanks for the reply.  A couple questions:
>

> 1) When I quit Julia and do a fresh start, is the tally set to zero?
>

Memory in different processes are totally unrelated.


> 2) When GC does a pass, does it clear out everything so the tally is set
> to zero, or does it do a partial clearance?
>

Neither


> 3) I presume it is the latter case in question 2).  So does GC clear out
> things on first-in-first-out bases or what?
>

Not applicable.


> 4) When the tally becomes big enough, does GC make sure to keep objects
> that are referenced for future use in (Julia) code?
>

See the link below


> 5) Do local objects (things allocated and only used within functions for
> instance) get cleared out immediately when the functions terminate so they
> don't take up quota in the tally?
>
>
No



Please check https://en.wikipedia.org/wiki/Tracing_garbage_collection for
basic concepts related to garbage collection.



>
> On Sunday, September 11, 2016 at 12:16:05 AM UTC+8, Tim Holy wrote:
>>
>> Every time julia allocates memory, it adds the number of bytes to a
>> running tally; once that tally gets big enough, it does a
>> garbage-collection pass (and resets the tally). Consequently GC is
>> triggered only when you allocate, but even the smallest allocation can
>> trigger GC if it pushes the tally over the threshold. It thus depends on
>> where that tally was when you started. Keep in mind that there are many
>> uses of memory that may not be obvious; for example, JIT compilation uses
>> memory because julia code is compiled by julia code.
>>
>>
>>
>> Best,
>>
>> --Tim
>>
>>
>>
>> On Saturday, September 10, 2016 7:05:18 AM CDT K leo wrote:
>>
>> > Let's say in REPL you define an object, then after many many other
>>
>> > operations, Julia's GC wouldn't free the object you defined earlier
>> until
>>
>> > you exit Julia or you somehow really run out of memory or something. Is
>>
>> > that the correct understanding?
>>
>> >
>>
>> > Now I am trying to think what happens with the jl_... calls one performs
>>
>> > from C/C++ code. The procedure is that one calls jl_init first to start
>> a
>>
>> > Julia session, then a bunch other jl_... calls to handle some data, and
>>
>> > then at last jl_atexit_hook to stop using Julia. Is the mechanism here
>>
>> > similar to REPL in the sense that the Julia session is up and running
>>
>> > before one calls jl_atexit_hook? So Julia GC would not free objects you
>>
>> > created with jl_... calls until you exit or you somehow really run out
>> of
>>
>> > memory or something.
>>
>> >
>>
>> > Having read the section in Embedding Julia, I get the sense that it is
>> the
>>
>> > case. So we only need to worry about GC after all jl_... calls, not in
>>
>> >
>>
>> > between jl_... calls. So here it says :
>>
>> > > “However, it is generally safe to use pointers in between jl_...
>> calls.
>>
>> > >
>>
>> > >> But in order to make sure that values can survive jl_... calls, we
>> have
>>
>> > >> to
>>
>> > >> tell Julia that we hold a reference to a Julia value. ”
>>
>> > >
>>
>> > > Excerpt From: unknown. “Julia Language 0.6.0-dev documentation.”
>> iBooks.
>>
>> > >
>>
>> > > Is my understanding correct? Or can anyone please explain otherwise?
>>
>>
>>
>>
>>
>


Re: Orientation? was: Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Tracy Wadleigh
+10**10**10

On Sep 10, 2016 3:32 PM, "Steven G. Johnson"  wrote:
>
>
>
> On Saturday, September 10, 2016 at 12:20:25 PM UTC-4, Stuart Brorson
wrote:
>>
>> However, from a physics perspective, this bugs me.  In physics, an
>> important feature of a space is its orientation.
>
>
> I should also remind you that a lot of modern physics tries to separate
the laws of physics from particular choices of basis or coordinate system.
 (Think of differential geometry in relativity or Dirac notation in quantum
mechanics.)Similarly, if you have an expression that depends on the
precise choice of basis for the eigenvectors of a matrix, it is likely that
you have made a mistake, or at the very least you have to be very careful.
>
> (Yes, the matrix of eigenvectors of a real-symmetric problem can be
chosen orthonormal, with determinant ±1, and of course it is possible to
choose the eigenvectors so that the determinant is +1, but this still does
not uniquely determine the eigenvectors: in an NxN orthonormal matrix,
there are 2^(N-1) choices of signs that lead to the same sign of the
determinant.  And if some eigenvalues have multiplicity > 1 you have even
more choices.)
>
> In short, don't get hung up on this.


Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread colintbowers
This question pops up on StackOverflow fairly frequently, although usually 
in relation to Mathematica, which uses a totally different normalisation to 
most other languages. I was surprised by your question actually, since I 
thought Matlab and Julia used *exactly* the same normalisation, but 
obviously there are some minor differences in the algorithm. Anyway, here 
is a link to a StackOverflow question if you want to read about possible 
normalisations a little further:

https://stackoverflow.com/questions/13041178/could-we-get-different-solutions-for-eigenvectors-from-a-matrix

Cheers,

Colin

On Sunday, 11 September 2016 01:11:46 UTC+10, Dennis Eckmeier wrote:
>
> Hi!
>
> Here is a simple example:
>
> *Matlab:*
> (all types are double)
>  covX(1:4,1:4)
>
>   1.0e+006 *
>
> 3.86263.41572.40491.2403
> 3.41573.73753.33952.3899
> 2.40493.33953.73723.4033
> 1.24032.38993.40333.8548
>
> [V,D] = eig(covX(1:4,1:4))
>
> V =
>
> 0.25830.5402   -0.65760.4571
>-0.6622   -0.4518   -0.25570.5404
> 0.6565   -0.46040.25520.5403
>-0.25250.54040.66110.4551
>
>
> D =
>
>   1.0e+007 *
>
> 0.0006 0 0 0
>  00.0197 0 0
>  0 00.3010 0
>  0 0 01.1978
>
>
>
> *Julia:*
> (all types are Float 64)
> *D = *
> *5759.7016...*
> *197430.4962...*
> *3.0104794 ... e6*
> *1.1978 ... e7*
>
> V =
>0.25830.5402-0.6576 *-0.4571*
>-0.6622   -0.4518   -0.2557*-0.5404*
> 0.6565   -0.46040.2552*-0.5403*
>-0.25250.54040.6611*-0.4551*
>
> cheers,
>
> D
>
>
> On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon 
> wrote:
>>
>> You mean they are not simply permuted? Can you report the MATLAB and 
>> Julia results in the two cases for a small covX matrix?
>>
>> On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier <
>> dennis@neuro.fchampalimaud.org> wrote:
>>
>>> Hi,
>>>
>>> I am new to Julia and rather lay in math. For practice, I am translating 
>>> a Matlab script (written by somebody else) and compare the result of each 
>>> step in Matlab and Julia.
>>>
>>> The Matlab script uses  [V,D] = eig(covX);
>>>
>>> which I translated to Julia as: (D,V) = eig(covX)
>>>
>>> However, the outcomes don't match, although covX is the same.
>>>
>>> D.
>>>
>>>
>>>
>>

[julia-users] Error in call to eigs--0 index in arpack wrapper

2016-09-10 Thread Steven White
I am calling eigs and I am getting an out of bounds, which looks like an 
obvious mistake in the Arpack wrapper.  

calling eigs

ERROR: LoadError: LoadError: BoundsError: attempt to access 2169-element 
Array{Float64,1}:

   0.0 


  at index [0:722]

 in throw_boundserror at abstractarray.jl:156

 in getindex at array.jl:289

 in aupd_wrapper at linalg/arpack.jl:55

 in _eigs at linalg/arnoldi.jl:228


In the file arpack.jl I see line 55 is:


x = workd[load_idx]


Before that, load_idx is defined with:

zernm1 = 0:(n-1)

...

ipntr  = zeros(BlasInt, (sym && !cmplx) ? 11 : 14)

...

load_idx = ipntr[1]+zernm1


and workd was previously initialized with:

workd  = Array(T, 3*n)


So it looks like an attempt to get a section of an array with index

starting at zero???


This is on a Mac, Julia version 0.4.6, in the directory:

/Applications/Julia-0.4.6.app/Contents/Resources/julia/share/julia/base/linalg


If it matters, I was calling eigs with a LinearMap object (Package 
LinearMaps)


Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread K leo
Thanks for the reply.  A couple questions:

1) When I quit Julia and do a fresh start, is the tally set to zero?
2) When GC does a pass, does it clear out everything so the tally is set to 
zero, or does it do a partial clearance?
3) I presume it is the latter case in question 2).  So does GC clear out 
things on first-in-first-out bases or what?
4) When the tally becomes big enough, does GC make sure to keep objects 
that are referenced for future use in (Julia) code?
5) Do local objects (things allocated and only used within functions for 
instance) get cleared out immediately when the functions terminate so they 
don't take up quota in the tally?

On Sunday, September 11, 2016 at 12:16:05 AM UTC+8, Tim Holy wrote:
>
> Every time julia allocates memory, it adds the number of bytes to a 
> running tally; once that tally gets big enough, it does a 
> garbage-collection pass (and resets the tally). Consequently GC is 
> triggered only when you allocate, but even the smallest allocation can 
> trigger GC if it pushes the tally over the threshold. It thus depends on 
> where that tally was when you started. Keep in mind that there are many 
> uses of memory that may not be obvious; for example, JIT compilation uses 
> memory because julia code is compiled by julia code.
>
>  
>
> Best,
>
> --Tim
>
>  
>
> On Saturday, September 10, 2016 7:05:18 AM CDT K leo wrote:
>
> > Let's say in REPL you define an object, then after many many other
>
> > operations, Julia's GC wouldn't free the object you defined earlier until
>
> > you exit Julia or you somehow really run out of memory or something. Is
>
> > that the correct understanding?
>
> > 
>
> > Now I am trying to think what happens with the jl_... calls one performs
>
> > from C/C++ code. The procedure is that one calls jl_init first to start a
>
> > Julia session, then a bunch other jl_... calls to handle some data, and
>
> > then at last jl_atexit_hook to stop using Julia. Is the mechanism here
>
> > similar to REPL in the sense that the Julia session is up and running
>
> > before one calls jl_atexit_hook? So Julia GC would not free objects you
>
> > created with jl_... calls until you exit or you somehow really run out of
>
> > memory or something.
>
> > 
>
> > Having read the section in Embedding Julia, I get the sense that it is 
> the
>
> > case. So we only need to worry about GC after all jl_... calls, not in
>
> > 
>
> > between jl_... calls. So here it says :
>
> > > “However, it is generally safe to use pointers in between jl_... calls.
>
> > > 
>
> > >> But in order to make sure that values can survive jl_... calls, we 
> have
>
> > >> to
>
> > >> tell Julia that we hold a reference to a Julia value. ”
>
> > > 
>
> > > Excerpt From: unknown. “Julia Language 0.6.0-dev documentation.” 
> iBooks.
>
> > > 
>
> > > Is my understanding correct? Or can anyone please explain otherwise?
>
>  
>
>  
>


Re: Orientation? was: Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Steven G. Johnson


On Saturday, September 10, 2016 at 12:20:25 PM UTC-4, Stuart Brorson wrote:
>
> However, from a physics perspective, this bugs me.  In physics, an 
> important feature of a space is its orientation.


I should also remind you that a lot of modern physics tries to separate the 
laws of physics from particular choices of basis or coordinate system. 
 (Think of differential geometry in relativity or Dirac notation in quantum 
mechanics.)Similarly, if you have an expression that depends on the 
precise choice of basis for the eigenvectors of a matrix, it is likely that 
you have made a mistake, or at the very least you have to be very careful.

(Yes, the matrix of eigenvectors of a real-symmetric problem can be chosen 
orthonormal, with determinant ±1, and of course it is possible to choose 
the eigenvectors so that the determinant is +1, but this still does not 
uniquely determine the eigenvectors: in an NxN orthonormal matrix, there 
are 2^(N-1) choices of signs that lead to the same sign of the determinant. 
 And if some eigenvalues have multiplicity > 1 you have even more choices.)

In short, don't get hung up on this.


Re: [julia-users] Re: ProfileView not compatible with julia-0.5?

2016-09-10 Thread Christoph Ortner
And here the error message I get in a notebook:

type Array has no field func

 in 
(::ProfileView.#printrec#26{Dict{UInt64,Array{StackFrame,1}}})(::IOContext{Base.AbstractIOBuffer{Array{UInt8,1}}},
 ::Int64, ::Float64, ::Float64, ::Float64, ::ProfileView.TagData, 
::ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}}) at 
/Users/ortner/.julia/v0.5/ProfileView/src/ProfileView.jl:213
 in show(::IOContext{Base.AbstractIOBuffer{Array{UInt8,1}}}, 
::MIME{Symbol("image/svg+xml")}, ::ProfileView.ProfileData) at 
/Users/ortner/.julia/v0.5/ProfileView/src/ProfileView.jl:255
 in verbose_show(::Base.AbstractIOBuffer{Array{UInt8,1}}, 
::MIME{Symbol("image/svg+xml")}, ::ProfileView.ProfileData) at 
./multimedia.jl:50
 in #sprint#304(::Void, ::Function, ::Int64, ::Function, 
::MIME{Symbol("image/svg+xml")}, ::Vararg{Any,N}) at ./strings/io.jl:37
 in display_dict(::ProfileView.ProfileData) at 
/Users/ortner/.julia/v0.5/IJulia/src/execute_request.jl:28
 in execute_request(::ZMQ.Socket, ::IJulia.Msg) at 
/Users/ortner/.julia/v0.5/IJulia/src/execute_request.jl:195
 in eventloop(::ZMQ.Socket) at 
/Users/ortner/.julia/v0.5/IJulia/src/IJulia.jl:138
 in (::IJulia.##25#31)() at ./task.jl:360


In [ ]:


Re: [julia-users] Re: ProfileView not compatible with julia-0.5?

2016-09-10 Thread Christoph Ortner
I've actually had problems with ProfileView as well, but thought I'd wait 
until 0.5 is released.

julia> ProfileView.view()


(:770): GdkPixbuf-WARNING **: Cannot open pixbuf loader module 
file 
'/Users/ortner/.julia/v0.5/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache'
: No such file or directory


This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /Users/ortner/.julia/v0.5/Homebrew/deps/usr/lib
/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
ERROR: UndefVarError: _jl_libcairo not defined
 in #CairoImageSurface#1(::Bool, ::Function, ::Array{UInt32,2}, ::Int32) at 
/Users/ortner/.julia/v0.5/Cairo/src/Cairo.jl:183
 in #viewprof#2(::Bool, ::Bool, ::Int64, ::Bool, ::Array{Any,1}, 
::Function, ::Gtk.GtkCanvas, ::Array{Array{UInt64,1},1}, ::Array{UInt64,1}, 
::Array{Int64,1}, ::Dict{UInt64,Array{StackFrame,1}}, 
::Array{Array{StackFrame,1},1}) at 
/Users/ortner/.julia/v0.5/ProfileView/src/ProfileViewGtk.jl:48
 in (::ProfileViewGtk.#kw##viewprof)(::Array{Any,1}, 
::ProfileViewGtk.#viewprof, ::Gtk.GtkCanvas, ::Array{Array{UInt64,1},1}, 
::Array{UInt64,1}, ::Array{Int64,1}, ::Dict{UInt64,Array{StackFrame,1}}, 
::Array{Array{StackFrame,1},1}) at ./:0
 in #view#1(::Void, ::Array{Any,1}, ::Function, ::Array{UInt64,1}) at 
/Users/ortner/.julia/v0.5/ProfileView/src/ProfileViewGtk.jl:40
 in (::ProfileViewGtk.#kw##view)(::Array{Any,1}, ::ProfileViewGtk.#view, 
::Array{UInt64,1}) at ./:0
 in view() at /Users/ortner/.julia/v0.5/ProfileView/src/ProfileView.jl:55


shell> gdk-pixbuf-query-loaders > /Users/ortner/.julia/v0.5/Homebrew/deps/
usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
objc[3073]: Class GNotificationCenterDelegate is implemented in both /usr/
local/opt/glib/lib/libgio-2.0.0.dylib and /Users/ortner/.julia/v0.5/Homebrew
/deps/usr/opt/glib/lib/libgio-2.0.0.dylib. One of the two will be used. 
Which one is undefined.


julia>


julia> ProfileView.view()
ERROR: UndefVarError: _jl_libcairo not defined
 in #CairoImageSurface#1(::Bool, ::Function, ::Array{UInt32,2}, ::Int32) at 
/Users/ortner/.julia/v0.5/Cairo/src/Cairo.jl:183
 in #viewprof#2(::Bool, ::Bool, ::Int64, ::Bool, ::Array{Any,1}, 
::Function, ::Gtk.GtkCanvas, ::Array{Array{UInt64,1},1}, ::Array{UInt64,1}, 
::Array{Int64,1}, ::Dict{UInt64,Array{StackFrame,1}}, 
::Array{Array{StackFrame,1},1}) at 
/Users/ortner/.julia/v0.5/ProfileView/src/ProfileViewGtk.jl:48
 in (::ProfileViewGtk.#kw##viewprof)(::Array{Any,1}, 
::ProfileViewGtk.#viewprof, ::Gtk.GtkCanvas, ::Array{Array{UInt64,1},1}, 
::Array{UInt64,1}, ::Array{Int64,1}, ::Dict{UInt64,Array{StackFrame,1}}, 
::Array{Array{StackFrame,1},1}) at ./:0
 in #view#1(::Void, ::Array{Any,1}, ::Function, ::Array{UInt64,1}) at 
/Users/ortner/.julia/v0.5/ProfileView/src/ProfileViewGtk.jl:40
 in (::ProfileViewGtk.#kw##view)(::Array{Any,1}, ::ProfileViewGtk.#view, 
::Array{UInt64,1}) at ./:0
 in view() at /Users/ortner/.julia/v0.5/ProfileView/src/ProfileView.jl:55




Re: Orientation? was: Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Christoph Ortner
Yichao is right, you cannot give eigenvectors an orientation; A good way to 
think of them is as defining linear subspaces. 

So what is unique is the projector  v\|v| \otimes v/|v|  or in the case of 
multiple e-vals the  projector onto the eigenspace  \sum v_i \otimes v_i. 
But never the e-evecs themselves. 



On Saturday, 10 September 2016 17:20:25 UTC+1, Stuart Brorson wrote:
>
> Just a question from a non-mathematician.  Also, this is a math 
> question, not a Julia/Matlab question. 
>
> I agree that Matlab and Julia are both correct -- within the 
> definitions of eigenvector and eigenvalue they compute, it's OK that 
> one eigenvector differes between the two by a factor -1.  They're 
> probably calling the same library anyway. 
>
> However, from a physics perspective, this bugs me.  In physics, an 
> important feature of a space is its orientation.  For example, 
> physics and engineering undergrads learn early on about about the 
> "right-hand rule" for taking cross products of vectors.  This type of 
> product imposes an orientation (or chirality) on the vector space 
> under consideration.  Real mathematicians may be familiar with 
> the wedge product in exterior algebra, which (I belive) also imposes 
> an orientation on a vector space.  Wikipedia says: 
>
> https://en.wikipedia.org/wiki/Orientation_(vector_space) 
>
> The problem I have with Julia and Matlab returning a set of 
> eigenvectors where only one eigenvector is the negative of the other 
> is that the two eigenvector sets span spaces of opposite 
> orientation, so the returns are -- in some sense -- not the same. 
>
> So my question:  Is there anything like a set of "oriented" 
> eigenvectors?  Is this even possible?  Or am I totally wrong, and 
> the two different sets of eigenvectors span the same space independent 
> of concerns about orientation? 
>
> Stuart 
>
>
>
>
> On Sat, 10 Sep 2016, Tracy Wadleigh wrote: 
>
> > Looks good to me. The eigenvalues look the same up to the precision 
> shown 
> > and eigenvectors are only unique up to a scalar multiple. 
> > 
> > On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" < 
> > dennis@neuro.fchampalimaud.org > wrote: 
> > 
> >> Hi! 
> >> 
> >> Here is a simple example: 
> >> 
> >> *Matlab:* 
> >> (all types are double) 
> >>  covX(1:4,1:4) 
> >> 
> >>   1.0e+006 * 
> >> 
> >> 3.86263.41572.40491.2403 
> >> 3.41573.73753.33952.3899 
> >> 2.40493.33953.73723.4033 
> >> 1.24032.38993.40333.8548 
> >> 
> >> [V,D] = eig(covX(1:4,1:4)) 
> >> 
> >> V = 
> >> 
> >> 0.25830.5402   -0.65760.4571 
> >>-0.6622   -0.4518   -0.25570.5404 
> >> 0.6565   -0.46040.25520.5403 
> >>-0.25250.54040.66110.4551 
> >> 
> >> 
> >> D = 
> >> 
> >>   1.0e+007 * 
> >> 
> >> 0.0006 0 0 0 
> >>  00.0197 0 0 
> >>  0 00.3010 0 
> >>  0 0 01.1978 
> >> 
> >> 
> >> 
> >> *Julia:* 
> >> (all types are Float 64) 
> >> *D = * 
> >> *5759.7016...* 
> >> *197430.4962...* 
> >> *3.0104794 ... e6* 
> >> *1.1978 ... e7* 
> >> 
> >> V = 
> >>0.25830.5402-0.6576 *-0.4571* 
> >>-0.6622   -0.4518   -0.2557*-0.5404* 
> >> 0.6565   -0.46040.2552*-0.5403* 
> >>-0.25250.54040.6611*-0.4551* 
> >> 
> >> cheers, 
> >> 
> >> D 
> >> 
> >> 
> >> On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon 
> >> wrote: 
> >>> 
> >>> You mean they are not simply permuted? Can you report the MATLAB and 
> >>> Julia results in the two cases for a small covX matrix? 
> >>> 
> >>> On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier < 
> >>> dennis@neuro.fchampalimaud.org> wrote: 
> >>> 
>  Hi, 
>  
>  I am new to Julia and rather lay in math. For practice, I am 
> translating 
>  a Matlab script (written by somebody else) and compare the result of 
> each 
>  step in Matlab and Julia. 
>  
>  The Matlab script uses  [V,D] = eig(covX); 
>  
>  which I translated to Julia as: (D,V) = eig(covX) 
>  
>  However, the outcomes don't match, although covX is the same. 
>  
>  D. 
>  
>  
>  
> >>> 
> > 
>


Re: Orientation? was: Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 2:18 PM, Yichao Yu  wrote:

>
>
> On Sat, Sep 10, 2016 at 2:12 PM, Stuart Brorson  wrote:
>
>> I don't think you can define that in a continuous way.
>>> In general, if your application relies on certain property of the basis,
>>> you should just normalize it that way. If you don't have a requirement
>>> than
>>> you should worry about it.
>>>
>>
>> Thanks for the thoughts.
>>
>> I did a little more thinking and Googling.  My conclusion:
>>
>> Yes, you can define the concept of orientation very clearly.  The
>> orientation of a vector space is given by the determinant of the
>> matrix formed by its basis set (eigenvectors).  The determinant will
>> be either + or -1 for an orthonormal set of  basis vectors.  The sign
>> of the determinant divides the orthonormal set into two equivalence
>> classes of basis vectors, one with + orientation, the other with -.
>>
>
>
> What I actually mean is that you can constraint the result of eigs.
>

Obviously I meant "can't" . You can certainly flip signs to get the
orientation you want but not in a meaningful and unique way.


>
>>
>> I guess the concept of eigenvector/eigevalue is more general than the
>> concept of orientation.  Put another way, you can have a basis set
>> (eigenvectors) without defining the orientation property, but you
>> can't have orientation without first having a basis set.
>>
>> The OP's results from Matlab and Julia belong to opposite
>> equivalence classes, which is what bothers me.  However,
>> from the standpoint of getting a basis, the concept of orientation is
>> not required.  One would need to impose some additional constraint on
>> the eigenvalue decomposition algorithm in order to always get an
>> eigenvector set with the same orientation, and I guess that additional
>> constraint isn't important for the problems usually solved by
>> eigendecomposition.
>>
>> Thanks for making me think about this,
>>
>> Stuart
>>
>>
>>
>>
>> On Sat, 10 Sep 2016, Yichao Yu wrote:
>>
>> On Sat, Sep 10, 2016 at 12:20 PM, Stuart Brorson  wrote:
>>>
>>> Just a question from a non-mathematician.  Also, this is a math
 question, not a Julia/Matlab question.

 I agree that Matlab and Julia are both correct -- within the
 definitions of eigenvector and eigenvalue they compute, it's OK that
 one eigenvector differes between the two by a factor -1.  They're
 probably calling the same library anyway.

 However, from a physics perspective, this bugs me.  In physics, an
 important feature of a space is its orientation.  For example,
 physics and engineering undergrads learn early on about about the
 "right-hand rule" for taking cross products of vectors.  This type of
 product imposes an orientation (or chirality) on the vector space
 under consideration.  Real mathematicians may be familiar with
 the wedge product in exterior algebra, which (I belive) also imposes
 an orientation on a vector space.  Wikipedia says:

 https://en.wikipedia.org/wiki/Orientation_(vector_space)

 The problem I have with Julia and Matlab returning a set of
 eigenvectors where only one eigenvector is the negative of the other
 is that the two eigenvector sets span spaces of opposite
 orientation, so the returns are -- in some sense -- not the same.

 So my question:  Is there anything like a set of "oriented"
 eigenvectors?  Is this even possible?  Or am I totally wrong, and
 the two different sets of eigenvectors span the same space independent
 of concerns about orientation?


>>>
>>> I don't think you can define that in a continuous way.
>>> In general, if your application relies on certain property of the basis,
>>> you should just normalize it that way. If you don't have a requirement
>>> than
>>> you should worry about it.
>>>
>>>
>>>
 Stuart




 On Sat, 10 Sep 2016, Tracy Wadleigh wrote:

 Looks good to me. The eigenvalues look the same up to the precision
 shown

> and eigenvectors are only unique up to a scalar multiple.
>
> On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" <
> dennis.eckme...@neuro.fchampalimaud.org> wrote:
>
> Hi!
>
>>
>> Here is a simple example:
>>
>> *Matlab:*
>> (all types are double)
>>  covX(1:4,1:4)
>>
>>   1.0e+006 *
>>
>> 3.86263.41572.40491.2403
>> 3.41573.73753.33952.3899
>> 2.40493.33953.73723.4033
>> 1.24032.38993.40333.8548
>>
>> [V,D] = eig(covX(1:4,1:4))
>>
>> V =
>>
>> 0.25830.5402   -0.65760.4571
>>-0.6622   -0.4518   -0.25570.5404
>> 0.6565   -0.46040.25520.5403
>>-0.25250.54040.66110.4551
>>
>>
>> D =
>>
>>   1.0e+007 *
>>
>> 0.0006 0 0 0

Re: Orientation? was: Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 2:12 PM, Stuart Brorson  wrote:

> I don't think you can define that in a continuous way.
>> In general, if your application relies on certain property of the basis,
>> you should just normalize it that way. If you don't have a requirement
>> than
>> you should worry about it.
>>
>
> Thanks for the thoughts.
>
> I did a little more thinking and Googling.  My conclusion:
>
> Yes, you can define the concept of orientation very clearly.  The
> orientation of a vector space is given by the determinant of the
> matrix formed by its basis set (eigenvectors).  The determinant will
> be either + or -1 for an orthonormal set of  basis vectors.  The sign
> of the determinant divides the orthonormal set into two equivalence
> classes of basis vectors, one with + orientation, the other with -.
>


What I actually mean is that you can constraint the result of eigs.


>
> I guess the concept of eigenvector/eigevalue is more general than the
> concept of orientation.  Put another way, you can have a basis set
> (eigenvectors) without defining the orientation property, but you
> can't have orientation without first having a basis set.
>
> The OP's results from Matlab and Julia belong to opposite
> equivalence classes, which is what bothers me.  However,
> from the standpoint of getting a basis, the concept of orientation is
> not required.  One would need to impose some additional constraint on
> the eigenvalue decomposition algorithm in order to always get an
> eigenvector set with the same orientation, and I guess that additional
> constraint isn't important for the problems usually solved by
> eigendecomposition.
>
> Thanks for making me think about this,
>
> Stuart
>
>
>
>
> On Sat, 10 Sep 2016, Yichao Yu wrote:
>
> On Sat, Sep 10, 2016 at 12:20 PM, Stuart Brorson  wrote:
>>
>> Just a question from a non-mathematician.  Also, this is a math
>>> question, not a Julia/Matlab question.
>>>
>>> I agree that Matlab and Julia are both correct -- within the
>>> definitions of eigenvector and eigenvalue they compute, it's OK that
>>> one eigenvector differes between the two by a factor -1.  They're
>>> probably calling the same library anyway.
>>>
>>> However, from a physics perspective, this bugs me.  In physics, an
>>> important feature of a space is its orientation.  For example,
>>> physics and engineering undergrads learn early on about about the
>>> "right-hand rule" for taking cross products of vectors.  This type of
>>> product imposes an orientation (or chirality) on the vector space
>>> under consideration.  Real mathematicians may be familiar with
>>> the wedge product in exterior algebra, which (I belive) also imposes
>>> an orientation on a vector space.  Wikipedia says:
>>>
>>> https://en.wikipedia.org/wiki/Orientation_(vector_space)
>>>
>>> The problem I have with Julia and Matlab returning a set of
>>> eigenvectors where only one eigenvector is the negative of the other
>>> is that the two eigenvector sets span spaces of opposite
>>> orientation, so the returns are -- in some sense -- not the same.
>>>
>>> So my question:  Is there anything like a set of "oriented"
>>> eigenvectors?  Is this even possible?  Or am I totally wrong, and
>>> the two different sets of eigenvectors span the same space independent
>>> of concerns about orientation?
>>>
>>>
>>
>> I don't think you can define that in a continuous way.
>> In general, if your application relies on certain property of the basis,
>> you should just normalize it that way. If you don't have a requirement
>> than
>> you should worry about it.
>>
>>
>>
>>> Stuart
>>>
>>>
>>>
>>>
>>> On Sat, 10 Sep 2016, Tracy Wadleigh wrote:
>>>
>>> Looks good to me. The eigenvalues look the same up to the precision shown
>>>
 and eigenvectors are only unique up to a scalar multiple.

 On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" <
 dennis.eckme...@neuro.fchampalimaud.org> wrote:

 Hi!

>
> Here is a simple example:
>
> *Matlab:*
> (all types are double)
>  covX(1:4,1:4)
>
>   1.0e+006 *
>
> 3.86263.41572.40491.2403
> 3.41573.73753.33952.3899
> 2.40493.33953.73723.4033
> 1.24032.38993.40333.8548
>
> [V,D] = eig(covX(1:4,1:4))
>
> V =
>
> 0.25830.5402   -0.65760.4571
>-0.6622   -0.4518   -0.25570.5404
> 0.6565   -0.46040.25520.5403
>-0.25250.54040.66110.4551
>
>
> D =
>
>   1.0e+007 *
>
> 0.0006 0 0 0
>  00.0197 0 0
>  0 00.3010 0
>  0 0 01.1978
>
>
>
> *Julia:*
> (all types are Float 64)
> *D = *
> *5759.7016...*
> *197430.4962...*
> *3.0104794 ... e6*
> *1.1978 ... e7*
>
> V =
>0.2583

Re: Orientation? was: Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Stuart Brorson

I don't think you can define that in a continuous way.
In general, if your application relies on certain property of the basis,
you should just normalize it that way. If you don't have a requirement than
you should worry about it.


Thanks for the thoughts.

I did a little more thinking and Googling.  My conclusion:

Yes, you can define the concept of orientation very clearly.  The
orientation of a vector space is given by the determinant of the
matrix formed by its basis set (eigenvectors).  The determinant will
be either + or -1 for an orthonormal set of  basis vectors.  The sign
of the determinant divides the orthonormal set into two equivalence
classes of basis vectors, one with + orientation, the other with -.

I guess the concept of eigenvector/eigevalue is more general than the
concept of orientation.  Put another way, you can have a basis set
(eigenvectors) without defining the orientation property, but you
can't have orientation without first having a basis set.

The OP's results from Matlab and Julia belong to opposite
equivalence classes, which is what bothers me.  However,
from the standpoint of getting a basis, the concept of orientation is
not required.  One would need to impose some additional constraint on
the eigenvalue decomposition algorithm in order to always get an
eigenvector set with the same orientation, and I guess that additional
constraint isn't important for the problems usually solved by
eigendecomposition.

Thanks for making me think about this,

Stuart



On Sat, 10 Sep 2016, Yichao Yu wrote:


On Sat, Sep 10, 2016 at 12:20 PM, Stuart Brorson  wrote:


Just a question from a non-mathematician.  Also, this is a math
question, not a Julia/Matlab question.

I agree that Matlab and Julia are both correct -- within the
definitions of eigenvector and eigenvalue they compute, it's OK that
one eigenvector differes between the two by a factor -1.  They're
probably calling the same library anyway.

However, from a physics perspective, this bugs me.  In physics, an
important feature of a space is its orientation.  For example,
physics and engineering undergrads learn early on about about the
"right-hand rule" for taking cross products of vectors.  This type of
product imposes an orientation (or chirality) on the vector space
under consideration.  Real mathematicians may be familiar with
the wedge product in exterior algebra, which (I belive) also imposes
an orientation on a vector space.  Wikipedia says:

https://en.wikipedia.org/wiki/Orientation_(vector_space)

The problem I have with Julia and Matlab returning a set of
eigenvectors where only one eigenvector is the negative of the other
is that the two eigenvector sets span spaces of opposite
orientation, so the returns are -- in some sense -- not the same.

So my question:  Is there anything like a set of "oriented"
eigenvectors?  Is this even possible?  Or am I totally wrong, and
the two different sets of eigenvectors span the same space independent
of concerns about orientation?




I don't think you can define that in a continuous way.
In general, if your application relies on certain property of the basis,
you should just normalize it that way. If you don't have a requirement than
you should worry about it.




Stuart




On Sat, 10 Sep 2016, Tracy Wadleigh wrote:

Looks good to me. The eigenvalues look the same up to the precision shown

and eigenvectors are only unique up to a scalar multiple.

On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" <
dennis.eckme...@neuro.fchampalimaud.org> wrote:

Hi!


Here is a simple example:

*Matlab:*
(all types are double)
 covX(1:4,1:4)

  1.0e+006 *

3.86263.41572.40491.2403
3.41573.73753.33952.3899
2.40493.33953.73723.4033
1.24032.38993.40333.8548

[V,D] = eig(covX(1:4,1:4))

V =

0.25830.5402   -0.65760.4571
   -0.6622   -0.4518   -0.25570.5404
0.6565   -0.46040.25520.5403
   -0.25250.54040.66110.4551


D =

  1.0e+007 *

0.0006 0 0 0
 00.0197 0 0
 0 00.3010 0
 0 0 01.1978



*Julia:*
(all types are Float 64)
*D = *
*5759.7016...*
*197430.4962...*
*3.0104794 ... e6*
*1.1978 ... e7*

V =
   0.25830.5402-0.6576 *-0.4571*
   -0.6622   -0.4518   -0.2557*-0.5404*
0.6565   -0.46040.2552*-0.5403*
   -0.25250.54040.6611*-0.4551*

cheers,

D


On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon
wrote:



You mean they are not simply permuted? Can you report the MATLAB and
Julia results in the two cases for a small covX matrix?

On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier <
dennis@neuro.fchampalimaud.org> wrote:

Hi,


I am new to Julia and rather lay in math. For practice, I am
translating
a Matlab script (written by somebody else) and compare the result of
each
step in Matlab and Julia.

The Matlab script 

[julia-users] Re: Cannot start Julia in Atom

2016-09-10 Thread Uwe Fechner
I uninstalled julia-client and reinstalled it from within Atom as suggested 
by rogerwhitney.
(http://discuss.junolab.org/t/start-julia-error-loading-atom-jl-package/853/2) 
This fixed it for me.

On Saturday, September 10, 2016 at 9:39:39 AM UTC+2, Chris Rackauckas wrote:
>
> The context is important: 
> http://stackoverflow.com/questions/39419502/cannot-start-julia-in-atom-loaderror-argumenterror-juno-not-found-in-path/39420874#39420874
>
> Or the bottom of this: 
> https://gitter.im/JunoLab/atom-ink/archives/2016/09/09
>
> It's known. It's a bad tag. Either just clone Juno.jl or wait for the tag.
>
> On Friday, September 9, 2016 at 8:13:05 PM UTC-7, Yuanchu Dang wrote:
>>
>> ERROR: LoadError: ArgumentError: Juno not found in path
>>  in require at loading.jl:249
>>  in include at boot.jl:261
>>  in include_from_node1 at loading.jl:320
>>  in process_options at client.jl:280
>>  in _start at client.jl:378
>> while loading C:\Users\think\.atom\packages\julia-client\script\boot.jl, 
>> in expression starting on line 36
>>
>

Re: Orientation? was: Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 12:20 PM, Stuart Brorson  wrote:

> Just a question from a non-mathematician.  Also, this is a math
> question, not a Julia/Matlab question.
>
> I agree that Matlab and Julia are both correct -- within the
> definitions of eigenvector and eigenvalue they compute, it's OK that
> one eigenvector differes between the two by a factor -1.  They're
> probably calling the same library anyway.
>
> However, from a physics perspective, this bugs me.  In physics, an
> important feature of a space is its orientation.  For example,
> physics and engineering undergrads learn early on about about the
> "right-hand rule" for taking cross products of vectors.  This type of
> product imposes an orientation (or chirality) on the vector space
> under consideration.  Real mathematicians may be familiar with
> the wedge product in exterior algebra, which (I belive) also imposes
> an orientation on a vector space.  Wikipedia says:
>
> https://en.wikipedia.org/wiki/Orientation_(vector_space)
>
> The problem I have with Julia and Matlab returning a set of
> eigenvectors where only one eigenvector is the negative of the other
> is that the two eigenvector sets span spaces of opposite
> orientation, so the returns are -- in some sense -- not the same.
>
> So my question:  Is there anything like a set of "oriented"
> eigenvectors?  Is this even possible?  Or am I totally wrong, and
> the two different sets of eigenvectors span the same space independent
> of concerns about orientation?
>


I don't think you can define that in a continuous way.
In general, if your application relies on certain property of the basis,
you should just normalize it that way. If you don't have a requirement than
you should worry about it.


>
> Stuart
>
>
>
>
> On Sat, 10 Sep 2016, Tracy Wadleigh wrote:
>
> Looks good to me. The eigenvalues look the same up to the precision shown
>> and eigenvectors are only unique up to a scalar multiple.
>>
>> On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" <
>> dennis.eckme...@neuro.fchampalimaud.org> wrote:
>>
>> Hi!
>>>
>>> Here is a simple example:
>>>
>>> *Matlab:*
>>> (all types are double)
>>>  covX(1:4,1:4)
>>>
>>>   1.0e+006 *
>>>
>>> 3.86263.41572.40491.2403
>>> 3.41573.73753.33952.3899
>>> 2.40493.33953.73723.4033
>>> 1.24032.38993.40333.8548
>>>
>>> [V,D] = eig(covX(1:4,1:4))
>>>
>>> V =
>>>
>>> 0.25830.5402   -0.65760.4571
>>>-0.6622   -0.4518   -0.25570.5404
>>> 0.6565   -0.46040.25520.5403
>>>-0.25250.54040.66110.4551
>>>
>>>
>>> D =
>>>
>>>   1.0e+007 *
>>>
>>> 0.0006 0 0 0
>>>  00.0197 0 0
>>>  0 00.3010 0
>>>  0 0 01.1978
>>>
>>>
>>>
>>> *Julia:*
>>> (all types are Float 64)
>>> *D = *
>>> *5759.7016...*
>>> *197430.4962...*
>>> *3.0104794 ... e6*
>>> *1.1978 ... e7*
>>>
>>> V =
>>>0.25830.5402-0.6576 *-0.4571*
>>>-0.6622   -0.4518   -0.2557*-0.5404*
>>> 0.6565   -0.46040.2552*-0.5403*
>>>-0.25250.54040.6611*-0.4551*
>>>
>>> cheers,
>>>
>>> D
>>>
>>>
>>> On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon
>>> wrote:
>>>

 You mean they are not simply permuted? Can you report the MATLAB and
 Julia results in the two cases for a small covX matrix?

 On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier <
 dennis@neuro.fchampalimaud.org> wrote:

 Hi,
>
> I am new to Julia and rather lay in math. For practice, I am
> translating
> a Matlab script (written by somebody else) and compare the result of
> each
> step in Matlab and Julia.
>
> The Matlab script uses  [V,D] = eig(covX);
>
> which I translated to Julia as: (D,V) = eig(covX)
>
> However, the outcomes don't match, although covX is the same.
>
> D.
>
>
>
>

>>


Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 12:16 PM, Tim Holy  wrote:

> Every time julia allocates memory, it adds the number of bytes to a
> running tally; once that tally gets big enough, it does a
> garbage-collection pass (and resets the tally). Consequently GC is
> triggered only when you allocate, but even the smallest
>

Note that this is not entirely true. GC can be triggered without any
allocation. This is probably limited to explicitly invoking the GC for
single thread programs but can happen in many more places for a
multi-threaded program. In general, you should assume that any call to
julia related code can allocate unless you know very well about the
function you are calling and how it relates to memory management.


> allocation can trigger GC if it pushes the tally over the threshold. It
> thus depends on where that tally was when you started. Keep in mind that
> there are many uses of memory that may not be obvious; for example, JIT
> compilation uses memory because julia code is compiled by julia code.
>
>
>
> Best,
>
> --Tim
>
>
>
> On Saturday, September 10, 2016 7:05:18 AM CDT K leo wrote:
>
> > Let's say in REPL you define an object, then after many many other
>
> > operations, Julia's GC wouldn't free the object you defined earlier until
>
> > you exit Julia or you somehow really run out of memory or something. Is
>
> > that the correct understanding?
>
> >
>
> > Now I am trying to think what happens with the jl_... calls one performs
>
> > from C/C++ code. The procedure is that one calls jl_init first to start a
>
> > Julia session, then a bunch other jl_... calls to handle some data, and
>
> > then at last jl_atexit_hook to stop using Julia. Is the mechanism here
>
> > similar to REPL in the sense that the Julia session is up and running
>
> > before one calls jl_atexit_hook? So Julia GC would not free objects you
>
> > created with jl_... calls until you exit or you somehow really run out of
>
> > memory or something.
>
> >
>
> > Having read the section in Embedding Julia, I get the sense that it is
> the
>
> > case. So we only need to worry about GC after all jl_... calls, not in
>
> >
>
> > between jl_... calls. So here it says :
>
> > > “However, it is generally safe to use pointers in between jl_... calls.
>
> > >
>
> > >> But in order to make sure that values can survive jl_... calls, we
> have
>
> > >> to
>
> > >> tell Julia that we hold a reference to a Julia value. ”
>
> > >
>
> > > Excerpt From: unknown. “Julia Language 0.6.0-dev documentation.”
> iBooks.
>
> > >
>
> > > Is my understanding correct? Or can anyone please explain otherwise?
>
>
>
>
>


Re: [julia-users] How do I call run()?!

2016-09-10 Thread Stefan Karpinski
Use backticks:

run(`echo Hello`)

On Sat, Sep 10, 2016 at 12:42 PM, Dennis Eckmeier  wrote:

> Hi,
>
> I am trying to run an executable on Windows 10. I can run it from DOS
> command line and I double checked the current working path in Julia is the
> one that includes the bh_tsne.exe.
>
> *run('bh_tsne')* *> syntax: invalid character literal*
>
> All sources I find call run() with this syntax o.O
>
> Julia version 0.4.6
>
> D.
>
> *Why, yes, good Sir, I am, in fact, a noob.*
>


[julia-users] How do I call run()?!

2016-09-10 Thread Dennis Eckmeier
Hi,

I am trying to run an executable on Windows 10. I can run it from DOS 
command line and I double checked the current working path in Julia is the 
one that includes the bh_tsne.exe.

*run('bh_tsne')* *> syntax: invalid character literal*

All sources I find call run() with this syntax o.O

Julia version 0.4.6

D.

*Why, yes, good Sir, I am, in fact, a noob.*


Orientation? was: Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Stuart Brorson

Just a question from a non-mathematician.  Also, this is a math
question, not a Julia/Matlab question.

I agree that Matlab and Julia are both correct -- within the
definitions of eigenvector and eigenvalue they compute, it's OK that
one eigenvector differes between the two by a factor -1.  They're
probably calling the same library anyway.

However, from a physics perspective, this bugs me.  In physics, an
important feature of a space is its orientation.  For example,
physics and engineering undergrads learn early on about about the
"right-hand rule" for taking cross products of vectors.  This type of
product imposes an orientation (or chirality) on the vector space
under consideration.  Real mathematicians may be familiar with
the wedge product in exterior algebra, which (I belive) also imposes
an orientation on a vector space.  Wikipedia says:

https://en.wikipedia.org/wiki/Orientation_(vector_space)

The problem I have with Julia and Matlab returning a set of
eigenvectors where only one eigenvector is the negative of the other
is that the two eigenvector sets span spaces of opposite
orientation, so the returns are -- in some sense -- not the same.

So my question:  Is there anything like a set of "oriented"
eigenvectors?  Is this even possible?  Or am I totally wrong, and
the two different sets of eigenvectors span the same space independent
of concerns about orientation?

Stuart




On Sat, 10 Sep 2016, Tracy Wadleigh wrote:


Looks good to me. The eigenvalues look the same up to the precision shown
and eigenvectors are only unique up to a scalar multiple.

On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" <
dennis.eckme...@neuro.fchampalimaud.org> wrote:


Hi!

Here is a simple example:

*Matlab:*
(all types are double)
 covX(1:4,1:4)

  1.0e+006 *

3.86263.41572.40491.2403
3.41573.73753.33952.3899
2.40493.33953.73723.4033
1.24032.38993.40333.8548

[V,D] = eig(covX(1:4,1:4))

V =

0.25830.5402   -0.65760.4571
   -0.6622   -0.4518   -0.25570.5404
0.6565   -0.46040.25520.5403
   -0.25250.54040.66110.4551


D =

  1.0e+007 *

0.0006 0 0 0
 00.0197 0 0
 0 00.3010 0
 0 0 01.1978



*Julia:*
(all types are Float 64)
*D = *
*5759.7016...*
*197430.4962...*
*3.0104794 ... e6*
*1.1978 ... e7*

V =
   0.25830.5402-0.6576 *-0.4571*
   -0.6622   -0.4518   -0.2557*-0.5404*
0.6565   -0.46040.2552*-0.5403*
   -0.25250.54040.6611*-0.4551*

cheers,

D


On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon
wrote:


You mean they are not simply permuted? Can you report the MATLAB and
Julia results in the two cases for a small covX matrix?

On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier <
dennis@neuro.fchampalimaud.org> wrote:


Hi,

I am new to Julia and rather lay in math. For practice, I am translating
a Matlab script (written by somebody else) and compare the result of each
step in Matlab and Julia.

The Matlab script uses  [V,D] = eig(covX);

which I translated to Julia as: (D,V) = eig(covX)

However, the outcomes don't match, although covX is the same.

D.









Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Tim Holy
Every time julia allocates memory, it adds the number of bytes to a running 
tally; once that 
tally gets big enough, it does a garbage-collection pass (and resets the 
tally). 
Consequently GC is triggered only when you allocate, but even the smallest 
allocation can 
trigger GC if it pushes the tally over the threshold. It thus depends on where 
that tally was 
when you started. Keep in mind that there are many uses of memory that may not 
be 
obvious; for example, JIT compilation uses memory because julia code is 
compiled by julia 
code.

Best,
--Tim

On Saturday, September 10, 2016 7:05:18 AM CDT K leo wrote:
> Let's say in REPL you define an object, then after many many other
> operations, Julia's GC wouldn't free the object you defined earlier until
> you exit Julia or you somehow really run out of memory or something.  Is
> that the correct understanding?
> 
> Now I am trying to think what happens with the jl_... calls one performs
> from C/C++ code.  The procedure is that one calls jl_init first to start a
> Julia session, then a bunch other jl_... calls to handle some data, and
> then at last jl_atexit_hook to stop using Julia.  Is the mechanism here
> similar to REPL in the sense that the Julia session is up and running
> before one calls  jl_atexit_hook?  So Julia GC would not free objects you
> created with jl_... calls until you exit or you somehow really run out of
> memory or something.
> 
> Having read the section in Embedding Julia, I get the sense that it is the
> case.  So we only need to worry about GC after all jl_... calls, not in
> 
> between jl_... calls.  So here it says :
> > “However, it is generally safe to use pointers in between jl_... calls.
> > 
> >> But in order to make sure that values can survive jl_... calls, we have
> >> to
> >> tell Julia that we hold a reference to a Julia value. ”
> > 
> > Excerpt From: unknown. “Julia Language 0.6.0-dev documentation.” iBooks.
> > 
> > Is my understanding correct?  Or can anyone please explain otherwise?




Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Dennis Eckmeier
Thanks, that's reassuring. 


On Saturday, September 10, 2016 at 4:15:23 PM UTC+1, Tracy Wadleigh wrote:
>
> Looks good to me. The eigenvalues look the same up to the precision shown 
> and eigenvectors are only unique up to a scalar multiple.
>
> On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" <
> dennis@neuro.fchampalimaud.org > wrote:
>
>> Hi!
>>
>> Here is a simple example:
>>
>> *Matlab:*
>> (all types are double)
>>  covX(1:4,1:4)
>>
>>   1.0e+006 *
>>
>> 3.86263.41572.40491.2403
>> 3.41573.73753.33952.3899
>> 2.40493.33953.73723.4033
>> 1.24032.38993.40333.8548
>>
>> [V,D] = eig(covX(1:4,1:4))
>>
>> V =
>>
>> 0.25830.5402   -0.65760.4571
>>-0.6622   -0.4518   -0.25570.5404
>> 0.6565   -0.46040.25520.5403
>>-0.25250.54040.66110.4551
>>
>>
>> D =
>>
>>   1.0e+007 *
>>
>> 0.0006 0 0 0
>>  00.0197 0 0
>>  0 00.3010 0
>>  0 0 01.1978
>>
>>
>>
>> *Julia:*
>> (all types are Float 64)
>> *D = *
>> *5759.7016...*
>> *197430.4962...*
>> *3.0104794 ... e6*
>> *1.1978 ... e7*
>>
>> V =
>>0.25830.5402-0.6576 *-0.4571*
>>-0.6622   -0.4518   -0.2557*-0.5404*
>> 0.6565   -0.46040.2552*-0.5403*
>>-0.25250.54040.6611*-0.4551*
>>
>> cheers,
>>
>> D
>>
>>
>> On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon 
>> wrote:
>>>
>>> You mean they are not simply permuted? Can you report the MATLAB and 
>>> Julia results in the two cases for a small covX matrix?
>>>
>>> On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier <
>>> dennis@neuro.fchampalimaud.org> wrote:
>>>
 Hi,

 I am new to Julia and rather lay in math. For practice, I am 
 translating a Matlab script (written by somebody else) and compare the 
 result of each step in Matlab and Julia.

 The Matlab script uses  [V,D] = eig(covX);

 which I translated to Julia as: (D,V) = eig(covX)

 However, the outcomes don't match, although covX is the same.

 D.



>>>

Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Tracy Wadleigh
Looks good to me. The eigenvalues look the same up to the precision shown
and eigenvectors are only unique up to a scalar multiple.

On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" <
dennis.eckme...@neuro.fchampalimaud.org> wrote:

> Hi!
>
> Here is a simple example:
>
> *Matlab:*
> (all types are double)
>  covX(1:4,1:4)
>
>   1.0e+006 *
>
> 3.86263.41572.40491.2403
> 3.41573.73753.33952.3899
> 2.40493.33953.73723.4033
> 1.24032.38993.40333.8548
>
> [V,D] = eig(covX(1:4,1:4))
>
> V =
>
> 0.25830.5402   -0.65760.4571
>-0.6622   -0.4518   -0.25570.5404
> 0.6565   -0.46040.25520.5403
>-0.25250.54040.66110.4551
>
>
> D =
>
>   1.0e+007 *
>
> 0.0006 0 0 0
>  00.0197 0 0
>  0 00.3010 0
>  0 0 01.1978
>
>
>
> *Julia:*
> (all types are Float 64)
> *D = *
> *5759.7016...*
> *197430.4962...*
> *3.0104794 ... e6*
> *1.1978 ... e7*
>
> V =
>0.25830.5402-0.6576 *-0.4571*
>-0.6622   -0.4518   -0.2557*-0.5404*
> 0.6565   -0.46040.2552*-0.5403*
>-0.25250.54040.6611*-0.4551*
>
> cheers,
>
> D
>
>
> On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon
> wrote:
>>
>> You mean they are not simply permuted? Can you report the MATLAB and
>> Julia results in the two cases for a small covX matrix?
>>
>> On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier <
>> dennis@neuro.fchampalimaud.org> wrote:
>>
>>> Hi,
>>>
>>> I am new to Julia and rather lay in math. For practice, I am translating
>>> a Matlab script (written by somebody else) and compare the result of each
>>> step in Matlab and Julia.
>>>
>>> The Matlab script uses  [V,D] = eig(covX);
>>>
>>> which I translated to Julia as: (D,V) = eig(covX)
>>>
>>> However, the outcomes don't match, although covX is the same.
>>>
>>> D.
>>>
>>>
>>>
>>


Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Dennis Eckmeier
Hi!

Here is a simple example:

*Matlab:*
(all types are double)
 covX(1:4,1:4)

  1.0e+006 *

3.86263.41572.40491.2403
3.41573.73753.33952.3899
2.40493.33953.73723.4033
1.24032.38993.40333.8548

[V,D] = eig(covX(1:4,1:4))

V =

0.25830.5402   -0.65760.4571
   -0.6622   -0.4518   -0.25570.5404
0.6565   -0.46040.25520.5403
   -0.25250.54040.66110.4551


D =

  1.0e+007 *

0.0006 0 0 0
 00.0197 0 0
 0 00.3010 0
 0 0 01.1978



*Julia:*
(all types are Float 64)
*D = *
*5759.7016...*
*197430.4962...*
*3.0104794 ... e6*
*1.1978 ... e7*

V =
   0.25830.5402-0.6576 *-0.4571*
   -0.6622   -0.4518   -0.2557*-0.5404*
0.6565   -0.46040.2552*-0.5403*
   -0.25250.54040.6611*-0.4551*

cheers,

D


On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon 
wrote:
>
> You mean they are not simply permuted? Can you report the MATLAB and Julia 
> results in the two cases for a small covX matrix?
>
> On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier <
> dennis@neuro.fchampalimaud.org > wrote:
>
>> Hi,
>>
>> I am new to Julia and rather lay in math. For practice, I am translating 
>> a Matlab script (written by somebody else) and compare the result of each 
>> step in Matlab and Julia.
>>
>> The Matlab script uses  [V,D] = eig(covX);
>>
>> which I translated to Julia as: (D,V) = eig(covX)
>>
>> However, the outcomes don't match, although covX is the same.
>>
>> D.
>>
>>
>>
>

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 10:05 AM, K leo  wrote:

> Let's say in REPL you define an object, then after many many other
> operations, Julia's GC wouldn't free the object you defined earlier until
> you exit Julia or you somehow really run out of memory or something.  Is
> that the correct understanding?
>
> Now I am trying to think what happens with the jl_... calls one performs
> from C/C++ code.  The procedure is that one calls jl_init first to start a
> Julia session, then a bunch other jl_... calls to handle some data, and
> then at last jl_atexit_hook to stop using Julia.  Is the mechanism here
> similar to REPL in the sense that the Julia session is up and running
> before one calls  jl_atexit_hook?  So Julia GC would not free objects you
> created with jl_... calls until you exit or you somehow really run out of
> memory or something.
>

For julia code GC can happen at any time.
For C code, it can happen when you call any julia runtime functions or
julia functions (i.e. any functions related to julia).


>
> Having read the section in Embedding Julia, I get the sense that it is the
> case.  So we only need to worry about GC after all jl_... calls, not in
> between jl_... calls.  So here it says :
>>
>> “However, it is generally safe to use pointers in between jl_... calls.
>>> But in order to make sure that values can survive jl_... calls, we have to
>>> tell Julia that we hold a reference to a Julia value. ”
>>
>> Excerpt From: unknown. “Julia Language 0.6.0-dev documentation.” iBooks.
>>
>> Is my understanding correct?  Or can anyone please explain otherwise?
>
>


Re: [julia-users] [JuliaOpt] Beginner questions?

2016-09-10 Thread Colin Beckingham
Thanks, got it.

On Saturday, 10 September 2016 09:10:54 UTC-4, Michele Zaffalon wrote:
>
> There is the julia-opt forum: 
> https://groups.google.com/forum/#!forum/julia-opt
>
> On Sat, Sep 10, 2016 at 2:38 PM, Colin Beckingham  > wrote:
>
>> OK for Optim beginner questions here?
>>
>
>

[julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread K leo
Let's say in REPL you define an object, then after many many other 
operations, Julia's GC wouldn't free the object you defined earlier until 
you exit Julia or you somehow really run out of memory or something.  Is 
that the correct understanding?

Now I am trying to think what happens with the jl_... calls one performs 
from C/C++ code.  The procedure is that one calls jl_init first to start a 
Julia session, then a bunch other jl_... calls to handle some data, and 
then at last jl_atexit_hook to stop using Julia.  Is the mechanism here 
similar to REPL in the sense that the Julia session is up and running 
before one calls  jl_atexit_hook?  So Julia GC would not free objects you 
created with jl_... calls until you exit or you somehow really run out of 
memory or something.

Having read the section in Embedding Julia, I get the sense that it is the 
case.  So we only need to worry about GC after all jl_... calls, not in 
between jl_... calls.  So here it says :
>
> “However, it is generally safe to use pointers in between jl_... calls. 
>> But in order to make sure that values can survive jl_... calls, we have to 
>> tell Julia that we hold a reference to a Julia value. ”
>
> Excerpt From: unknown. “Julia Language 0.6.0-dev documentation.” iBooks. 
>
> Is my understanding correct?  Or can anyone please explain otherwise?



Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread K leo


On Saturday, September 10, 2016 at 9:12:10 PM UTC+8, Yichao Yu wrote:
>
>
>
> On Sat, Sep 10, 2016 at 8:53 AM, K leo  
> wrote:
>
>>  julia-config.jl is hardly useful at all.  I unpacked the Linux binary of 
>> Julia (0.5) in ~/Software/julia-9c76c3e89a, and I set JULIA_DIR 
>> accordingly. When I execute julia-config in the following way, I got all 
>> kinds of "undefined reference to" error messages.
>>
>> > $JULIA_DIR/share/julia/julia-config.jl --cflags --ldflags --ldlibs | 
>> xargs g++ test6.cpp
>> /usr/bin/ld: warning: libLLVM-3.7.1.so, needed by 
>> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so, not found (try using 
>> -rpath or -rpath-link)
>> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so: undefined reference 
>> to `llvm::AttributeSet::hasAttribute(unsigned int, 
>> llvm::Attribute::AttrKind) const'
>> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so: undefined reference 
>> to `llvm::LoopBase::getLoopLatch() const'
>> .
>>
>> If I only execute julia-config for flags, and I use these flags to cook 
>> up g++ script, and the g++ script got me the same problems.
>>
>> > $JULIA_DIR/share/julia/julia-config.jl --cflags --ldflags --ldlibs 
>> -DJULIA_ENABLE_THREADING=1 -fPIC 
>> -DJULIA_INIT_DIR=\"/home/xxx/Software/julia-9c76c3e89a/lib\" 
>> -I/home/xxx/Software/julia-9c76c3e89a/include/julia
>> -L/home/xxx/Software/julia-9c76c3e89a/lib
>> -Wl,-rpath,/home/xxx/Software/julia-9c76c3e89a/lib -ljulia
>>
>> The output for --ldflags is clearly incorrect or incomplete for my 
>> installation on Ubuntu.  The script that generally works for me is the 
>> following, where some extra things have to be set.
>>
>> > g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp 
>> -L$JULIA_DIR/lib/ -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia 
>> $JULIA_DIR/lib/julia/libstdc++.so.6
>>
>
>
> The two compilation appears to be running against two independent 
> installation and they are not comparable. Assuming the private libraries 
> are found in lib/julia the julia-config.jl script should probably be 
> updated to include it though.
>  
>

I do have two installation of Julia (0.4.6 and 0.5), but as I set JULIA_DIR 
to the 0.5 dir, the two compilations apply to the same installation.


>>
>> On Saturday, September 10, 2016 at 7:06:34 PM UTC+8, Yichao Yu wrote:
>>>
>>>
>>>
>>> On Sat, Sep 10, 2016 at 6:56 AM, K leo  wrote:
>>>
 I tried to compile the code with the GC statements, but got a bunch of 
 error regarding jl_tls_states:

>>>
>>>
>>> Use julia-config.jl to determine your compile flags.
>>>  
>>>

 test6.cpp:(.text+0xd5): undefined reference to `jl_tls_states'

 The compile script is as follows:
 g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp 
 -L$JULIA_DIR/lib/ -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia 
 $JULIA_DIR/lib/julia/libstdc++.so.6

 Where is `jl_tls_states' defined?


 On Saturday, September 10, 2016 at 5:20:02 PM UTC+8, Bart Janssens 
 wrote:
>
> I just realise I made a typo, the rooting should be done using:  (note 
> the &)
>
> JL_GC_PUSH2(,);
>
> Op za 10 sep. 2016 02:36 schreef K leo :
>
>> Bart,
>>
>> Can you explain what you mean by "need to be rooted"?  The 
>> jl_new_struct statement as Isaiah suggested works, why do we need the 
>> additional statements as you suggested?
>>
>>>
>
>
>
>>>
>>>
>

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread K leo
I need to add "-L/home/djia/Software/julia-9c76c3e89a/lib/julia 
-lLLVM-3.7.1" into the script cooked up based on julia-config output, and 
then it works.
Should I file an issue on julia-config?

On Saturday, September 10, 2016 at 8:53:39 PM UTC+8, K leo wrote:
>
>  julia-config.jl is hardly useful at all.  I unpacked the Linux binary of 
> Julia (0.5) in ~/Software/julia-9c76c3e89a, and I set JULIA_DIR 
> accordingly. When I execute julia-config in the following way, I got all 
> kinds of "undefined reference to" error messages.
>
> > $JULIA_DIR/share/julia/julia-config.jl --cflags --ldflags --ldlibs | 
> xargs g++ test6.cpp
> /usr/bin/ld: warning: libLLVM-3.7.1.so, needed by 
> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so, not found (try using 
> -rpath or -rpath-link)
> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so: undefined reference 
> to `llvm::AttributeSet::hasAttribute(unsigned int, 
> llvm::Attribute::AttrKind) const'
> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so: undefined reference 
> to `llvm::LoopBase::getLoopLatch() const'
> .
>
> If I only execute julia-config for flags, and I use these flags to cook up 
> g++ script, and the g++ script got me the same problems.
>
> > $JULIA_DIR/share/julia/julia-config.jl --cflags --ldflags --ldlibs 
> -DJULIA_ENABLE_THREADING=1 -fPIC 
> -DJULIA_INIT_DIR=\"/home/xxx/Software/julia-9c76c3e89a/lib\" 
> -I/home/xxx/Software/julia-9c76c3e89a/include/julia
> -L/home/xxx/Software/julia-9c76c3e89a/lib
> -Wl,-rpath,/home/xxx/Software/julia-9c76c3e89a/lib -ljulia
>
> The output for --ldflags is clearly incorrect or incomplete for my 
> installation on Ubuntu.  The script that generally works for me is the 
> following, where some extra things have to be set.
>
> > g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/ 
> -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia 
> $JULIA_DIR/lib/julia/libstdc++.so.6
>
>
> On Saturday, September 10, 2016 at 7:06:34 PM UTC+8, Yichao Yu wrote:
>>
>>
>>
>> On Sat, Sep 10, 2016 at 6:56 AM, K leo  wrote:
>>
>>> I tried to compile the code with the GC statements, but got a bunch of 
>>> error regarding jl_tls_states:
>>>
>>
>>
>> Use julia-config.jl to determine your compile flags.
>>  
>>
>>>
>>> test6.cpp:(.text+0xd5): undefined reference to `jl_tls_states'
>>>
>>> The compile script is as follows:
>>> g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/ 
>>> -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia 
>>> $JULIA_DIR/lib/julia/libstdc++.so.6
>>>
>>> Where is `jl_tls_states' defined?
>>>
>>>
>>> On Saturday, September 10, 2016 at 5:20:02 PM UTC+8, Bart Janssens wrote:

 I just realise I made a typo, the rooting should be done using:  (note 
 the &)

 JL_GC_PUSH2(,);

 Op za 10 sep. 2016 02:36 schreef K leo :

> Bart,
>
> Can you explain what you mean by "need to be rooted"?  The 
> jl_new_struct statement as Isaiah suggested works, why do we need the 
> additional statements as you suggested?
>
>>



>>
>>

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 9:06 AM, Bart Janssens 
wrote:

> The concrete error you got is probably due to the missing
> -DJULIA_ENABLE_THREADING.
>

Correct. In general though, you shouldn't try to figure out the correct
flags manually.


>
> Op za 10 sep. 2016 14:53 schreef K leo :
>
>>  julia-config.jl is hardly useful at all.  I unpacked the Linux binary of
>> Julia (0.5) in ~/Software/julia-9c76c3e89a, and I set JULIA_DIR
>> accordingly. When I execute julia-config in the following way, I
>>
>
>


Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 8:53 AM, K leo  wrote:

>  julia-config.jl is hardly useful at all.  I unpacked the Linux binary of
> Julia (0.5) in ~/Software/julia-9c76c3e89a, and I set JULIA_DIR
> accordingly. When I execute julia-config in the following way, I got all
> kinds of "undefined reference to" error messages.
>
> > $JULIA_DIR/share/julia/julia-config.jl --cflags --ldflags --ldlibs |
> xargs g++ test6.cpp
> /usr/bin/ld: warning: libLLVM-3.7.1.so, needed by
> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so, not found (try using
> -rpath or -rpath-link)
> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so: undefined reference
> to `llvm::AttributeSet::hasAttribute(unsigned int,
> llvm::Attribute::AttrKind) const'
> /home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so: undefined reference
> to `llvm::LoopBase::getLoopLatch() const'
> .
>
> If I only execute julia-config for flags, and I use these flags to cook up
> g++ script, and the g++ script got me the same problems.
>
> > $JULIA_DIR/share/julia/julia-config.jl --cflags --ldflags --ldlibs
> -DJULIA_ENABLE_THREADING=1 -fPIC -DJULIA_INIT_DIR=\"/home/xxx/
> Software/julia-9c76c3e89a/lib\" -I/home/xxx/Software/julia-
> 9c76c3e89a/include/julia
> -L/home/xxx/Software/julia-9c76c3e89a/lib
> -Wl,-rpath,/home/xxx/Software/julia-9c76c3e89a/lib -ljulia
>
> The output for --ldflags is clearly incorrect or incomplete for my
> installation on Ubuntu.  The script that generally works for me is the
> following, where some extra things have to be set.
>
> > g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/
> -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia $JULIA_DIR/lib/julia/libstdc++
> .so.6
>


The two compilation appears to be running against two independent
installation and they are not comparable. Assuming the private libraries
are found in lib/julia the julia-config.jl script should probably be
updated to include it though.


>
>
> On Saturday, September 10, 2016 at 7:06:34 PM UTC+8, Yichao Yu wrote:
>>
>>
>>
>> On Sat, Sep 10, 2016 at 6:56 AM, K leo  wrote:
>>
>>> I tried to compile the code with the GC statements, but got a bunch of
>>> error regarding jl_tls_states:
>>>
>>
>>
>> Use julia-config.jl to determine your compile flags.
>>
>>
>>>
>>> test6.cpp:(.text+0xd5): undefined reference to `jl_tls_states'
>>>
>>> The compile script is as follows:
>>> g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/
>>> -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia $JULIA_DIR/lib/julia/libstdc++
>>> .so.6
>>>
>>> Where is `jl_tls_states' defined?
>>>
>>>
>>> On Saturday, September 10, 2016 at 5:20:02 PM UTC+8, Bart Janssens wrote:

 I just realise I made a typo, the rooting should be done using:  (note
 the &)

 JL_GC_PUSH2(,);

 Op za 10 sep. 2016 02:36 schreef K leo :

> Bart,
>
> Can you explain what you mean by "need to be rooted"?  The
> jl_new_struct statement as Isaiah suggested works, why do we need the
> additional statements as you suggested?
>
>>



>>
>>


Re: [julia-users] [JuliaOpt] Beginner questions?

2016-09-10 Thread Michele Zaffalon
There is the julia-opt forum:
https://groups.google.com/forum/#!forum/julia-opt

On Sat, Sep 10, 2016 at 2:38 PM, Colin Beckingham 
wrote:

> OK for Optim beginner questions here?
>


Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread Bart Janssens
The concrete error you got is probably due to the missing
-DJULIA_ENABLE_THREADING.

Op za 10 sep. 2016 14:53 schreef K leo :

>  julia-config.jl is hardly useful at all.  I unpacked the Linux binary of
> Julia (0.5) in ~/Software/julia-9c76c3e89a, and I set JULIA_DIR
> accordingly. When I execute julia-config in the following way, I
>


Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread K leo
 julia-config.jl is hardly useful at all.  I unpacked the Linux binary of 
Julia (0.5) in ~/Software/julia-9c76c3e89a, and I set JULIA_DIR 
accordingly. When I execute julia-config in the following way, I got all 
kinds of "undefined reference to" error messages.

> $JULIA_DIR/share/julia/julia-config.jl --cflags --ldflags --ldlibs | 
xargs g++ test6.cpp
/usr/bin/ld: warning: libLLVM-3.7.1.so, needed by 
/home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so, not found (try using 
-rpath or -rpath-link)
/home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so: undefined reference to 
`llvm::AttributeSet::hasAttribute(unsigned int, llvm::Attribute::AttrKind) 
const'
/home/xxx/Software/julia-9c76c3e89a/lib/libjulia.so: undefined reference to 
`llvm::LoopBase::getLoopLatch() const'
.

If I only execute julia-config for flags, and I use these flags to cook up 
g++ script, and the g++ script got me the same problems.

> $JULIA_DIR/share/julia/julia-config.jl --cflags --ldflags --ldlibs 
-DJULIA_ENABLE_THREADING=1 -fPIC 
-DJULIA_INIT_DIR=\"/home/xxx/Software/julia-9c76c3e89a/lib\" 
-I/home/xxx/Software/julia-9c76c3e89a/include/julia
-L/home/xxx/Software/julia-9c76c3e89a/lib
-Wl,-rpath,/home/xxx/Software/julia-9c76c3e89a/lib -ljulia

The output for --ldflags is clearly incorrect or incomplete for my 
installation on Ubuntu.  The script that generally works for me is the 
following, where some extra things have to be set.

> g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/ 
-L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia 
$JULIA_DIR/lib/julia/libstdc++.so.6


On Saturday, September 10, 2016 at 7:06:34 PM UTC+8, Yichao Yu wrote:
>
>
>
> On Sat, Sep 10, 2016 at 6:56 AM, K leo  
> wrote:
>
>> I tried to compile the code with the GC statements, but got a bunch of 
>> error regarding jl_tls_states:
>>
>
>
> Use julia-config.jl to determine your compile flags.
>  
>
>>
>> test6.cpp:(.text+0xd5): undefined reference to `jl_tls_states'
>>
>> The compile script is as follows:
>> g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/ 
>> -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia 
>> $JULIA_DIR/lib/julia/libstdc++.so.6
>>
>> Where is `jl_tls_states' defined?
>>
>>
>> On Saturday, September 10, 2016 at 5:20:02 PM UTC+8, Bart Janssens wrote:
>>>
>>> I just realise I made a typo, the rooting should be done using:  (note 
>>> the &)
>>>
>>> JL_GC_PUSH2(,);
>>>
>>> Op za 10 sep. 2016 02:36 schreef K leo :
>>>
 Bart,

 Can you explain what you mean by "need to be rooted"?  The 
 jl_new_struct statement as Isaiah suggested works, why do we need the 
 additional statements as you suggested?

>
>>>
>>>
>>>
>
>

Re: [julia-users] Re: Parallel computing and type-stability

2016-09-10 Thread Sleort
I see. Thanks for the information! 


[julia-users] [JuliaOpt] Beginner questions?

2016-09-10 Thread Colin Beckingham
OK for Optim beginner questions here?


Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Michele Zaffalon
You mean they are not simply permuted? Can you report the MATLAB and Julia
results in the two cases for a small covX matrix?

On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier <
dennis.eckme...@neuro.fchampalimaud.org> wrote:

> Hi,
>
> I am new to Julia and rather lay in math. For practice, I am translating a
> Matlab script (written by somebody else) and compare the result of each
> step in Matlab and Julia.
>
> The Matlab script uses  [V,D] = eig(covX);
>
> which I translated to Julia as: (D,V) = eig(covX)
>
> However, the outcomes don't match, although covX is the same.
>
> D.
>
>
>


Re: [julia-users] Re: ProfileView not compatible with julia-0.5?

2016-09-10 Thread Tim Holy
More likely you just need to run Pkg.update(). For example, you can test with a 
"dummy" 
package repository:

$ mkdir /tmp/pkgs 
*  _* 
*  _   _ _(_)_ |  A fresh approach to technical computing* 
* (_) | (_) (_)|  Documentation: http://docs.julialang.org* 
*  _ _   _| |_  __ _   |  Type "?help" for help.* 
* | | | | | | |/ _` |  |* 
* | | |_| | | | (_| |  |  Version 0.5.0-rc3+49 (2016-09-08 05:47 UTC)* 
*_/ |\__'_|_|_|\__'_|  |  Commit e1d2965* (2 days old release-0.5)* 
*|__/   |  x86_64-linux-gnu* 
*julia> Pkg.init()* 
*INFO: Initializing package repository /tmp/pkgs/v0.5* 
*INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl*  




 
*julia> Pkg.add("ProfileView")* 
*INFO: Cloning cache of BinDeps from 
https://github.com/JuliaLang/BinDeps.jl.git* 


and the install & build succeeds.

Best,
--Tim

On Friday, September 9, 2016 3:20:03 PM CDT Chris Rackauckas wrote:
> Did you checkout master?
> 
> On Friday, September 9, 2016 at 2:55:21 PM UTC-7, Neal Becker wrote:
> > using ProfileView
> > INFO: Precompiling module ProfileView.
> > WARNING: Module Compat with uuid 314389968181888 is missing from the
> > cache.
> > This may mean module Compat does not support precompilation but is
> > imported
> > by a module that does.
> > ERROR: LoadError: Declaring __precompile__(false) is not allowed in files
> > that are being precompiled.
> > 
> >  in macro expansion; at ./none:2 [inlined]
> >  in anonymous at ./:?
> > 
> > while loading /home/nbecker/.julia/v0.5/ProfileView/src/ProfileView.jl, in
> > expression starting on line 5
> > ERROR: Failed to precompile ProfileView to
> > /home/nbecker/.julia/lib/v0.5/ProfileView.ji.
> > 
> >  in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
> >  in macro expansion at ./REPL.jl:95 [inlined]
> >  in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68




Re: [julia-users] Re: Cell array of images like Matlab

2016-09-10 Thread Tim Holy
Try putting a semicolon at the end of that line.

Thanks for the bug report! https://github.com/timholy/Images.jl/issues/554

--Tim

On Friday, September 9, 2016 5:18:45 PM CDT Drew Mahedy wrote:
> In Julia, if I try and concatenate two images together of type:
> 
> Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2} via
> 
> cat( 3, img, img ),
> 
> I get the following error:
> 
> Only two-dimensional images are supported
> 
> On Friday, September 9, 2016 at 5:01:39 PM UTC-7, Drew Mahedy wrote:
> > Here is what the code looks like in MATLAB:
> > 
> > AA = cell( size(trimcoorddir,1), 1 );
> > 
> > figpathdir2 = dir( strrep( figpath2, '\', filesep ) );
> > fignames2 = {figpathdir2.name};
> > 
> > for i = 1:length(trimcoorddir);
> > 
> > if all( strcmp( fignames2, trimcoord{i}.filename ) == 0 );
> > 
> > A = imread( strrep( [figpath, '\', trimcoord{i}.filename], '\',
> > 
> > filesep ) );
> > 
> > AA{i} = rgb2gray( A );
> > AA{i} = 255 - medfilt2( AA{i}, [25 25] ) + AA{i};  %Time
> > Consuming!
> > AA{i} = imadjust( AA{i}, [0.96 1], [0 1], 1.0 );
> > 
> > imwrite( AA{i}, strrep( [figpath2, '\', trimcoord{i}.filename],
> > 
> > '\', filesep ) );
> > 
> > else
> > 
> > AA{i} = imread( strrep( [figpath2, '\', trimcoord{i}.filename],
> > 
> > '\', filesep ) );
> > 
> > end
> > 
> > end
> > 
> > On Wednesday, September 7, 2016 at 7:24:14 PM UTC-7, Uwe Fechner wrote:
> >> Could you post code, that reproduces the problem?
> >> 
> >> On Thursday, September 8, 2016 at 1:28:00 AM UTC+2, Drew Mahedy wrote:
> >>> I'm just wondering if there is a way to load several RGB .jpg images
> >>> into a 4-D array like can be done in MATLAB using cell array. I have the
> >>> Images package installed but concatenating 2 images in the 3rd or 4th
> >>> dimension says that 'only two-dimensional images are supported in
> >>> assert2d'
> >>> when I try.




[julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread Dennis Eckmeier
Hi,

I am new to Julia and rather lay in math. For practice, I am translating a 
Matlab script (written by somebody else) and compare the result of each 
step in Matlab and Julia.

The Matlab script uses  [V,D] = eig(covX);

which I translated to Julia as: (D,V) = eig(covX)

However, the outcomes don't match, although covX is the same.

D.




Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread Kristoffer Carlsson
Be aware 
of https://github.com/JuliaLang/julia/issues/14577#issuecomment-228568059 
though

On Saturday, September 10, 2016 at 1:06:34 PM UTC+2, Yichao Yu wrote:
>
>
>
> On Sat, Sep 10, 2016 at 6:56 AM, K leo  
> wrote:
>
>> I tried to compile the code with the GC statements, but got a bunch of 
>> error regarding jl_tls_states:
>>
>
>
> Use julia-config.jl to determine your compile flags.
>  
>
>>
>> test6.cpp:(.text+0xd5): undefined reference to `jl_tls_states'
>>
>> The compile script is as follows:
>> g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/ 
>> -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia 
>> $JULIA_DIR/lib/julia/libstdc++.so.6
>>
>> Where is `jl_tls_states' defined?
>>
>>
>> On Saturday, September 10, 2016 at 5:20:02 PM UTC+8, Bart Janssens wrote:
>>>
>>> I just realise I made a typo, the rooting should be done using:  (note 
>>> the &)
>>>
>>> JL_GC_PUSH2(,);
>>>
>>> Op za 10 sep. 2016 02:36 schreef K leo :
>>>
 Bart,

 Can you explain what you mean by "need to be rooted"?  The 
 jl_new_struct statement as Isaiah suggested works, why do we need the 
 additional statements as you suggested?

>
>>>
>>>
>>>
>
>

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 6:56 AM, K leo  wrote:

> I tried to compile the code with the GC statements, but got a bunch of
> error regarding jl_tls_states:
>


Use julia-config.jl to determine your compile flags.


>
> test6.cpp:(.text+0xd5): undefined reference to `jl_tls_states'
>
> The compile script is as follows:
> g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/
> -L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia $JULIA_DIR/lib/julia/libstdc++
> .so.6
>
> Where is `jl_tls_states' defined?
>
>
> On Saturday, September 10, 2016 at 5:20:02 PM UTC+8, Bart Janssens wrote:
>>
>> I just realise I made a typo, the rooting should be done using:  (note
>> the &)
>>
>> JL_GC_PUSH2(,);
>>
>> Op za 10 sep. 2016 02:36 schreef K leo :
>>
>>> Bart,
>>>
>>> Can you explain what you mean by "need to be rooted"?  The jl_new_struct
>>> statement as Isaiah suggested works, why do we need the additional
>>> statements as you suggested?
>>>

>>
>>
>>



Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread K leo
I tried to compile the code with the GC statements, but got a bunch of 
error regarding jl_tls_states:

test6.cpp:(.text+0xd5): undefined reference to `jl_tls_states'

The compile script is as follows:
g++ -o test -fPIC -I$JULIA_DIR/include/julia test6.cpp -L$JULIA_DIR/lib/ 
-L$JULIA_DIR/lib/julia -lLLVM-3.7.1 -ljulia 
$JULIA_DIR/lib/julia/libstdc++.so.6

Where is `jl_tls_states' defined?


On Saturday, September 10, 2016 at 5:20:02 PM UTC+8, Bart Janssens wrote:
>
> I just realise I made a typo, the rooting should be done using:  (note the 
> &)
>
> JL_GC_PUSH2(,);
>
> Op za 10 sep. 2016 02:36 schreef K leo :
>
>> Bart,
>>
>> Can you explain what you mean by "need to be rooted"?  The jl_new_struct 
>> statement as Isaiah suggested works, why do we need the additional 
>> statements as you suggested?
>>
>>>
>
>
>
>>>

Re: [julia-users] Re: Parallel computing and type-stability

2016-09-10 Thread Yichao Yu
On Fri, Sep 9, 2016 at 11:16 PM, Sleort  wrote:

> @Yichao Yu: Sure. I'm aware that there is a lot of overhead in the inter
> process communication. This was just a minimal test case, not something I
> expect to run fast(er). (A silly nworker() implementation indeed;-)) I was
> just curious if it is possible to reduce the type instability showing up in
> parallel programming situations like this (and others). One reason is that
> such a type instability seem to "mask" @time results (number of allocations
> and memory usage is typically much larger for type unstable code, right?),
> making it harder to get a quick idea of the performance/type stability of
> parts of the code that really matters...
>
> @Richard Dennis: That's interesting! Do you (or anyone else) have an idea
> why? What is updated/changed in 0.5.0-rc4 compared to 0.4.6?
>

Inlining an printing. No type instability is changed and it doesn't matter.


[julia-users] Slow Performance Compared to MATLAB

2016-09-10 Thread Lutfullah Tomak
Ome minor thing minimum([a,b]) -> min(a,b).
Relevant parts of documentation for performance issues
http://docs.julialang.org/en/release-0.5/manual/faq/
http://docs.julialang.org/en/release-0.5/manual/performance-tips/
http://docs.julialang.org/en/release-0.5/manual/noteworthy-differences/

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-10 Thread Bart Janssens
I just realise I made a typo, the rooting should be done using:  (note the
&)

JL_GC_PUSH2(,);

Op za 10 sep. 2016 02:36 schreef K leo :

> Bart,
>
> Can you explain what you mean by "need to be rooted"?  The jl_new_struct
> statement as Isaiah suggested works, why do we need the additional
> statements as you suggested?
>
>>



>>


[julia-users] Slow Performance Compared to MATLAB

2016-09-10 Thread Lutfullah Tomak
Lots of lots of can be done for improvements over there. First of most indexing 
with [:,i] allocates a lot of temporaries in this code. At least, you could do 
size(vertex,i) instead of length(vertex[:,i]). Some of variables initialized 
like a=[], it is dangerous since it makes element type of it Any. If you know 
the element type of a, do it like a=TypeOfa[]. These are my observings.

[julia-users] Re: Cannot start Julia in Atom

2016-09-10 Thread Chris Rackauckas
The context is 
important: 
http://stackoverflow.com/questions/39419502/cannot-start-julia-in-atom-loaderror-argumenterror-juno-not-found-in-path/39420874#39420874

Or the bottom of 
this: https://gitter.im/JunoLab/atom-ink/archives/2016/09/09

It's known. It's a bad tag. Either just clone Juno.jl or wait for the tag.

On Friday, September 9, 2016 at 8:13:05 PM UTC-7, Yuanchu Dang wrote:
>
> ERROR: LoadError: ArgumentError: Juno not found in path
>  in require at loading.jl:249
>  in include at boot.jl:261
>  in include_from_node1 at loading.jl:320
>  in process_options at client.jl:280
>  in _start at client.jl:378
> while loading C:\Users\think\.atom\packages\julia-client\script\boot.jl, 
> in expression starting on line 36
>


Re: [julia-users] Re: Apparently I need to rebuild Julia?

2016-09-10 Thread Yaakov Borstein
as of sep 10 this remains the quickest solution

On Wednesday, September 7, 2016 at 10:34:15 PM UTC+3, Loic Chappaz wrote:
>
> Hi there,
>
> I just had the same issue under Ubuntu 14 and a fresh Julia 0.4.6 install.
> It seems that Ubuntu updated my gmp library to version 6.1.0 during the 
> last round of updates and that does not seem to agree with Julia (Even 
> after reinstalling it from the PPA after uninstalling it)
>
> To solve it: I simply downgraded gmp back to 5.1.3 using: `sudo apt-get 
> install libgmp10=2:5.1.3+dfsg-1ubuntu1`
> and finding the proper version name using:  `apt-cache showpkg libgmp10`
> And that works fine.
> I also did: `sudo apt-mark hold libgmp10` to keep it from automatically 
> updating next time around.
>
> There's likely a better fix than that though, as I'm no Linux guru.
>
> Cheers,
> Loic
>
>
> On Friday, September 2, 2016 at 8:52:48 AM UTC-7, Andre Bieler wrote:
>>
>> All works fine if I download the binary from 
>> http://julialang.org/downloads/
>>
>

[julia-users] Re: Slow Performance Compared to MATLAB

2016-09-10 Thread Chris Rackauckas
I can't get this to run because of a dimension mismatch error. Was this 
written for v0.4? I am using v0.5 and there is a difference in how it drops 
extra dimensions which may be the cause.

On Friday, September 9, 2016 at 8:13:00 PM UTC-7, Zhilong Liu wrote:
>
> Hello All,
>
> I am trying to convert a MATLAB script into Julia, hoping that it will run 
> faster. But after the conversion, it runs about 3 to 4 times slower than 
> MATLAB.
>
> I attached the relevant files here. The problem seems to be from line 297 
> in OUM.jl from the profiler information. But I have no idea how to make it 
> run faster. Anybody can help?
>
>
> Thanks!
>
> Zhilong Liu
>
>
>

[julia-users] Re: Installation error

2016-09-10 Thread Chris Rackauckas
Run Pkg.update()? For some reason Atom isn't in your METADATA, so it's 
either old or corrupted.

On Friday, September 9, 2016 at 8:13:05 PM UTC-7, Yuanchu Dang wrote:
>
> Was told:
>
> Error installing Atom.jl package
> Go to the Packages → Julia → Open Terminal menu and
> run `Pkg.add("Atom")` in Julia, then try again.
> If you still see an issue, please report it to:
> julia...@googlegroups.com 
>
> But doesn't work:
>
>
> 
>
>

[julia-users] Re: Maps in Julia?

2016-09-10 Thread Kaj Wiik
Perfect, thanks!

Kaj

On Saturday, September 10, 2016 at 1:30:49 AM UTC+3, Andy Ferris wrote:
>
> ... and transform geographic coordinates (GNSS logger lat, lon) to UTM 
>> (cartesian, unit = metre) by calling libgeographic.
>>
>
> Geodesy.jl now has a native port of libgeographics UTM conversion code - 
> you might possibly find that convenient.
>
> Andy
>


[julia-users] Re: Cell array of images like Matlab

2016-09-10 Thread Matt Bauman
I cannot reproduce that error, and I know that the lead author of Images 
uses stacked image arrays quite frequently.

julia> using TestImages, Images
   src = testimage("mandrill")
   arr = convert(Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8
}},2}, src)
   cat(3, arr, arr)
512x512x2 Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},3}:
...

julia>img = Image(arr)
   cat(3, img, img)
Gray Images.Image with:
  data: 512x512x2 Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},3
}
…

Are you doing this in an IJulia notebook?  It may be that the error you're 
seeing is simply that IJulia doesn't know how to display a stack of images.

On another note, the Julia equivalent to a cell array is an `Any[]` array, 
which is quite different from concatenating the images together in a higher 
dimension.  You can even use the Matlab-like `cell( size(trimcoorddir,1) )` 
to initialize an array that can hold anything like a cell array.

, 
On Friday, September 9, 2016 at 7:19:19 PM UTC-5, Drew Mahedy wrote:
>
> In Julia, if I try and concatenate two images together of type:
>
> Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2} via
>
> cat( 3, img, img ),
>
> I get the following error:
>
> Only two-dimensional images are supported
>
> On Wednesday, September 7, 2016 at 7:24:14 PM UTC-7, Uwe Fechner wrote:
>>
>> Could you post code, that reproduces the problem? 
>>
>> On Thursday, September 8, 2016 at 1:28:00 AM UTC+2, Drew Mahedy wrote:
>>>
>>> I'm just wondering if there is a way to load several RGB .jpg images 
>>> into a 4-D array like can be done in MATLAB using cell array. I have the 
>>> Images package installed but concatenating 2 images in the 3rd or 4th 
>>> dimension says that 'only two-dimensional images are supported in assert2d' 
>>> when I try.
>>>
>>

[julia-users] Re: Cell array of images like Matlab

2016-09-10 Thread Uwe Fechner
Sorry, but this is not a complete example that I could run to reproduce the 
problem.

On Saturday, September 10, 2016 at 2:19:19 AM UTC+2, Drew Mahedy wrote:
>
> In Julia, if I try and concatenate two images together of type:
>
> Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2} via
>
> cat( 3, img, img ),
>
> I get the following error:
>
> Only two-dimensional images are supported
>
> On Wednesday, September 7, 2016 at 7:24:14 PM UTC-7, Uwe Fechner wrote:
>>
>> Could you post code, that reproduces the problem? 
>>
>> On Thursday, September 8, 2016 at 1:28:00 AM UTC+2, Drew Mahedy wrote:
>>>
>>> I'm just wondering if there is a way to load several RGB .jpg images 
>>> into a 4-D array like can be done in MATLAB using cell array. I have the 
>>> Images package installed but concatenating 2 images in the 3rd or 4th 
>>> dimension says that 'only two-dimensional images are supported in assert2d' 
>>> when I try.
>>>
>>