Re: [julia-users] Re: unknown option root

2015-10-12 Thread 'Stéphane Laurent' via julia-users
Just found that, this is exactly my bug: 
https://bugzilla.redhat.com/show_bug.cgi?id=1200381



Re: [julia-users] Re: unknown option root

2015-10-12 Thread 'Stéphane Laurent' via julia-users
I am not comfortable with Linux. Following the link below, do I have to 
remove something before doing *yum install xscreensaver* ?

Le lundi 12 octobre 2015 11:56:02 UTC+2, Stéphane Laurent a écrit :
>
> Just found that, this is exactly my bug: 
> https://bugzilla.redhat.com/show_bug.cgi?id=1200381
>
>

Re: [julia-users] Re: unknown option root

2015-10-12 Thread 'Stéphane Laurent' via julia-users
Thank you. I tried this: 
http://askubuntu.com/questions/111422/how-to-find-zombie-process
But I got nothing.


Le lundi 12 octobre 2015 03:40:44 UTC+2, Isaiah a écrit :
>
> I am not using Julia in the session.
>
>
> Check `ps` for a zombie process? 
>
> On Sun, Oct 11, 2015 at 3:40 PM, 'Stéphane Laurent' via julia-users <
> julia...@googlegroups.com > wrote:
>
>> I get the beginning of the message ;
>>
>>
>>> *Error unknown option: --rootin: process_options at ./client.jl:255*
>>
>>
>> There is also a message about start.jl, but I didn't get the time to 
>> write it.
>>
>
>

Re: [julia-users] Re: unknown option root

2015-10-12 Thread 'Stéphane Laurent' via julia-users
Ok, done. Thank you.
Now I wait and see.

Le lundi 12 octobre 2015 18:33:34 UTC+2, Pablo Zubieta a écrit :
>
> If you are running Ubuntu you should run
>
> sudo apt-get install xscreensaver-data-extra
>
> instead.
>


[julia-users] Re: unknown option root

2015-10-11 Thread 'Stéphane Laurent' via julia-users
I get the beginning of the message ;


> *Error unknown option: --rootin: process_options at ./client.jl:255*


There is also a message about start.jl, but I didn't get the time to write 
it.


[julia-users] unknown option root

2015-10-10 Thread 'Stéphane Laurent' via julia-users
Hello,
Sometimes when my screen switches to save mode (I'm using LXDE desktop on 
Ubuntu), I get a message like :

unknown option --root
> in client.jl


This is not the exact message (next time I see it I will update this post). 
And I am not using Julia in the session.



Re: [julia-users] Re: julia unable to install on Ubuntu 13.10

2015-01-18 Thread 'Stéphane Laurent' via julia-users
Oh nice, I have installed cmake and that works.
Wasn't cmake required before ? I'm surprised it was not installed.


Le dimanche 18 janvier 2015 13:11:35 UTC+1, Stéphane Laurent a écrit :

 Hello,
 Currently my pc always freezes, so I use the console mode and I don't know 
 how to copy-paste the output.  
 I remember something like cmake not found, but I'm not sure.
 Isn't it better to install the latest 0.3 version rather than 0.4 ? 

 Le dimanche 18 janvier 2015 12:56:16 UTC+1, Milan Bouchet-Valat a écrit :

 Le dimanche 18 janvier 2015 à 03:54 -0800, 'Stéphane Laurent' via 
 julia-users a écrit : 
  Hello, he
  
  
   Since Julia version 0.4 this way does not work anymore : 
  git pull 
  make clean 
  make 
  
  
  There are some errors when doing make. Can I simply delete my julia 
  folder and reinstall ? 
 Of course you can, but there are probably other ways too. Can you post 
 the output you get somewhere? 


 Regards 

  Le mardi 20 mai 2014 12:46:41 UTC+2, Ivo Balbaert a écrit : 
  Sorry, message was posted too quickly: 
  
  
  Here is my report of the build: 
  in /home/ivo/julia: 
git clone git://github.com/JuliaLang/julia.git 
  cd julia 
  in /home/ivo/julia/julia: 
  make 
  
  
  /bin/sh: 2: g++: not found 
  make[2]: *** [/home/ivo/julia/julia/usr/lib/libgrisu.so] Error 
  127 
  make[1]: *** [julia-release] Error 2 
  make: *** [release] Error 2 
  -- sudo ap-get install build-essential 
  make 
  
  
  gfortran: command not found 
  -- sudo apt-get install gfortran 
  make 
  
  
  checking for suitable m4... configure: error: No usable m4 in 
  $PATH or /usr/5bin (see config.log for reasons). 
  -- sudo apt-get install m4 
  make 
  
  
  ./julia   OK! 
  
  
  To install latest version of Julia: 
  git pull 
  make clean 
  make 
  ./julia 
  
  Cheers, 
  Ivo 
  
  Op zaterdag 25 januari 2014 04:30:18 UTC+1 schreef Rajn: 
  After my several failed attempts to run PyPlot through 
  Julia in Windows, I decided to give up and try Linux. 
  Guess it was even worse. 
  
  First I added to regular repository (not the 
  nightlybuild) 
  then added the dep-repository 
  then updated and 
  then installed julia 
  
  Here's the latest: 
  Unpacking librmath-dev 
  (from 
 .../librmath-dev_2.15.2-juliadeps2~raring_amd64.deb) ... 
  dpkg: error 
  processing 
 /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
 (--unpack): 
   trying to overwrite '/usr/include/Rmath.h', which is 
  also in package r-mathlib 3.0.1-3ubuntu1 
  No apport report written because MaxReports is reached 
  already 
  
  Selecting previously unselected package julia. 
  Unpacking julia 
  (from .../julia_0.2.0~saucyfinal1_amd64.deb) ... 
  Processing triggers for man-db ... 
  Errors were encountered while processing: 
  
  /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
  E: Sub-process /usr/bin/dpkg returned an error code 
  (1) 
  
  Have no clue absolutely how to proceed. The same issue 
  occurs when I try nightly builds. 
  
  
  



[julia-users] Re: julia unable to install on Ubuntu 13.10

2015-01-18 Thread 'Stéphane Laurent' via julia-users
Hello, 

 Since Julia version 0.4 this way does not work anymore :

*git pull*
*make clean*
*make*


There are some errors when doing make. Can I simply delete my julia folder 
and reinstall ? 




Le mardi 20 mai 2014 12:46:41 UTC+2, Ivo Balbaert a écrit :

 Sorry, message was posted too quickly:

 Here is my report of the build:
 in /home/ivo/julia:
   git clone git://github.com/JuliaLang/julia.git
 cd julia
 in /home/ivo/julia/julia:
 make

 /bin/sh: 2: g++: not found
 make[2]: *** [/home/ivo/julia/julia/usr/lib/libgrisu.so] Error 127
 make[1]: *** [julia-release] Error 2
 make: *** [release] Error 2
 -- sudo ap-get install build-essential
 make

 gfortran: command not found
 -- sudo apt-get install gfortran
 make

 checking for suitable m4... configure: error: No usable m4 in $PATH or 
 /usr/5bin (see config.log for reasons).
 -- sudo apt-get install m4
 make

 ./julia   OK!

 To install latest version of Julia:
 git pull
 make clean
 make
 ./julia

 Cheers,
 Ivo

 Op zaterdag 25 januari 2014 04:30:18 UTC+1 schreef Rajn:

 After my several failed attempts to run PyPlot through Julia in Windows, 
 I decided to give up and try Linux.
 Guess it was even worse.

 First I added to regular repository (not the nightlybuild)
 then added the dep-repository
 then updated and
 then installed julia

 Here's the latest:
 Unpacking librmath-dev (from 
 .../librmath-dev_2.15.2-juliadeps2~raring_amd64.deb) ...
 dpkg: error processing 
 /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
 (--unpack):
  trying to overwrite '/usr/include/Rmath.h', which is also in package 
 r-mathlib 3.0.1-3ubuntu1
 No apport report written because MaxReports is reached already
   Selecting 
 previously unselected package julia.
 Unpacking julia (from .../julia_0.2.0~saucyfinal1_amd64.deb) ...
 Processing triggers for man-db ...
 Errors were encountered while processing:
  /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb
 E: Sub-process /usr/bin/dpkg returned an error code (1)

 Have no clue absolutely how to proceed. The same issue occurs when I try 
 nightly builds.




Re: [julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)

2014-09-25 Thread 'Stéphane Laurent' via julia-users
Also Liclipse : 
https://groups.google.com/forum/#!searchin/julia-users/liclipse/julia-users/cw0vLsHTUJk/Y5HO29VjpMQJ


Re: [julia-users] Support for Julia in Eclipse (LiClipse)

2014-07-11 Thread 'Stéphane Laurent' via julia-users
When I have two files in the same project, I source the first one by 
pressing F9, and if I source the second one then this is like a new 
session: everything sourced from the first file is forgotten. Is there a 
way to prevent that ?



Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-07-10 Thread 'Stéphane Laurent' via julia-users
Hello Sheehan,

 I get a failure with the following example, do you have an idea about the 
why ?:

*# solves u = phi²*sinh(u)-2u'/(x+gamma) ,  u'(a)=-xi,  u'(R)=0*
*a= 3.514457e-07*
*R= 7.60773e-07*
*x=Fun(identity, Interval(a,R))*
*d=x.domain*
*B=neumann(d)*
*D=diff(d)*
*# Solves Lu + g(u) == 0*
*phi=1.341211*
*gamma=0.8585931*
*L = D^2 + 2/(x.+gamma)*D*
*g = u - -phi^2*(exp(u)-exp(-u))/2; gp = u - -phi^2*(exp(u)+exp(-u))/2*

*u=0.x   #initial guess  *
*xi=9.403218*
*for k=1:5*
*u=u-[B,L+gp(u)]\[diff(u)[a]+xi,diff(u)[R],L*u+g(u)];*
*end*


*julia u*
*IFun{Float64,Interval{Float64}}([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN 
 … 
 
NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN],Interval{Float64}(3.514457e-7,7.60773e-7))*






Re: [julia-users] Support for Julia in Eclipse (LiClipse)

2014-07-10 Thread 'Stéphane Laurent' via julia-users
Thank you. I have successfully modified the julia.liclipse file. It works 
now.
S

Le lundi 30 juin 2014 02:16:26 UTC+2, Fabio Zadrozny a écrit :


 On Sunday, June 29, 2014 12:14:59 PM UTC-3, Stéphane Laurent wrote:

 I have just installed Eclipse and LiClipse, but now I don't see what to 
 do when I open a jl file. When typing F9 I get a message claiming julia is 
 not found, whereas it is on the PATH variable of my bashrc file.


 Well, if your PATH env variable is set in your bashrc file, you may need 
 to open a bash session and start LiClipse from the bash shell (as it'll 
 inherit the configurations from the shell that started it). Alternatively, 
 you may also update the run configuration to have the full path (i.e.: run 
  run configurations  select run configuration under 'liclipse launch' and 
 use the full path for the executable). 

 Or, for new launches, you may set the main path of the executable by 
 opening the julia.liclipse file (see 
 http://brainwy.github.io/liclipse/launch.html for details on the launch 
 section and http://brainwy.github.io/liclipse/supported_languages.html 
 for details on where the language files are located.
  
 Best Regards,

 Fabio



Re: [julia-users] Re: orthogonalize

2014-06-30 Thread 'Stéphane Laurent' via julia-users
A couple of years ago I used this function (maybe I copied the Matlab or 
Octave code, I don't remember):

*## similar to the Matlab orth() function*
*function orth(A)*
*  if (isempty (A))*
*retval = []*
*  else*
*(U, S, V) = svd(A) *
*(rows, cols) = size(A) *
*tol = max (size (A)) * S[1] * eps()*
*r = sum (S . tol)*
*if (r 0)*
*  retval = -U[:,1:r]*
*else*
*  retval = zeros(rows, 0);*
*end*
*  end*
*return(retval)*
*end*


Re: [julia-users] Re: orthogonalize

2014-06-30 Thread 'Stéphane Laurent' via julia-users
Ok sorry, I have deleted the code. BTW I have never really understand how 
some piece of code could be proprietary.

Le lundi 30 juin 2014 16:09:37 UTC+2, John Myles White a écrit :

 Please don’t post code whose copyright status is not 100% certain. If you 
 are even vaguely unsure, you are putting the community in needless danger.

 As a minimal example, it may be illegal for you to have written the e-mail 
 you just wrote.

  — John

 On Jun 30, 2014, at 7:07 AM, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com javascript: wrote:

 A couple of years ago I used this function (maybe I copied the Matlab or 
 Octave code, I don't remember):

 *## similar to the Matlab orth() function*
 *function orth(A)*
 *  if (isempty (A))*
 *retval = []*
 *  else*
 *(U, S, V) = svd(A) *
 *(rows, cols) = size(A) *
 *tol = max (size (A)) * S[1] * eps()*
 *r = sum (S . tol)*
 *if (r 0)*
 *  retval = -U[:,1:r]*
 *else*
 *  retval = zeros(rows, 0);*
 *end*
 *  end*
 *return(retval)*
 *end*




[julia-users] Re: global assignement in functions

2014-06-30 Thread 'Stéphane Laurent' via julia-users
You don't like my slides ? :-(
I'd like to know how to avoid the deepcopy at the beginning of 
updatePoly1().

Le dimanche 29 juin 2014 23:00:30 UTC+2, Stéphane Laurent a écrit :

 Thank you everyone for your reply. 

 But finally, what should I do ? My real function is shown on slide 16 
 here http://stla.github.io/JULIAGFI01/#1. Basically the function takes 
 an array and modifies two columns. I would also be glad to get your 
 comments about all the code shown in these slides. My functions work, but 
 I'm not sure I'm using the best practices. 



Re: [julia-users] Re: global assignement in functions

2014-06-30 Thread 'Stéphane Laurent' via julia-users
Ahh ok, thank you. I don't know why I was searching somrthing more 
complicated. 

Le lundi 30 juin 2014 17:01:16 UTC+2, Stefan Karpinski a écrit :

 Linking directly to the relevant slide is helpful:

 http://stla.github.io/JULIAGFI01/#16

 You don't need a deepcopy, just a copy; there's no way to avoid it if you 
 don't want to modify the original matrix. In R there's an implicit copy 
 that happens as soon as you modify the matrix so the only difference is 
 that the copy in Julia is explicit.


 On Mon, Jun 30, 2014 at 10:43 AM, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com javascript: wrote:

 You don't like my slides ? :-(
 I'd like to know how to avoid the deepcopy at the beginning of 
 updatePoly1().

 Le dimanche 29 juin 2014 23:00:30 UTC+2, Stéphane Laurent a écrit :

 Thank you everyone for your reply. 

 But finally, what should I do ? My real function is shown on slide 16 
 here http://stla.github.io/JULIAGFI01/#1. Basically the function 
 takes an array and modifies two columns. I would also be glad to get your 
 comments about all the code shown in these slides. My functions work, but 
 I'm not sure I'm using the best practices. 




[julia-users] Re: Support for Julia in Eclipse (LiClipse)

2014-06-29 Thread 'Stéphane Laurent' via julia-users
Cool !

*Note that to be installed, LiClipse requires Eclipse 4.3 (Kepler) 
 onwards. *


Do you know whether Eclipse 4.4 (Luna) is fine too ?



Le dimanche 29 juin 2014 04:13:20 UTC+2, Fabio Zadrozny a écrit :

 Hi Julia-users,

 Just wanted to let you know that LiClipse (which is mostly Eclipse plus 
 some customizations... see: http://brainwy.github.io/liclipse/) now has 
 support for Julia:


 http://liclipse.blogspot.com.br/2014/06/liclipse-10-released-julia-now-supported.html

 Hope Julia users like it.

 Note that the integration is 'lightweight' in Eclipse terms, so, it's 
 syntax highlighting, basic outline, (really) basic code-completion, 
 templates (LiClipse style: 
 http://brainwy.github.io/liclipse/templates.html), launching, hyperlink 
 in console, multi-edition (LiClipse style: 
 http://brainwy.github.io/liclipse/multi_edition_video.html) -- but on top 
 of that, you can use the Eclipse plugins you'd like (EGit, Mylyn, etc).

 Best Regards,

 Fabio



Re: [julia-users] Re: Capture the output of Julia's console

2014-06-29 Thread 'Stéphane Laurent' via julia-users
These days I have experienced Yihui's runr package and this is indeed not 
very satisfactory yet. 
Do you know whether we can straightforwardly get in Julia, the console 
output as a ready-to-print character string, for example here:

*julia [1,2,3]*
*3-element Array{Int64,1}:*
* 1*
* 2*
* 3*


I'd like to get:
 

*3-element Array{Int64,1}:\n 1\n 2 \n 3*





[julia-users] global assignement in functions

2014-06-29 Thread 'Stéphane Laurent' via julia-users
Hello, 

 As a R user I am a little puzzled by this behaviour:

*julia ftest = function(x) *
*x[2] = 0 *
*return x*
*   end*
*(anonymous function)*

*julia y = [1,2]*
*2-element Array{Int64,1}:*
* 1*
* 2*

*julia ftest(y)*
*2-element Array{Int64,1}:*
* 1*
* 0*

*julia y*
*2-element Array{Int64,1}:*
* 1*
* 0*


In R, this function doesn't modify the variable passed in the argument:

* f - function(x){ x[2] - 0; return(x)}*
* y=1:2*
* f(y)*
*[1] 1 0*
* y*
*[1] 1 2*

Please could you tell me whether this is a good solution :

*ftest = function(x) *
* x = deepcopy(x)*
* x[2] = 0 *
* return x*
*end*


[julia-users] Re: global assignement in functions

2014-06-29 Thread 'Stéphane Laurent' via julia-users
And please, could you explain why this behaviour occurs for the previous 
function but not for the following one:

*ftest2 = function(x) *
*x = x[[2,1]] *
*return x*
*end*




Re: [julia-users] Support for Julia in Eclipse (LiClipse)

2014-06-29 Thread 'Stéphane Laurent' via julia-users
I have just installed Eclipse and LiClipse, but now I don't see what to do 
when I open a jl file. When typing F9 I get a message claiming julia is not 
found, whereas it is on the PATH variable of my bashrc file.


[julia-users] Re: global assignement in functions

2014-06-29 Thread 'Stéphane Laurent' via julia-users
Thank you everyone for your reply. 

 But finally, what should I do ? My real function is shown on slide 16 here 
http://stla.github.io/JULIAGFI01/#1. Basically the function takes an 
array and modifies two columns. I would also be glad to get your comments 
about all the code shown in these slides. My functions work, but I'm not 
sure I'm using the best practices. 


[julia-users] Re: Capture the output of Julia's console

2014-06-25 Thread 'Stéphane Laurent' via julia-users
I really don't know how it works, but this is what Yihui Xie's R package 
runr https://github.com/yihui/runr does for R.


Re: [julia-users] Re: Julia T-shirt and Sticker

2014-06-25 Thread 'Stéphane Laurent' via julia-users
My ex-girl friend suspected me to use Julia because of an emotional 
attachment with a girl named Julia. Ok this was insanely jealous but I'll 
never wear such a T-shirt. 


Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-22 Thread 'Stéphane Laurent' via julia-users
Thank you for the explanations. Reading your papers is on my LOTTD. Some pub 
for you here http://stats.stackexchange.com/a/104290/8402 ;)


Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread 'Stéphane Laurent' via julia-users
Hello,

I'd like to solve this equation with Neumann boundary conditions. My code 
below does not work. Am I doing something bad or is it a failure of the 
Newton algorithm ?

*# solves u = (exp(u)-exp(-u))-2u'/(x+1) ,  u'(0)=-1,  u(1)=0*
*x=Fun(identity, Interval(0.,1.))*
*d=x.domain*
*B=neumann(d)*
*D=diff(d)*
*# Solves Lu + g(u)-1==0*
*L = D^2 + 2/(x.+1)*D*
*g = u - -(exp(u)-exp(-u)); gp = u - -(exp(u)+exp(-u))*

*u=-0.3*x+0.5**   #initial guess *

*for k=1:5 # this crashes if Ii increase the number of iterations*
*u=u-[B,L+gp(u)]\[-1.,0.,L*u+g(u)];*
*end*


The solution should look like that :

https://lh5.googleusercontent.com/-BCYNzh8ckCA/U6VIJcT2-tI/AGI/r08hknI2EIg/s1600/Screenshot+from+2014-06-21+10%3A37%3A46.png



Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread 'Stéphane Laurent' via julia-users
Ok, I understand. It works and it is really awesome. Thank you !


Le samedi 21 juin 2014 12:17:22 UTC+2, Sheehan Olver a écrit :

 Hi,


 You didn’t quite get the Newton iteration right: if you want to solve

 B u + [1,0] = 0
 L u + g(u) = 0

 then Newton iteration becomes

 u = u - [B, L + g’(u)]\[B u + [1,0], L u + g(u)]


 i.e., your bc right hand side is not right.  Below is the corrected code.

 Cheers,

 Sheehan



 x=Fun(identity, Interval(0.,1.))
 d=x.domain
 B=neumann(d)
 D=diff(d)
 # Solves Lu + g(u)-1==0
 L = D^2 + 2/(x.+1)*D
 g = u - -(exp(u)-exp(-u)); gp = u - -(exp(u)+exp(-u))

 u=-0.3*x+0.5   #initial guess 

 for k=1:5 # this crashes if Ii increase the number of iterations
 u=u-[B,L+gp(u)]\[diff(u)[0.]+1.,diff(u)[1.],L*u+g(u)];
 end

 plot(u)

 On 21 Jun 2014, at 6:54 pm, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com javascript: wrote:

 Hello,

 I'd like to solve this equation with Neumann boundary conditions. My code 
 below does not work. Am I doing something bad or is it a failure of the 
 Newton algorithm ?

 *# solves u = (exp(u)-exp(-u))-2u'/(x+1) ,  u'(0)=-1,  u(1)=0*
 *x=Fun(identity, Interval(0.,1.))*
 *d=x.domain*
 *B=neumann(d)*
 *D=diff(d)*
 *# Solves Lu + g(u)-1==0*
 *L = D^2 + 2/(x.+1)*D*
 *g = u - -(exp(u)-exp(-u)); gp = u - -(exp(u)+exp(-u))*

 *u=-0.3*x+0.5**   #initial guess *

 *for k=1:5 # this crashes if Ii increase the number of iterations*
 *u=u-[B,L+gp(u)]\[-1.,0.,L*u+g(u)];*
 *end*


 The solution should look like that :


 https://lh5.googleusercontent.com/-BCYNzh8ckCA/U6VIJcT2-tI/AGI/r08hknI2EIg/s1600/Screenshot+from+2014-06-21+10%3A37%3A46.png




Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread 'Stéphane Laurent' via julia-users
Sorry but I really don't understand you first sentence. 
About the code, I will possibly experiment it during the next days or 
weeks, and I'll send you some feedback. 
Thank you again for this library and your help.
- Stéphane

Le samedi 21 juin 2014 14:24:03 UTC+2, Sheehan Olver a écrit :

 Thanks! 

  I'm interested to know if the ultraspherical spectral approach has any 
 clear advantages over spectral collocation for nonlinear odes. (For linear 
 odes the advantages are clear.)

 So if you find the code better than expected please let me know.  It's a 
 bit buggy and unoptimized, so chances are you won't.

 Sent from my iPad

 On 21 Jun 2014, at 10:15 pm, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com javascript: wrote:

 Ok, I understand. It works and it is really awesome. Thank you !


 Le samedi 21 juin 2014 12:17:22 UTC+2, Sheehan Olver a écrit :

 Hi,


 You didn’t quite get the Newton iteration right: if you want to solve

 B u + [1,0] = 0
 L u + g(u) = 0

 then Newton iteration becomes

 u = u - [B, L + g’(u)]\[B u + [1,0], L u + g(u)]


 i.e., your bc right hand side is not right.  Below is the corrected code.

 Cheers,

 Sheehan



 x=Fun(identity, Interval(0.,1.))
 d=x.domain
 B=neumann(d)
 D=diff(d)
 # Solves Lu + g(u)-1==0
 L = D^2 + 2/(x.+1)*D
 g = u - -(exp(u)-exp(-u)); gp = u - -(exp(u)+exp(-u))

 u=-0.3*x+0.5   #initial guess 

 for k=1:5 # this crashes if Ii increase the number of iterations
 u=u-[B,L+gp(u)]\[diff(u)[0.]+1.,diff(u)[1.],L*u+g(u)];
 end

 plot(u)

 On 21 Jun 2014, at 6:54 pm, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com wrote:

 Hello,

 I'd like to solve this equation with Neumann boundary conditions. My code 
 below does not work. Am I doing something bad or is it a failure of the 
 Newton algorithm ?

 *# solves u = (exp(u)-exp(-u))-2u'/(x+1) ,  u'(0)=-1,  u(1)=0*
 *x=Fun(identity, Interval(0.,1.))*
 *d=x.domain*
 *B=neumann(d)*
 *D=diff(d)*
 *# Solves Lu + g(u)-1==0*
 *L = D^2 + 2/(x.+1)*D*
 *g = u - -(exp(u)-exp(-u)); gp = u - -(exp(u)+exp(-u))*

 *u=-0.3*x+0.5**   #initial guess *

 *for k=1:5 # this crashes if Ii increase the number of iterations*
 *u=u-[B,L+gp(u)]\[-1.,0.,L*u+g(u)];*
 *end*


 The solution should look like that :


 https://lh5.googleusercontent.com/-BCYNzh8ckCA/U6VIJcT2-tI/AGI/r08hknI2EIg/s1600/Screenshot+from+2014-06-21+10%3A37%3A46.png




Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-20 Thread 'Stéphane Laurent' via julia-users
Thank you, it works !!

NB: I'm Stéphane and not Stéphanie :-)


Le vendredi 20 juin 2014 00:13:08 UTC+2, Sheehan Olver a écrit :

 Hi Stephanie,

 Are you on the latest GitHub version? You can get on it with

 Pkg.checkout(ApproxFun)

 Sent from my iPad

 On 20 Jun 2014, at 3:19 am, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com javascript: wrote:

 Hello Sheehan,

  I get this error when I run your code:

 julia for k=1:5
u=u-[B,L+gp(u)]\[0.,0.,L*u+g(u)-1.];
end
 ERROR: Reducing over an empty array is not allowed.
  in _mapreduce at reduce.jl:151
  in mapreduce at reduce.jl:173
  in old_addentries! at 
 /home/sdl/.julia/v0.3/ApproxFun/src/Operators/OperatorAlgebra.jl:106
  in addentries! at 
 /home/sdl/.julia/v0.3/ApproxFun/src/Operators/OperatorAlgebra.jl:141
  in ShiftArray at 
 /home/sdl/.julia/v0.3/ApproxFun/src/Operators/ShiftArray.jl:16
  in BandedArray at 
 /home/sdl/.julia/v0.3/ApproxFun/src/Operators/ShiftArray.jl:110
  in getindex at 
 /home/sdl/.julia/v0.3/ApproxFun/src/Operators/Operator.jl:46
  in getindex at 
 /home/sdl/.julia/v0.3/ApproxFun/src/Operators/AlmostBandedOperator.jl:133
  in backsubstitution! at 
 /home/sdl/.julia/v0.3/ApproxFun/src/Operators/adaptiveqr.jl:78
  in ultraiconversion at 
 /home/sdl/.julia/v0.3/ApproxFun/src/Operators/Operator.jl:71
  in * at /home/sdl/.julia/v0.3/ApproxFun/src/Operators/Operator.jl:97
  in anonymous at no file:2



 Le mercredi 11 juin 2014 23:27:52 UTC+2, Sheehan Olver a écrit :

 Hi Stèphane,

 Nonlinear is not built in, but it’s easy enough to do by hand with Newton 
 iteration in function space.  Let me know if there is any confusion with 
 the code below.  I suppose I could just add a “nonlinsolve” routine that 
 bundles this up.  

 (I am on the latest branch so this may or may not work on the 0.0.1 tag.)


 Cheers,

 Sheehan



 x=Fun(identity,[-1.,1.])
 d=x.domain
 B=dirichlet(d) 
 D=diff(d)

 # Sets up L and g for equation in the form Lu + g(u)-1==0

 L=D^2 + 2(1-x.^2)*D
 g=u-u.^2;gp=u-2u

 u=0.x   # initial guess for the solution is zero

 for k=1:5
 u=u-[B,L+gp(u)]\[0.,0.,L*u+g(u)-1.];
 end

 norm(diff(u,2) + 2(1-x.^2).*diff(u) + g(u) -1)  # This equals 0.0


 On 12 Jun 2014, at 1:02 am, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com wrote:

 Hello Sheehan, 

  I have unsuccessfully tried to understand how works the differential 
 equation solver (I do not understand the Airy example).

 It would be nice to have an example of code for a simple BVP such as :

 u + 2(1-x^2)u + u^2 = 1 ,  u(-1) = u(1) = 0


 Regards,
 Stéphane

 Le lundi 24 mars 2014 02:04:25 UTC+1, Sheehan Olver a écrit :


 I tagged a new release for ApproxFun (
 https://github.com/dlfivefifty/ApproxFun) with major new features that 
 might interest people.  Below are ODE solving and random number sampling 
 examples, find more in ApproxFun/examples.  The code is meant as alpha 
 quality, so don't expect too much beyond the examples.  There is 
 rudimentary support for PDE solving (e.g. Helmholtz in a square), but it's 
 reliability is limited without a better Lyapanov solver (
 https://github.com/JuliaLang/julia/issues/5814).  

 Cheers,

 Sheehan




 Pkg.add(ApproxFun)
 using ApproxFun

 *ODE Solving: solve the Airy equation on [-1000,10]*

 x=Fun(identity,[-2000.,10.])
 d=x.domain
 D=diff(d)
 ai=[dirichlet(d),D^2 - x]\[airyai(-2000.),0.]
 plot(ai)




 *Random number sampling: Sample a 2D Cauchy distribution on (-∞,∞)^2*

  f = Fun2D((x,y)-1./(2π.*(x.^2 .+ y.^2 .+ 1).^(3/2)),Line(),Line())
 r = sample(f,100)





Re: Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-19 Thread 'Stéphane Laurent' via julia-users
Hello Sheehan,

 I get this error when I run your code:

julia for k=1:5
   u=u-[B,L+gp(u)]\[0.,0.,L*u+g(u)-1.];
   end
ERROR: Reducing over an empty array is not allowed.
 in _mapreduce at reduce.jl:151
 in mapreduce at reduce.jl:173
 in old_addentries! at 
/home/sdl/.julia/v0.3/ApproxFun/src/Operators/OperatorAlgebra.jl:106
 in addentries! at 
/home/sdl/.julia/v0.3/ApproxFun/src/Operators/OperatorAlgebra.jl:141
 in ShiftArray at 
/home/sdl/.julia/v0.3/ApproxFun/src/Operators/ShiftArray.jl:16
 in BandedArray at 
/home/sdl/.julia/v0.3/ApproxFun/src/Operators/ShiftArray.jl:110
 in getindex at /home/sdl/.julia/v0.3/ApproxFun/src/Operators/Operator.jl:46
 in getindex at 
/home/sdl/.julia/v0.3/ApproxFun/src/Operators/AlmostBandedOperator.jl:133
 in backsubstitution! at 
/home/sdl/.julia/v0.3/ApproxFun/src/Operators/adaptiveqr.jl:78
 in ultraiconversion at 
/home/sdl/.julia/v0.3/ApproxFun/src/Operators/Operator.jl:71
 in * at /home/sdl/.julia/v0.3/ApproxFun/src/Operators/Operator.jl:97
 in anonymous at no file:2



Le mercredi 11 juin 2014 23:27:52 UTC+2, Sheehan Olver a écrit :

 Hi Stèphane,

 Nonlinear is not built in, but it’s easy enough to do by hand with Newton 
 iteration in function space.  Let me know if there is any confusion with 
 the code below.  I suppose I could just add a “nonlinsolve” routine that 
 bundles this up.  

 (I am on the latest branch so this may or may not work on the 0.0.1 tag.)


 Cheers,

 Sheehan



 x=Fun(identity,[-1.,1.])
 d=x.domain
 B=dirichlet(d) 
 D=diff(d)

 # Sets up L and g for equation in the form Lu + g(u)-1==0

 L=D^2 + 2(1-x.^2)*D
 g=u-u.^2;gp=u-2u

 u=0.x   # initial guess for the solution is zero

 for k=1:5
 u=u-[B,L+gp(u)]\[0.,0.,L*u+g(u)-1.];
 end

 norm(diff(u,2) + 2(1-x.^2).*diff(u) + g(u) -1)  # This equals 0.0


 On 12 Jun 2014, at 1:02 am, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com javascript: wrote:

 Hello Sheehan, 

  I have unsuccessfully tried to understand how works the differential 
 equation solver (I do not understand the Airy example).

 It would be nice to have an example of code for a simple BVP such as :

 u + 2(1-x^2)u + u^2 = 1 ,  u(-1) = u(1) = 0


 Regards,
 Stéphane

 Le lundi 24 mars 2014 02:04:25 UTC+1, Sheehan Olver a écrit :


 I tagged a new release for ApproxFun (
 https://github.com/dlfivefifty/ApproxFun) with major new features that 
 might interest people.  Below are ODE solving and random number sampling 
 examples, find more in ApproxFun/examples.  The code is meant as alpha 
 quality, so don't expect too much beyond the examples.  There is 
 rudimentary support for PDE solving (e.g. Helmholtz in a square), but it's 
 reliability is limited without a better Lyapanov solver (
 https://github.com/JuliaLang/julia/issues/5814).  

 Cheers,

 Sheehan




 Pkg.add(ApproxFun)
 using ApproxFun

 *ODE Solving: solve the Airy equation on [-1000,10]*

 x=Fun(identity,[-2000.,10.])
 d=x.domain
 D=diff(d)
 ai=[dirichlet(d),D^2 - x]\[airyai(-2000.),0.]
 plot(ai)




 *Random number sampling: Sample a 2D Cauchy distribution on (-∞,∞)^2*

  f = Fun2D((x,y)-1./(2π.*(x.^2 .+ y.^2 .+ 1).^(3/2)),Line(),Line())
 r = sample(f,100)





Re: [julia-users] problem with Multinomial Distribution

2014-06-19 Thread 'Stéphane Laurent' via julia-users


Le jeudi 19 juin 2014 19:09:45 UTC+2, John Myles White a écrit :

 Maybe we should start removing all the default distributions. 


I agree a default binomial distribution is a strange concept. But the 
default Gaussian distribution is nice.  


[julia-users] Re: ApproxFun v0.0.1 with ODE solving

2014-06-12 Thread 'Stéphane Laurent' via julia-users
Thank you ! I will not try soon, but in the near future, I hope.
Stéphane


[julia-users] Re: ApproxFun v0.0.1 with ODE solving

2014-06-11 Thread 'Stéphane Laurent' via julia-users
Hello Sheehan, 

 I have unsuccessfully tried to understand how works the differential 
equation solver (I do not understand the Airy example).

It would be nice to have an example of code for a simple BVP such as :

u + 2(1-x^2)u + u^2 = 1 ,  u(-1) = u(1) = 0


Regards,
Stéphane

Le lundi 24 mars 2014 02:04:25 UTC+1, Sheehan Olver a écrit :


 I tagged a new release for ApproxFun (
 https://github.com/dlfivefifty/ApproxFun) with major new features that 
 might interest people.  Below are ODE solving and random number sampling 
 examples, find more in ApproxFun/examples.  The code is meant as alpha 
 quality, so don't expect too much beyond the examples.  There is 
 rudimentary support for PDE solving (e.g. Helmholtz in a square), but it's 
 reliability is limited without a better Lyapanov solver (
 https://github.com/JuliaLang/julia/issues/5814).  

 Cheers,

 Sheehan




 Pkg.add(ApproxFun)
 using ApproxFun

 *ODE Solving: solve the Airy equation on [-1000,10]*

 x=Fun(identity,[-2000.,10.])
 d=x.domain
 D=diff(d)
 ai=[dirichlet(d),D^2 - x]\[airyai(-2000.),0.]
 plot(ai)




 *Random number sampling: Sample a 2D Cauchy distribution on (-∞,∞)^2*

  f = Fun2D((x,y)-1./(2π.*(x.^2 .+ y.^2 .+ 1).^(3/2)),Line(),Line())
 r = sample(f,100)




Re: [julia-users] Re: ApproxFun v0.0.1 with ODE solving

2014-06-11 Thread 'Stéphane Laurent' via julia-users
Hmmm there' are more details here 
https://github.com/dlfivefifty/ApproxFun/blob/f0b1cd8e9bb1dacc99c198ea2b895d656749613f/examples/Airy%20equation.jl
 
about the Airy example. I think I understand now.


[julia-users] Re: Gadfly: adding plots to an existing plot

2014-06-10 Thread 'Stéphane Laurent' via julia-users
Hello is there something in Gadfly like the geom_abline() function in the 
ggplot2 R package to add a single line to an existing plot ?


Re: [julia-users] negative power throws error

2014-06-09 Thread 'Stéphane Laurent' via julia-users
A Float is a decimal number, hence it also is a rational number : 

*2.243423592592582385923 = 2243423592592582385923 / 10*


Hence, depending on the limitations about the sizes of the integers, the 
set Rational could be bigger than the set Float. In this case, the better 
approximation of an irrational is achieved by a Rational.



Le lundi 9 juin 2014 02:16:24 UTC+2, Miguel Bazdresch a écrit :

 Thanks -- I wasn't aware that a^b is irrational in general in this case. 
 Now I wonder if a Float is a better approximation to an irrational number 
 than a Rational.

 Of course, one could say that sqrt(a) is complex in general for real a, 
 but Julia returns a real. As Stefan says, some of these cases have no good 
 solutions, only less worse ones.

 -- mb


 On Sun, Jun 8, 2014 at 7:09 PM, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com javascript: wrote:

 If b is rational then a^b is irrational in general, even for a integer, 
 so this output is quite expected, as well as

 julia (10//1)^(2//1)

 100.0




 Le lundi 9 juin 2014 00:54:37 UTC+2, Miguel Bazdresch a écrit :

 I just tried this (on 0.2.1):

 julia (10//1)^(-2//1)
 0.01

 Is this expected?

 -- mb



 On Sun, Jun 8, 2014 at 6:36 PM, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com wrote:

 julia (10//1)^(-2)

 1//100


 Would it be problematic to return a rational 
 for  (a::Integer)^(b::Integer) ?



 Le dimanche 8 juin 2014 21:53:45 UTC+2, Stefan Karpinski a écrit :

 There are three obvious options for (a::Integer)^(b::Integer):

1. Always return an integer ⟹ fails for negative b.
2. Always return a float ⟹ a^2 is not the same as a*a.
3. Return float for negative b, integer otherwise ⟹ not 
type-stable. 

 As you can see, all of these choices are problematic. The first one, 
 which is what we currently do, seems to be the least problematic. One 
 somewhat crazier option that has been proposed is making ^- as in a^-b 
 parse as a different operator and have a^b return an integer for integer 
 arguments but a^-b return a float for integer arguments. This would have 
 the unfortunate effect of making a^-b different from a^(-b).


 On Sat, Jun 7, 2014 at 12:41 PM, Daniel Jones daniel...@gmail.com 
 wrote:

  I'd definitely be in favor of '^' converting to float, like '/', 
 having fallen for than recently 
 https://github.com/JuliaLang/Color.jl/commit/c3d05dd2b94f0d38b64ef86022accdfec886a673
 .
   
 On Sat, Jun 7, 2014, at 12:53 AM, Ivar Nesje wrote:
 
  There has also been discussion on whether ^(a::Integer,b::Integer) 
 should
  return a Float64 by default, and defer to pow() like /(a::Integer,
  b::Integer) defers to div(). The problem is that many people like 
 the
  10^45 vs 1e45 notation for large integers vs float constants, and 
 we can
  make it a clean error instead of a silent bug.
  
  





Re: [julia-users] negative power throws error

2014-06-09 Thread 'Stéphane Laurent' via julia-users
That's why we need BigRational https://github.com/andrioni/BigRationals.jl 
:)

Le lundi 9 juin 2014 12:52:48 UTC+2, Ivar Nesje a écrit :

 A float is a binary fraction, and can not represent most decimal fractions 
 exactly. 0.1 is a famous example of a decimal fraction that can not be 
 represented exactly in binary, just like 1/3 is impossible to represent in 
 decimal (0.3...)

 Rational can express many fractions exactly, but as soon as you start 
 working with irrational numbers there is no clear way to do rounding. 
 Rational also have a limited range compared to floating point, so you get 
 overflow (or underflow) much easier.

 kl. 11:13:06 UTC+2 mandag 9. juni 2014 skrev Stéphane Laurent følgende:

 A Float is a decimal number, hence it also is a rational number : 

 *2.243423592592582385923 = 2243423592592582385923 / 
 10*


 Hence, depending on the limitations about the sizes of the integers, the 
 set Rational could be bigger than the set Float. In this case, the better 
 approximation of an irrational is achieved by a Rational.



 Le lundi 9 juin 2014 02:16:24 UTC+2, Miguel Bazdresch a écrit :

 Thanks -- I wasn't aware that a^b is irrational in general in this case. 
 Now I wonder if a Float is a better approximation to an irrational number 
 than a Rational.

 Of course, one could say that sqrt(a) is complex in general for real a, 
 but Julia returns a real. As Stefan says, some of these cases have no good 
 solutions, only less worse ones.

 -- mb


 On Sun, Jun 8, 2014 at 7:09 PM, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com wrote:

 If b is rational then a^b is irrational in general, even for a integer, 
 so this output is quite expected, as well as

 julia (10//1)^(2//1)

 100.0




 Le lundi 9 juin 2014 00:54:37 UTC+2, Miguel Bazdresch a écrit :

 I just tried this (on 0.2.1):

 julia (10//1)^(-2//1)
 0.01

 Is this expected?

 -- mb



 On Sun, Jun 8, 2014 at 6:36 PM, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com wrote:

 julia (10//1)^(-2)

 1//100


 Would it be problematic to return a rational 
 for  (a::Integer)^(b::Integer) ?



 Le dimanche 8 juin 2014 21:53:45 UTC+2, Stefan Karpinski a écrit :

 There are three obvious options for (a::Integer)^(b::Integer):

1. Always return an integer ⟹ fails for negative b.
2. Always return a float ⟹ a^2 is not the same as a*a.
3. Return float for negative b, integer otherwise ⟹ not 
type-stable. 

 As you can see, all of these choices are problematic. The first one, 
 which is what we currently do, seems to be the least problematic. One 
 somewhat crazier option that has been proposed is making ^- as in a^-b 
 parse as a different operator and have a^b return an integer for 
 integer 
 arguments but a^-b return a float for integer arguments. This would 
 have 
 the unfortunate effect of making a^-b different from a^(-b).


 On Sat, Jun 7, 2014 at 12:41 PM, Daniel Jones daniel...@gmail.com 
 wrote:

  I'd definitely be in favor of '^' converting to float, like '/', 
 having fallen for than recently 
 https://github.com/JuliaLang/Color.jl/commit/c3d05dd2b94f0d38b64ef86022accdfec886a673
 .
   
 On Sat, Jun 7, 2014, at 12:53 AM, Ivar Nesje wrote:
 
  There has also been discussion on whether 
 ^(a::Integer,b::Integer) should
  return a Float64 by default, and defer to pow() like /(a::Integer,
  b::Integer) defers to div(). The problem is that many people like 
 the
  10^45 vs 1e45 notation for large integers vs float constants, and 
 we can
  make it a clean error instead of a silent bug.
  
  





Re: [julia-users] negative power throws error

2014-06-09 Thread 'Stéphane Laurent' via julia-users
More seriously, are there really no case in Julia like that :

*Return float for negative b, integer otherwise ⟹ not type-stable.*


? 

Otherwise, a better solution is to return Rational for negative, and Int 
for positive. Always returning Rational is not cool because we use positive 
numbers more often than negative ones.
In this way, *a^b would always return an exact result of the operation*. 
 These operations belong to arithmetic on integer numbers, and rounding 
has nothing to do here !
If i had a code performing some calculations on integer numbers, I would be 
sad to discover a Float in the output in the case when I forgot to handle 
the negative integers.

In this spirit, 

*10^-2.0*

 
is not the good reflex to have : it should be 

*(10//1)^-2*



[julia-users] duplicating the value of a variable

2014-06-09 Thread 'Stéphane Laurent' via julia-users
Hi,

 In a program I have some *n*1* arrays, say 

*A*
*B*
*C*
*D*


and in order to make a certain calculation, for convenience, I construct 
the array

*A B*
*B C*
*C D*
*D A*


There will be millions of such arrays generated by my final program, with 
*n* greater than 4 and the components A, B, C, D, ... are *BigFloat*.

Then I'm wondering how to optimize my copy from the first array to the 
second array. Is there something to gain performance when we duplicate some 
variables ?




[julia-users] Re: duplicating the value of a variable

2014-06-09 Thread 'Stéphane Laurent' via julia-users
Thank you, I will think about your proposal and take a look at ArrayViews 
in the near future.

- Stéphane


Le lundi 9 juin 2014 19:37:38 UTC+2, Stéphane Laurent a écrit :

 Hi,

  In a program I have some *n*1* arrays, say 

 *A*
 *B*
 *C*
 *D*


 and in order to make a certain calculation, for convenience, I construct 
 the array

 *A B*
 *B C*
 *C D*
 *D A*


 There will be millions of such arrays generated by my final program, with 
 *n* greater than 4 and the components A, B, C, D, ... are *BigFloat*.

 Then I'm wondering how to optimize my copy from the first array to the 
 second array. Is there something to gain performance when we duplicate some 
 variables ?




Re: [julia-users] Re: numerical solving of ODE with boundary values constraints

2014-06-05 Thread 'Stéphane Laurent' via julia-users
Thank you. I have tried to understand, but really unsuccessful (moreover 
the ApproxFun example given on github doesn't work).


Le mardi 20 mai 2014 11:55:35 UTC+2, Mauro a écrit :

 I can't help you but maybe it could help to look at the extensive 
 documentation for chebfun, the matlab original: 
 http://www2.maths.ox.ac.uk/chebfun/guide/ 

 On Tue, 2014-05-20 at 10:07, julia...@googlegroups.com javascript: 
 wrote: 
  Maybe, but I really don't understand this code :( 



[julia-users] Re: julia unable to install on Ubuntu 13.10

2014-05-22 Thread 'Stéphane Laurent' via julia-users
Excellent, I already had all the requited tools (gfortran, curl), and the 
installation has been successful. Thank you !


Le mardi 20 mai 2014 12:46:41 UTC+2, Ivo Balbaert a écrit :

 Sorry, message was posted too quickly:

 Here is my report of the build:
 in /home/ivo/julia:
   git clone git://github.com/JuliaLang/julia.git
 cd julia
 in /home/ivo/julia/julia:
 make

 /bin/sh: 2: g++: not found
 make[2]: *** [/home/ivo/julia/julia/usr/lib/libgrisu.so] Error 127
 make[1]: *** [julia-release] Error 2
 make: *** [release] Error 2
 -- sudo ap-get install build-essential
 make

 gfortran: command not found
 -- sudo apt-get install gfortran
 make

 checking for suitable m4... configure: error: No usable m4 in $PATH or 
 /usr/5bin (see config.log for reasons).
 -- sudo apt-get install m4
 make

 ./julia   OK!

 To install latest version of Julia:
 git pull
 make clean
 make
 ./julia

 Cheers,
 Ivo

 Op zaterdag 25 januari 2014 04:30:18 UTC+1 schreef Rajn:

 After my several failed attempts to run PyPlot through Julia in Windows, 
 I decided to give up and try Linux.
 Guess it was even worse.

 First I added to regular repository (not the nightlybuild)
 then added the dep-repository
 then updated and
 then installed julia

 Here's the latest:
 Unpacking librmath-dev (from 
 .../librmath-dev_2.15.2-juliadeps2~raring_amd64.deb) ...
 dpkg: error processing 
 /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
 (--unpack):
  trying to overwrite '/usr/include/Rmath.h', which is also in package 
 r-mathlib 3.0.1-3ubuntu1
 No apport report written because MaxReports is reached already
   Selecting 
 previously unselected package julia.
 Unpacking julia (from .../julia_0.2.0~saucyfinal1_amd64.deb) ...
 Processing triggers for man-db ...
 Errors were encountered while processing:
  /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb
 E: Sub-process /usr/bin/dpkg returned an error code (1)

 Have no clue absolutely how to proceed. The same issue occurs when I try 
 nightly builds.





[julia-users] Re: numerical solving of ODE with boundary values constraints

2014-05-20 Thread 'Stéphane Laurent' via julia-users
Maybe, but I really don't understand this code :(


Re: [julia-users] julia unable to install on Ubuntu 13.10

2014-05-20 Thread 'Stéphane Laurent' via julia-users
Is it supposed to work with Ubuntu 14 too ?


Le samedi 25 janvier 2014 20:37:03 UTC+1, Stefan Karpinski a écrit :

 Just do this:

 git clone https://github.com/JuliaLang/julia.git
 cd julia
 make


 It will take a while, but it will download all the things you need under 
 the deps directory, configure them, compile them, and then compile julia 
 using those versions. Later, if you don't want it anymore, just delete the 
 julia directory and everything it built will be gone too.


 On Sat, Jan 25, 2014 at 12:25 AM, Rajn rjngr...@gmail.com 
 javascript:wrote:

 I use R quite often. Would it be affected if I uninstall Rmath?

 I kind of understand what you are suggesting in your second step but 
 never worked with Github so don't know about cloning and not sure what do 
 you mean by switching to 0.2.0- switching from what? And how do I do that? 
 Should I just copy the files from Github and extract it and then do 
 makefile?
 Are there somewhere good instructions on how to do that?
 Thanks Joao



 On Saturday, January 25, 2014 12:13:23 AM UTC-5, João Felipe Santos wrote:

 There is a conflict between Ubuntu's r-mathlib package and Julia's RMath 
 package: they both want to install Rmath.h to the same path. If you can 
 live without r-libmath, you can uninstall it and then install Julia. 

 Having said that, I usually compile my own distribution and install it 
 to my home directory. You can clone the repository from Github and then 
 switch to 0.2.0. It takes a while but if your PC is not that old you'll be 
 done in less than an hour.

 --
 João Felipe Santos


 On Fri, Jan 24, 2014 at 10:30 PM, Rajn rjngr...@gmail.com wrote:

 After my several failed attempts to run PyPlot through Julia in 
 Windows, I decided to give up and try Linux.
 Guess it was even worse.

 First I added to regular repository (not the nightlybuild)
 then added the dep-repository
 then updated and
 then installed julia

 Here's the latest:
 Unpacking librmath-dev (from 
 .../librmath-dev_2.15.2-juliadeps2~raring_amd64.deb) 
 ...
 dpkg: error processing 
 /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
 (--unpack):
  trying to overwrite '/usr/include/Rmath.h', which is also in package 
 r-mathlib 3.0.1-3ubuntu1
 No apport report written because MaxReports is reached already
   
 Selecting previously unselected package julia.
 Unpacking julia (from .../julia_0.2.0~saucyfinal1_amd64.deb) ...
 Processing triggers for man-db ...
 Errors were encountered while processing:
  /var/cache/apt/archives/librmath-dev_2.15.2-
 juliadeps2~raring_amd64.deb
 E: Sub-process /usr/bin/dpkg returned an error code (1)

 Have no clue absolutely how to proceed. The same issue occurs when I 
 try nightly builds.






[julia-users] loop over a single element

2014-05-11 Thread 'Stéphane Laurent' via julia-users
Hello,

 I have a strange behaviour.
This code works fine:

for file = (newLine, intersect, findRange, getLine, orderPart, 
plotPart)

include(*(pwd(), \\function_, file, .jl))

end



But when there's only one string to loop over I get this error:

julia for file = newLine

include(*(pwd(), \\function_, file, .jl))

end

MethodError(*,(D:\\Github\\JuliaGFI01\\assets\\Julia\\function_,'n'))



Also strange when using string(), ony the first letter is taken : 

julia for file = newLine

include(*(pwd(), \\function_, string(file), .jl))

end

ErrorException(could not open file 
D:\\Github\\JuliaGFI01\\assets\\Julia\\function_n.jl)




[julia-users] numerical solving of ODE with boundary values constraints

2014-05-10 Thread 'Stéphane Laurent' via julia-users
Hello, 

 Is there a Julia library allowing to solve ordinary differential equations 
with boundary values constraints, similarly to the bvpSolve package for 
Rhttp://cran.r-project.org/web/packages/bvpSolve/vignettes/bvpSolve.pdf
 ?


Re: [julia-users] array with different column types

2014-05-08 Thread 'Stéphane Laurent' via julia-users
Hello everybody,

 Below I define two new types : Line and Poly. The Poly type is intended 
for stacking some lines.  

type Line

a::Float64   # intercept

b::BigFloat  # slope

x1::BigFloat # x-coordinate of first vertex

y1::BigFloat # y-coordinate of first vertex

x2::BigFloat # x-coordinate of second vertex

y2::BigFloat # y-coordinate of second vertex

typ::Bool# type of the line (true:upper, false:lower)

end


type Poly

a::Vector{Float64}

b::Vector{BigFloat}

x1::Vector{BigFloat}

y1::Vector{BigFloat}

x2::Vector{BigFloat}

y2::Vector{BigFloat}

typ::Vector{Bool}

end



I also define the empty Poly:

emptyPoly = Poly(Array(Float64,0), Array(BigFloat,0), Array(BigFloat,0), 
Array(BigFloat,0), Array(BigFloat,0), Array(BigFloat,0), Array(Bool,0));



And a function to generate a new Line:

function newLine(a::Float64, b::BigFloat, typ::Bool)

return Line(a, b, BigFloat(Inf), BigFloat(Inf), BigFloat(Inf), 
BigFloat(Inf), typ)

end



Now I define some macros but it seems that I'm doing something bad :

macro addLine(poly, line)

for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

  @eval $poly.$op = [$poly.$op, $line.$op]

end

end


macro removeLine(poly, index)

for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

@eval splice!($poly.$op, $index)

end

end



There's something bad when I'm doing this:

D = newLine(0.4, BigFloat(1.5), false)

poly = emptyPoly;

@addLine poly D



*Question 1:* I don't understand why the previous code changes the value of 
emptyPoly, as if poly and emptyPoly were linked:

julia emptyPoly

Poly([0.4],[1.5e+00 with 256 bits of precision],[inf with 256 bits of 
precision],[inf with 256 bits of precision],[inf with 256 bits of 
precision],[inf with 256 bits of precision],[false])



*Question 2:* There's another problem when I'm using the removeLine macro 
inside a loop :

@addLine poly D

@addLine poly D

for index = [1 2]

@removeLine(poly, index) 

end


This code doesn't work and generates the error message index not found.




Re: [julia-users] array with different column types

2014-05-08 Thread 'Stéphane Laurent' via julia-users
Thank you Johan and Jameson.

Johan, I don't know how to make a loop on the fields with a function. For 
example this doesn't work:

function removeLine(poly::Poly, index::Int)

for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

splice!(poly.$op, index)

end

end


How to do, please ?


Le jeudi 8 mai 2014 15:59:06 UTC+2, Jameson a écrit :

 Replace your macro with a function and delete the uses of eval. You code 
 will be faster, and easier to understand. Most of the difficulty people 
 seem to have with macros comes from thinking they are a type of function 
 call -- the @ character is supposed to remind you that this is not true.

 On Thursday, May 8, 2014, Johan Sigfrids johan.s...@gmail.comjavascript: 
 wrote:

 I myself have been hitting my head against the wall that is 
 meta-programming in Julia. I think I can answer your first question at 
 least.

 Q1: This is because the line poly = emptyPoly doesn't create a new copy 
 of a ploygon but a reference to the empty one so that both poly and 
 emptyPoly 
 refer to the same data. You need to do poly = deepcopy(emptyPoly) . 

 On Thursday, May 8, 2014 9:56:27 AM UTC+3, Stéphane Laurent wrote:

 Hello everybody,

  Below I define two new types : Line and Poly. The Poly type is intended 
 for stacking some lines.  

 type Line

 a::Float64   # intercept

 b::BigFloat  # slope

 x1::BigFloat # x-coordinate of first vertex

 y1::BigFloat # y-coordinate of first vertex

 x2::BigFloat # x-coordinate of second vertex

 y2::BigFloat # y-coordinate of second vertex

 typ::Bool# type of the line (true:upper, false:lower)

 end


 type Poly

 a::Vector{Float64}

 b::Vector{BigFloat}

 x1::Vector{BigFloat}

 y1::Vector{BigFloat}

 x2::Vector{BigFloat}

 y2::Vector{BigFloat}

 typ::Vector{Bool}

 end



 I also define the empty Poly:

 emptyPoly = Poly(Array(Float64,0), Array

 

[julia-users] delete some entries of a n*1 array

2014-05-08 Thread 'Stéphane Laurent' via julia-users
Hello, 

Assume I want to delete the first and the third entries of this array:


julia x = [3,5,9,7]

4-element Array{Int64,1}:

 3

 5

 9

 7


How to do ? Using !splice I can only delete one entry or a range.


[julia-users] Re: delete some entries of a n*1 array

2014-05-08 Thread 'Stéphane Laurent' via julia-users


julia deleteat!(x, 1)

ErrorException(deleteat! not defined)



Le jeudi 8 mai 2014 17:00:01 UTC+2, Tobias Knopp a écrit :

 deleteat!(x,(1,3))

 But am I missing something or are splice! and deleteat! a little redundant?

 Am Donnerstag, 8. Mai 2014 16:49:58 UTC+2 schrieb Stéphane Laurent:

 Hello, 

 Assume I want to delete the first and the third entries of this array:


 julia x = [3,5,9,7]

 4-element Array{Int64,1}:

  3

  5

  9

  7


 How to do ? Using !splice I can only delete one entry or a range.



Re: [julia-users] array with different column types

2014-05-08 Thread 'Stéphane Laurent' via julia-users
No that generates an error:

ErrorException(error compiling removeLine: syntax: prefix \$ in non-quoted 
expression)



Le jeudi 8 mai 2014 17:09:24 UTC+2, Johan Sigfrids a écrit :

 You can still use meta-programming to generate the code

 function removeLine(poly, index)
 for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)
 @eval splice!($poly.$op, $index)
 end
 end

 On Thursday, May 8, 2014 5:40:35 PM UTC+3, Stéphane Laurent wrote:

 Thank you Johan and Jameson.

 Johan, I don't know how to make a loop on the fields with a function. For 
 example this doesn't work:

 function removeLine(poly::Poly, index::Int)

 for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

 splice!(poly.$op, index)

 end

 end


 How to do, please ?


 Le jeudi 8 mai 2014 15:59:06 UTC+2, Jameson a écrit :

 Replace your macro with a function and delete the uses of eval. You code 
 will be faster, and easier to understand. Most of the difficulty people 
 seem to have with macros comes from thinking they are a type of function 
 call -- the @ character is supposed to remind you that this is not true.

 On Thursday, May 8, 2014, Johan Sigfrids johan.s...@gmail.com wrote:

 I myself have been hitting my head against the wall that is 
 meta-programming in Julia. I think I can answer your first question at 
 least.

 Q1: This is because the line poly = emptyPoly doesn't create a new 
 copy of a ploygon but a reference to the empty one so that both polyand 
 emptyPoly 
 refer to the same data. You need to do poly = deepcopy(emptyPoly) . 

 On Thursday, May 8, 2014 9:56:27 AM UTC+3, Stéphane Laurent wrote:

 Hello everybody,

  Below I define two new types : Line and Poly. The Poly type is 
 intended for stacking some lines.  

 type Line

 a::Float64   # intercept

 b::BigFloat  # slope

 x1::BigFloat # x-coordinate of first vertex

 y1::BigFloat # y-coordinate of first vertex

 x2::BigFloat # x-coordinate of second vertex

 y2::BigFloat # y-coordinate of second vertex

 typ::Bool# type of the line (true:upper, false:lower)

 end


 type Poly

 a::Vector{Float64}

 b::Vector{BigFloat}

 x1::Vector{BigFloat}

 y1::Vector{BigFloat}

 x2::Vector{BigFloat}

 y2::Vector{BigFloat}

 typ::Vector{Bool}

 end



 I also define the empty Poly:

 emptyPoly = Poly(Array(Float64,0), Array

 

Re: [julia-users] array with different column types

2014-05-08 Thread 'Stéphane Laurent' via julia-users
Sorry, actually it works.
Maybe there was a problem previously because of JuliaStudio. Sometimes when 
I copy-paste some code in the JuliaStudio console it is not executed.
Thanks for your help.


Re: [julia-users] array with different column types

2014-05-08 Thread 'Stéphane Laurent' via julia-users
Cool, thank you Jameson.

So what is the best choice between these two possibilities :

function removeLine(poly::Poly, index::Int)

for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

@eval splice!($poly.$op, $index)

end

end


function removeLine2(poly::Poly, index::Int)

for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

splice!(getfield(poly, op), index)

end

end



Re: [julia-users] array with different column types

2014-05-08 Thread 'Stéphane Laurent' via julia-users
Actually I'm rather using the followig function allowing to remove several 
lines. 

function removeLines(poly::Poly, indices::BitArray{1})

for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

@eval $poly.$op = ($poly.$op)[!$indices]

end

end


function removeLines2(poly::Poly, indices::BitArray{1})

for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

poly.(op) = (poly.(op))[!indices]

end

end


Le jeudi 8 mai 2014 21:04:52 UTC+2, Stéphane Laurent a écrit :

 Cool, thank you Jameson.

 So what is the best choice between these two possibilities :

 function removeLine(poly::Poly, index::Int)

 for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

 @eval splice!($poly.$op, $index)

 end

 end


 function removeLine2(poly::Poly, index::Int)

 for op = (:a, :b, :x1, :y1, :x2, :y2, :typ)

 splice!(getfield(poly, op), index)

 end

 end



Re: [julia-users] Re: float approximation of bigfloat

2014-05-05 Thread 'Stéphane Laurent' via julia-users
Right, it works. Thanks.

Le dimanche 4 mai 2014 20:13:25 UTC+2, Keno Fischer a écrit :

 Or just use the `float64` function.


 On Sun, May 4, 2014 at 2:11 PM, 'Stéphane Laurent' via julia-users 
 julia...@googlegroups.com javascript: wrote:

 Cool like this;

 julia [convert(Float64,a) for a in [x x]]

 2-element Array{Any,1}:

  2.13

  2.13




[julia-users] float approximation of bigfloat

2014-05-04 Thread 'Stéphane Laurent' via julia-users
Hello,
Assume I have a BigFloat number, how to get its Float64 approximation ?


[julia-users] Re: float approximation of bigfloat

2014-05-04 Thread 'Stéphane Laurent' via julia-users
convert works fine on a single BigFloat but it doesn't apply to an array ?

julia x = BigFloat(2.13)

2.130003e+00
 with 256 bits of precision


julia convert(Float64,x)

2.13


julia convert(Float64, [x x])

MethodError(convert,(Float64,

1x2 Array{BigFloat,2}:

 
2.130003e+00
  …  
2.130003e+00))




[julia-users] Re: float approximation of bigfloat

2014-05-04 Thread 'Stéphane Laurent' via julia-users
Cool like this;

julia [convert(Float64,a) for a in [x x]]

2-element Array{Any,1}:

 2.13

 2.13



Re: [julia-users] Re: How to use GLPK.exact ?

2014-05-02 Thread 'Stéphane Laurent' via julia-users
Thank you everybody, almost every point discussed here is now written on my 
blog http://stla.github.io/stlapblog/posts/KantorovichWithJulia.html.


Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-23 Thread Stéphane Laurent
Right, it works. Thank you. 
If I don't call GLPKMathProgInterface, does JuMP use an internal solver ? 


Le mardi 22 avril 2014 23:25:07 UTC+2, Carlo Baldassi a écrit :

 Note that you can still use GLPK.exact with JuMP, you just need to add 
 change the m=Model() line to this:

 using GLPKMathProgInterface
 m = Model(solver=GLPKSolverLP(method=:Exact))

 while all the rest stays the same.

 As an aside, it's really kind of annoying that GLPK.exact uses (basically) 
 Rational{BigInt} internally, but the interface does not allow to access 
 this. Seems a waste.


 On Tuesday, April 22, 2014 8:28:01 PM UTC+2, Stéphane Laurent wrote:

 Miles, I have successfully installed JuMP and GLPKMathProgInterface on 
 Windows 32-bit. 

 Your code works very well, this is really awesome !! However the result 
 is not as precise as the one given by *GLPK.exact*.

 using JuMP 

  mu = [1/7, 2/7, 4/7]
  nu = [1/4, 1/4, 1/2]
  n = length(mu)
  
  m = Model()
  @defVar(m, p[1:n,1:n] = 0)
  @setObjective(m, Min, sum{p[i,j], i in 1:n, j in 1:n; i != j})
  
  for k in 1:n
  @addConstraint(m, sum(p[k,:]) == mu[k])
  @addConstraint(m, sum(p[:,k]) == nu[k])
  end
  solve(m)


 julia println(Optimal objective value is:, getObjectiveValue(m))
 Optimal objective value is:0.10714285714285715

 julia 3/28
 0.10714285714285714






 Le jeudi 10 avril 2014 01:28:41 UTC+2, Miles Lubin a écrit :

 When we have a simplex solver (either in Julia or external) that 
 supports rational inputs, we could consider making this work with JuMP, but 
 for now JuMP stores all data as floating-point as well. 

 Stephane, nice work. LP definitely needs more exposure in the 
 probability community. Please please write your LPs algebraically, there's 
 really no excuse not to do this in Julia when your original model is in 
 this form.

 Compare this:

 using JuMP
 m = Model()
 @defVar(m, p[1:n,1:n] = 0)
 @setObjective(m, Max, sum{p[i,j], i in 1:n; i != j})

 for k in 1:n
 @addConstraint(m, sum(p[k,:]) == μ[k])
 @addConstraint(m, sum(p[:,k]) == ν[k])
 end
 solve(m)
 println(Optimal objective value is:, getObjectiveValue(m))


 with the matrix gymnastics that you had to do to use the low-level GLPK 
 interface. Writing down a linear programming problem shouldn't be that 
 hard! (Note: I haven't tested that JuMP code).

 Miles



 On Wednesday, April 9, 2014 11:18:26 PM UTC+1, Carlo Baldassi wrote:



 About GLPK.exact it is not possible to get the rational number 3/28 
 instead of a decimal approximation ? 


 No, unfortunately. Also, for that to happen/make sense, you'd also need 
 to be able to pass all the *inputs* as exact rational values, i.e. as 
 1//7 instead of 1/7. This would be possible if we had a native generic 
 Julia linear programming solver, but it's not possible with GLPK, which 
 can 
 only use exact arithmetic internally.
  


[julia-users] Re: problem installing JuMP

2014-04-22 Thread Stéphane Laurent
Thank you Tony, but I don't know what to do with this file.

I have been able to install JuMP and the solver GLPKMathProgInterface (but 
not the other solvers) on Windows 32-bit. 



Le dimanche 13 avril 2014 09:52:14 UTC+2, Tony Kelman a écrit :

 That's fixable. I spent a bunch of time last year making it much easier to 
 build dll's of the COIN-OR solvers. There are 64-bit binaries here 
 https://projects.coin-or.org/CoinMP/browser/releases/1.7.6/CoinMP/CoinMP.zipand
  an issue open here 
 https://github.com/JuliaOpt/Cbc.jl/issues/5



 On Saturday, April 12, 2014 2:57:27 PM UTC-7, Stéphane Laurent wrote:

 Yes. 
 Moreover the solver packages (Clp, ...) are not correctly built, but this 
 is expected on windows 64bit with the 64bit version of Julia: 
 https://jump.readthedocs.org/en/release-0.4/jump.html
 Thus I should try Julia 32bit anyway.



 Le samedi 12 avril 2014 22:07:20 UTC+2, Iain Dunning a écrit :

 Does the same thing happen if you do `using JuMP`?

 On Saturday, April 12, 2014 10:05:12 AM UTC-4, Stéphane Laurent wrote:

 Hello,

 I have just installed JuMP but impossible to use it. If I type

 julia import JuMP


 then Julia is freezed, even after 5 minutes nothing happens. 
 MathProgBase has been installed too and I have no problem to load it.


 *julia versioninfo()*

 *Julia Version 0.2.0*

 *Commit 05c6461 (2013-11-16 23:44 UTC)*

 *Platform Info:*

 *  System: Windows (x86_64-w64-mingw32)*

 *  WORD_SIZE: 64*

 *  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)*

 *  LAPACK: libopenblas*

 *  LIBM: libopenlibm*


 *julia  Pkg.status()*

 *Required packages:*

 * - DataFrames0.4.2*

 * - Distributions 0.3.0*

 * - GLM   0.2.4*

 * - GLPK  0.2.10*

 * - GSL   0.1.1*

 * - GnuTLS0.0.0*

 * - JuMP  0.4.1*

 * - MathProgBase  0.1.6*

 * - MixedModels   0.2.3*

 * - NLopt 0.0.3*

 * - NumericExtensions 0.3.6*

 * - RDatasets 0.1.1*

 * - Stats 0.1.0*

 * - Winston   0.10.2*

 *Additional packages:*

 * - BinDeps   0.2.12*

 * - Blocks0.0.2*

 * - Cairo 0.2.12*

 * - Color 0.2.9*

 * - DataArrays0.0.2*

 * - GZip  0.2.12*

 * - HTTPClient0.1.1*

 * - IniFile   0.2.2*


 *julia *

 * - LibCURL   0.1.1*

 * - LibExpat  0.0.4*

 * - Nettle0.1.3*

 * - SortingAlgorithms 0.0.1*

 * - StatsBase 0.2.10*

 * - Tk0.2.11*

 * - URIParser 0.0.1*

 * - URLParse  0.0.0*

 * - WinRPM0.0.13*

 * - Zlib 0.1.5 *




Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-22 Thread Stéphane Laurent
Miles, I have successfully installed JuMP and GLPKMathProgInterface on 
Windows 32-bit. 

Your code works very well, this is really awesome !! However the result is 
not as precise as the one given by *GLPK.exact*.

using JuMP 

 mu = [1/7, 2/7, 4/7]
 nu = [1/4, 1/4, 1/2]
 n = length(mu)
 
 m = Model()
 @defVar(m, p[1:n,1:n] = 0)
 @setObjective(m, Min, sum{p[i,j], i in 1:n, j in 1:n; i != j})
 
 for k in 1:n
 @addConstraint(m, sum(p[k,:]) == mu[k])
 @addConstraint(m, sum(p[:,k]) == nu[k])
 end
 solve(m)


julia println(Optimal objective value is:, getObjectiveValue(m))
Optimal objective value is:0.10714285714285715

julia 3/28
0.10714285714285714






Le jeudi 10 avril 2014 01:28:41 UTC+2, Miles Lubin a écrit :

 When we have a simplex solver (either in Julia or external) that supports 
 rational inputs, we could consider making this work with JuMP, but for now 
 JuMP stores all data as floating-point as well. 

 Stephane, nice work. LP definitely needs more exposure in the probability 
 community. Please please write your LPs algebraically, there's really no 
 excuse not to do this in Julia when your original model is in this form.

 Compare this:

 using JuMP
 m = Model()
 @defVar(m, p[1:n,1:n] = 0)
 @setObjective(m, Max, sum{p[i,j], i in 1:n; i != j})

 for k in 1:n
 @addConstraint(m, sum(p[k,:]) == μ[k])
 @addConstraint(m, sum(p[:,k]) == ν[k])
 end
 solve(m)
 println(Optimal objective value is:, getObjectiveValue(m))


 with the matrix gymnastics that you had to do to use the low-level GLPK 
 interface. Writing down a linear programming problem shouldn't be that 
 hard! (Note: I haven't tested that JuMP code).

 Miles



 On Wednesday, April 9, 2014 11:18:26 PM UTC+1, Carlo Baldassi wrote:



 About GLPK.exact it is not possible to get the rational number 3/28 
 instead of a decimal approximation ? 


 No, unfortunately. Also, for that to happen/make sense, you'd also need 
 to be able to pass all the *inputs* as exact rational values, i.e. as 
 1//7 instead of 1/7. This would be possible if we had a native generic 
 Julia linear programming solver, but it's not possible with GLPK, which can 
 only use exact arithmetic internally.
  


Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-21 Thread Stéphane Laurent
My blog post is updated.

Iain, I have tried your code with the example of my blog. I see the good 
result in the output (*3//28*), but I don't understand how to know it is 
the good one.

using RationalSimplex

using Base.Test


b = [1//7, 2//7, 4//7, 1//4, 1//4, 1//2]

c = [0//1, 1//1, 1//1, 1//1, 0//1, 1//1, 1//1, 1//1, 0//1]

c = [c, repmat([0//1], size(b)[1])] # surely clumsy

M = [1//1 1//1 1//1 0//1 0//1 0//1 0//1 0//1 0//1;

0//1 0//1 0//1 1//1 1//1 1//1 0//1 0//1 0//1;

0//1 0//1 0//1 0//1 0//1 0//1 1//1 1//1 1//1;

1//1 0//1 0//1 1//1 0//1 0//1 1//1 0//1 0//1;

0//1 1//1 0//1 0//1 1//1 0//1 0//1 1//1 0//1;

0//1 0//1 1//1 0//1 0//1 1//1 0//1 0//1 1//1]

Id = zeros(Rational{Int64}, size(M)[1], size(M)[1])

for i in 1:size(M)[1]

Id[i,i] = 1//1

end

M = hcat(M, Id)


julia simplex(c, :Min, M, b, ['=','=','=','=','=','='])

(:Optimal,[1//7,0//1,0//1,0//1,1//4,0//1,0//1,0//1,1//2,0//1,1//28,1//14,*3//28*,0//1,0//1])




Le jeudi 17 avril 2014 05:07:29 UTC+2, Iain Dunning a écrit :

 I implemented a version of simplex method for rational numbers - so you 
 solve it exactly in pure Julia.
 https://github.com/IainNZ/RationalSimplex.jl
 Not for serious work - just for fun!

 On Saturday, April 12, 2014 11:50:26 AM UTC-4, Stéphane Laurent wrote:

 Thank you everybody. I have updated my blog 
 posthttp://stla.github.io/stlapblog/posts/KantorovichWithJulia.html, 
 especially to include Carlo's comments.  
 Unfortunately I have some problems to use JuMP (I have opened another 
 discussion about it). And installing pycddlib on Windows 64bit is a real 
 nightmare.



Re: [julia-users] array with different column types

2014-04-18 Thread Stéphane Laurent
Is it a good idea to write a function *asLine* which would take a one-row 
DataFrame as argument and return it as a Line object ?


Le vendredi 18 avril 2014 00:18:32 UTC+2, Stéphane Laurent a écrit :

 Thank you. I need to extract the lines too. A line looks like

  type Line{T}

  a::T

  pair:Int

  end


 This doesn't work, do you have something to propose :

 D = DataFrame(A = [1.,2.], B = [1,2])

 D[1,:]::Line{Float64}


 ?

 Le jeudi 17 avril 2014 23:48:29 UTC+2, Simon Kornblith a écrit :

 The most performant approach would be to store the columns as vectors in 
 a tuple or immutable. DataFrames can be nearly as performant if you:

 - Extract columns (df[:mycol]) and index into them whenever possible 
 instead of indexing individual elements (df[1, :mycol])
 - Add typeasserts when you perform indexing operations 
 (df[:mycol]::Vector{Int}), or pass the columns to another function

 Otherwise you will incur a slowdown because the compiler doesn't know the 
 types.

 Simon

 On Thursday, April 17, 2014 5:34:24 PM UTC-4, John Myles White wrote:

 It's actually possible to place pure Julia vectors in a DataFrame, which 
 might be convenient in this case. But you could always just store the 
 columns in a Vector{Any}, which is what the DataFrame does behind the 
 scenes anyway.

  -- John

 On Apr 17, 2014, at 2:27 PM, Stefan Karpinski ste...@karpinski.org 
 wrote:

 A DataFrame does seem like a good option, but those have NA support that 
 you may not need. Can you elaborate a little more on the use case? Is it a 
 fixed set of column names and types? Or will you need to support different 
 schemas?


 On Thu, Apr 17, 2014 at 5:16 PM, Stéphane Laurent lauren...@yahoo.frwrote:

 Hello,

  I need to deal with some objects represented as arrays whose some 
 columns are BigFloat, some columns are Int, some columns are logical. Is 
 it 
 a good idea to use a DataFrame ? Is there a better solution ?This is for a 
 computationally intensive program.





Re: [julia-users] julia installation on Ubuntu

2014-04-17 Thread Stéphane Laurent
Before trying 'aptitude', should I remove the previous installation, and 
how ?

Le mercredi 16 avril 2014 04:05:17 UTC+2, Jameson a écrit :

 you can also try using `aptitude` instead of `apt-get`, which has more 
 intelligent conflict and dependency resolution 

  sudo aptitude update 
  sudo aptitude install julia 

 On Tue, Apr 15, 2014 at 7:44 PM, Stefan Karpinski 
 stefan.k...@gmail.com javascript: wrote: 
  Alternately, if you have preinstalled software that conflicts with what 
  Julia needs, of you compile from source the Julia makefiles will 
 download 
  and configure exactly what they need in a subdirectory, avoiding such 
  conflicts. 
  
  On Apr 15, 2014, at 7:15 PM, Elliot Saba stati...@gmail.comjavascript: 
 wrote: 
  
  sudo authorizes a program to have administrator access to your 
 computer. 
  It gives what are called root permissions to a process so that it can 
 make 
  changes to your system.  (Linux's root is Windows' Administrator) 
  
  That apt-get upgrade command is complaining about an inability to 
 upgrade 
  a program you already have installed on your computer, looks like it has 
  something to do with R.  I'm afraid I can't help you with that. 
  
  The apt-get install julia command is complaining because there's a 
  conflict between BLAS libraries, which are the linear algebra libraries 
  fundamental to most technical computing platforms.  This usually happens 
  when you have some other technical computing package which has installed 
 a 
  linear algebra library that Julia doesn't know how to use, but 
 installing 
  Julia's linear algebra libraries would conflict with the already 
 installed 
  program's.  The way to move forward is to figure out which libraries are 
  conflicting and resolve them somehow. 
  
  Can you post the output of dpkg --get-selections | grep hold? 
  -E 
  
  
  On Tue, Apr 15, 2014 at 3:17 PM, Stéphane Laurent 
  lauren...@yahoo.frjavascript: 

  wrote: 
  
  Hi, 
  
  I have just tried to install Julia but typing julia as a command line 
  does not run anything (command not found). I have followed the 
 following 
  steps: 
  
   sudo add-apt-repository ppa:staticfloat/juliareleases 
  
   sudo apt-get update 
  
   sudo apt-get install julia 
  
  
  
  I got a problem at the second step : 
  
  $ sudo apt-get update 
  ... 
  Hit http://www.openprinting.org lsb3.2/contrib Translation-en 
  Fetched 4,461 kB in 28s (155 kB/s) 
  Reading package lists... Done 
  W: GPG error: http://cran.rstudio.com precise/ Release: The following 
  signatures couldn't be verified because the public key is not 
 available: 
  NO_PUBKEY 51716619E084DAB9 
  
  
  and at the third step : 
  
  $ sudo apt-get install julia 
  Reading package lists... Done 
  Building dependency tree 
  Reading state information... Done 
  Some packages could not be installed. This may mean that you have 
  requested an impossible situation or if you are using the unstable 
  distribution that some required packages have not yet been created 
  or been moved out of Incoming. 
  The following information may help to resolve the situation: 
  
  The following packages have unmet dependencies: 
   julia : Depends: libopenblas-base but it is not going to be installed 
 or 
libblas3 but it is not installable or 
libatlas3-base but it is not installable 
   Depends: liblapack3 but it is not going to be installed or 
libatlas3-base but it is not installable 
   Depends: libcholmod1.7.1 but it is not going to be installed 
   Depends: libumfpack5.4.0 but it is not going to be installed 
   Depends: libarpack2 but it is not going to be installed 
  E: Unable to correct problems, you have held broken packages. 
  
  
  
  What should I do ? Please consider I'm a newbie in Linux (I don't even 
  know what sudo means, I'm only copying-pasting some instructions). 
  
  



Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-17 Thread Stéphane Laurent
Thank you Iain I will try your solver soon I hope. And thank you again 
Carlo, I will update my post.



[julia-users] array with different column types

2014-04-17 Thread Stéphane Laurent
Hello,

 I need to deal with some objects represented as arrays whose some columns 
are BigFloat, some columns are Int, some columns are logical. Is it a good 
idea to use a DataFrame ? Is there a better solution ?This is for a 
computationally intensive program.


Re: [julia-users] array with different column types

2014-04-17 Thread Stéphane Laurent
Yes, there is a fixed number of columns with fixed types. There's no 
slowness with DataFrame or the Any type (as for dataframe and list in R) ?


Re: [julia-users] array with different column types

2014-04-17 Thread Stéphane Laurent
Yes, I need BigFloat. 
For example, a DataFrame with only Int columns, is as performant as an 
Array{Int} ?

Le jeudi 17 avril 2014 23:39:28 UTC+2, John Myles White a écrit :

 The thing that matters for speed is making sure that the columns has 
 appropriate types. For example, do you really need BigFloat? That's a big 
 performance loss -- much worse than fetching out of a Vector{Any}. 

  -- John 

 On Apr 17, 2014, at 2:38 PM, Stéphane Laurent 
 lauren...@yahoo.frjavascript: 
 wrote: 

  Yes, there is a fixed number of columns with fixed types. There's no 
 slowness with DataFrame or the Any type (as for dataframe and list in R) ? 



Re: [julia-users] array with different column types

2014-04-17 Thread Stéphane Laurent
Ah ok I see now. But it's not cool because I can't extract a column. For 
example

 df = DataFrame(A = Line[Line(1.0, 1), Line(2.0, 2)])


I'd like to extract the column [1.0, 2.0].

I don't know what is immutable, I will see if I find. Thank you for your 
help.


Le vendredi 18 avril 2014 00:34:57 UTC+2, John Myles White a écrit :

 df[:A] gives you a column, which is vector of Line objects.

 df[:A][1] gives you the first entry of that vector.

 df[:A][1].a gives you the a element of the first entry of that vector.

 I think you're better off just using a raw vector of immutables. Instead 
 of defining type Line, define immutable Line.

  -- John

 On Apr 17, 2014, at 3:33 PM, Stéphane Laurent 
 lauren...@yahoo.frjavascript: 
 wrote:

 How do I extract a line and a column with this method ?



 Le vendredi 18 avril 2014 00:21:26 UTC+2, John Myles White a écrit :

 Each row of a DataFrame is itself a DataFrame.

 Why not just store things in a vector of Line objects?

 type Line{T}
 a::T
 pair::Int
 end

 df = DataFrame(A = Line[Line(1.0, 1), Line(2.0, 2)])

 I've changed things from your code because there's a convention of using 
 uppercase letters to start the names of types.

  -- John

 On Apr 17, 2014, at 3:18 PM, Stéphane Laurent lauren...@yahoo.fr wrote:

 Thank you. I need to extract the lines too. A line looks like

  type line{T}

  a::T

  pair:Int

  end


 This doesn't work, do you have something to propose :

 D = DataFrame(A = [1.,2.], B = [1,2])

 D[1,:]::line{Float64}


 ?

 Le jeudi 17 avril 2014 23:48:29 UTC+2, Simon Kornblith a écrit :

 The most performant approach would be to store the columns as vectors in 
 a tuple or immutable. DataFrames can be nearly as performant if you:

 - Extract columns (df[:mycol]) and index into them whenever possible 
 instead of indexing individual elements (df[1, :mycol])
 - Add typeasserts when you perform indexing operations 
 (df[:mycol]::Vector{Int}), or pass the columns to another function

 Otherwise you will incur a slowdown because the compiler doesn't know 
 the types.

 Simon

 On Thursday, April 17, 2014 5:34:24 PM UTC-4, John Myles White wrote:

 It's actually possible to place pure Julia vectors in a DataFrame, 
 which might be convenient in this case. But you could always just store 
 the 
 columns in a Vector{Any}, which is what the DataFrame does behind the 
 scenes anyway.

  -- John

 On Apr 17, 2014, at 2:27 PM, Stefan Karpinski ste...@karpinski.org 
 wrote:

 A DataFrame does seem like a good option, but those have NA support 
 that you may not need. Can you elaborate a little more on the use case? Is 
 it a fixed set of column names and types? Or will you need to support 
 different schemas?


 On Thu, Apr 17, 2014 at 5:16 PM, Stéphane Laurent 
 lauren...@yahoo.frwrote:

 Hello,

  I need to deal with some objects represented as arrays whose some 
 columns are BigFloat, some columns are Int, some columns are logical. Is 
 it 
 a good idea to use a DataFrame ? Is there a better solution ?This is for 
 a 
 computationally intensive program.







[julia-users] julia installation on Ubuntu

2014-04-15 Thread Stéphane Laurent
Hi,

I have just tried to install Julia but typing julia as a command line 
does not run anything (command not found). I have followed the following 
steps:

* sudo add-apt-repository ppa:staticfloat/juliareleases*

* sudo apt-get update*

* sudo apt-get install julia*



I got a problem at the second step :

*$ sudo apt-get update*
*...*
*Hit http://www.openprinting.org lsb3.2/contrib Translation-en 
   *
*Fetched 4,461 kB in 28s (155 kB/s) 
  *
*Reading package lists... Done*
*W: GPG error: http://cran.rstudio.com precise/ Release: The following 
signatures couldn't be verified because the public key is not available: 
NO_PUBKEY 51716619E084DAB9*


and at the third step :

*$ sudo apt-get install julia*
*Reading package lists... Done*
*Building dependency tree   *
*Reading state information... Done*
*Some packages could not be installed. This may mean that you have*
*requested an impossible situation or if you are using the unstable*
*distribution that some required packages have not yet been created*
*or been moved out of Incoming.*
*The following information may help to resolve the situation:*

*The following packages have unmet dependencies:*
* julia : Depends: libopenblas-base but it is not going to be installed or*
*  libblas3 but it is not installable or*
*  libatlas3-base but it is not installable*
* Depends: liblapack3 but it is not going to be installed or*
*  libatlas3-base but it is not installable*
* Depends: libcholmod1.7.1 but it is not going to be installed*
* Depends: libumfpack5.4.0 but it is not going to be installed*
* Depends: libarpack2 but it is not going to be installed*
*E: Unable to correct problems, you have held broken packages.*



What should I do ? Please consider I'm a newbie in Linux (I don't even know 
what sudo means, I'm only copying-pasting some instructions). 


[julia-users] problem installing JuMP

2014-04-12 Thread Stéphane Laurent
Hello,

I have just installed JuMP but impossible to use it. If I type

julia import JuMP


then Julia is freezed, even after 5 minutes nothing happens. MathProgBase 
has been installed too and I have no problem to load it.


*julia versioninfo()*

*Julia Version 0.2.0*

*Commit 05c6461 (2013-11-16 23:44 UTC)*

*Platform Info:*

*  System: Windows (x86_64-w64-mingw32)*

*  WORD_SIZE: 64*

*  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)*

*  LAPACK: libopenblas*

*  LIBM: libopenlibm*


*julia  Pkg.status()*

*Required packages:*

* - DataFrames0.4.2*

* - Distributions 0.3.0*

* - GLM   0.2.4*

* - GLPK  0.2.10*

* - GSL   0.1.1*

* - GnuTLS0.0.0*

* - JuMP  0.4.1*

* - MathProgBase  0.1.6*

* - MixedModels   0.2.3*

* - NLopt 0.0.3*

* - NumericExtensions 0.3.6*

* - RDatasets 0.1.1*

* - Stats 0.1.0*

* - Winston   0.10.2*

*Additional packages:*

* - BinDeps   0.2.12*

* - Blocks0.0.2*

* - Cairo 0.2.12*

* - Color 0.2.9*

* - DataArrays0.0.2*

* - GZip  0.2.12*

* - HTTPClient0.1.1*

* - IniFile   0.2.2*


*julia *

* - LibCURL   0.1.1*

* - LibExpat  0.0.4*

* - Nettle0.1.3*

* - SortingAlgorithms 0.0.1*

* - StatsBase 0.2.10*

* - Tk0.2.11*

* - URIParser 0.0.1*

* - URLParse  0.0.0*

* - WinRPM0.0.13*

* - Zlib 0.1.5 *




Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-12 Thread Stéphane Laurent
Thank you everybody. I have updated my blog 
posthttp://stla.github.io/stlapblog/posts/KantorovichWithJulia.html, 
especially to include Carlo's comments.  
Unfortunately I have some problems to use JuMP (I have opened another 
discussion about it). And installing pycddlib on Windows 64bit is a real 
nightmare.


[julia-users] Re: problem installing JuMP

2014-04-12 Thread Stéphane Laurent
Yes. 
Moreover the solver packages (Clp, ...) are not correctly built, but this 
is expected on windows 64bit with the 64bit version of Julia: 
https://jump.readthedocs.org/en/release-0.4/jump.html
Thus I should try Julia 32bit anyway.



Le samedi 12 avril 2014 22:07:20 UTC+2, Iain Dunning a écrit :

 Does the same thing happen if you do `using JuMP`?

 On Saturday, April 12, 2014 10:05:12 AM UTC-4, Stéphane Laurent wrote:

 Hello,

 I have just installed JuMP but impossible to use it. If I type

 julia import JuMP


 then Julia is freezed, even after 5 minutes nothing happens. MathProgBase 
 has been installed too and I have no problem to load it.


 *julia versioninfo()*

 *Julia Version 0.2.0*

 *Commit 05c6461 (2013-11-16 23:44 UTC)*

 *Platform Info:*

 *  System: Windows (x86_64-w64-mingw32)*

 *  WORD_SIZE: 64*

 *  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)*

 *  LAPACK: libopenblas*

 *  LIBM: libopenlibm*


 *julia  Pkg.status()*

 *Required packages:*

 * - DataFrames0.4.2*

 * - Distributions 0.3.0*

 * - GLM   0.2.4*

 * - GLPK  0.2.10*

 * - GSL   0.1.1*

 * - GnuTLS0.0.0*

 * - JuMP  0.4.1*

 * - MathProgBase  0.1.6*

 * - MixedModels   0.2.3*

 * - NLopt 0.0.3*

 * - NumericExtensions 0.3.6*

 * - RDatasets 0.1.1*

 * - Stats 0.1.0*

 * - Winston   0.10.2*

 *Additional packages:*

 * - BinDeps   0.2.12*

 * - Blocks0.0.2*

 * - Cairo 0.2.12*

 * - Color 0.2.9*

 * - DataArrays0.0.2*

 * - GZip  0.2.12*

 * - HTTPClient0.1.1*

 * - IniFile   0.2.2*


 *julia *

 * - LibCURL   0.1.1*

 * - LibExpat  0.0.4*

 * - Nettle0.1.3*

 * - SortingAlgorithms 0.0.1*

 * - StatsBase 0.2.10*

 * - Tk0.2.11*

 * - URIParser 0.0.1*

 * - URLParse  0.0.0*

 * - WinRPM0.0.13*

 * - Zlib 0.1.5 *




Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Stéphane Laurent
Thank you for these precious informations. The JuMP package looks very 
awesome, I hope to give it a try soon.

There was a Julia age during which  BigInt(3)/BigInt(28) was equal to the 
BigRational 3/28, why this feature has been removed ?

It would be too long to explain what my R appli here 
http://glimmer.rstudio.com/stla/ShinyIntrinsicMetric/ does but it returns 
some Kantorovich distances in exact rational numbers, it would be sad if we 
can't do this with Julia.

By the way for another problem I need to get the vertices of the polyhedron 
defined by the linear constraints, as with the cddlib library, do you know 
how I could get that ?


Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Stéphane Laurent
Again, thank you for all these answers. Sorry Carlo, I missed the double 
slash in your previous answer. 

It would be a good opportunity for me to call Python in order to train my 
skills in Python in addition to Julia. But what do you suggest me to call 
pycddlib with PyCall rather than calling cddlib with ccall ? 
 


Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Stéphane Laurent
Again, thank you for all these answers. Sorry Carlo, I missed the double 
slash in your previous answer. 

It would be a good opportunity for me to call Python in order to train my 
skills in Python in addition to Julia. But why do you suggest me to call 
pycddlib with PyCall rather than calling cddlib with ccall ? 


[julia-users] Re: How to use GLPK.exact ?

2014-04-09 Thread Stéphane Laurent
Hello guys, 

 I hope you'll enjoy this article on my 
bloghttp://stla.github.io/stlapblog/posts/KantorovichWithJulia.html
.

If you're able to use GNU MP on your machine, would you be able to find 
*3/28* ? 

Any other comment is welcomed !



[julia-users] Re: How to use GLPK.exact ?

2014-04-08 Thread Stéphane Laurent
Hello Iain, I don't understand what you mean :


*julia versioninfo()*

*Julia Version 0.2.0*

*Commit 05c6461 (2013-11-16 23:44 UTC)*

*Platform Info:*

*  System: Windows (x86_64-w64-mingw32)*

*  WORD_SIZE: *


*julia *

*64*

*julia *


*  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)*

*  LAPACK: libopenblas*

*  LIBM: libopenlibm*


*julia Pkg.status()*

*Required packages:*

* - DataFrames0.4.2*

* - Distributions 0.3.0*

* - GLM   0.2.4*

* - GLPK  0.2.10*

* - GSL   0.1.1*

* - GnuTLS0.0.0*

* - MixedModels   0.2.3*

* - NLopt 0.0.3*

* - NumericExtensions 0.3.6*

* - RDatasets 0.1.1*

* - Stats 0.1.0*

* - Winston   0.9.0*

*Additional packages:*

* - BinDeps   0.2.12*

* - Blocks0.0.2*

* - Cairo 0.2.12*

* - Color 0.2.9*

* - DataArrays0.0.2*

* - GZip  0.2.12*

* - HTTPClient0.1.1*

* - IniFile   0.2*


*julia *

*.2*

* - LibCURL   0.1.1*

* - LibExpat  0.0.4*

* - Nettle0.1.3*

* - SortingAlgorithms 0.0.1*

* - StatsBase 0.2.10*

* - Tk0.2.11*

* - URIParser 0.0.1*

* - URLParse  0.0.0*

* - WinRPM0.0.13*

* - Zlib  0.1.5*



[julia-users] Re: How to use GLPK.exact ?

2014-04-08 Thread Stéphane Laurent
Thank you for your answers. Unfortunately, (pre)-compiled binaries, 
dll, etc, is like Chinese for me. Moreover when you talk about GLP I 
don't know if you talk about the C library or the julia Package. Currently 
I was just trying GLPK for fun so this is not important. Thank you again.


[julia-users] Re: Any ANOVA or ANCOVA examples for Julia?

2014-04-03 Thread Stéphane Laurent
Hello, 
Please, does someone have an example of a dataframe with a factor 
variable ?


[julia-users] Re: Installing Julia Studio properly on Windows 7 - Step by Step Instructions

2014-04-03 Thread Stéphane Laurent
Ok after doing:

julia Pkg.init()



Le vendredi 4 avril 2014 00:15:47 UTC+2, Stéphane Laurent a écrit :

 That does not work for me:

 julia Pkg.status()

 ErrorException(Unable to read directory METADATA.)



[julia-users] Re: Any ANOVA or ANCOVA examples for Julia?

2014-04-03 Thread Stéphane Laurent
Ok I get one:

julia df = DataFrame(A = 1:4, B = [M, F, F, M])

4x2 DataFrame:

A   B

[1,]1 M

[2,]2 F

[3,]3 F

[4,]4 M


julia pool!(df)


julia ModelMatrix(ModelFrame(Formula(:A,:B), df))

ModelMatrix{Float64}(4x2 Array{Float64,2}:

 1.0  1.0

 1.0  0.0

 1.0  0.0

 1.0  1.0,[0,1])



Le jeudi 3 avril 2014 23:53:46 UTC+2, Stéphane Laurent a écrit :

 Hello, 
 Please, does someone have an example of a dataframe with a factor 
 variable ?