Re: [julia-users] Re: ANN: ApproxFun v0.0.3 with general linear PDE solving on rectangles

2014-09-14 Thread Alex Townsend
I'll add to the partial list, just in case it is useful: 

a) Algorithm for the convolution of Chebyshev series
b) Bivariate rootfinding
c) Linearity detection of operators (closely related to (5))
d) Automatic (though a little rough) approximation of functions with 
singularities
e) Remez, cf, least squares, pade polynomial approximation
f) Vector calculus 
g) Field of values algorithm

It may be good to have 3), 4), 6), 7),  b).  Not sure if Julia offers any 
advantage for 2), 5), 8),  c).  

On Thursday, 11 September 2014 19:43:27 UTC-4, Sheehan Olver wrote:


 Chebfun is a lot more full featured, and ApproxFun is _very_ rough 
 around the edges.  ApproxFun will probably end up a very different animal 
 than chebfun: right now the goal is to tackle PDEs on a broader class of 
 domains, something I think is beyond the scope of Chebfun due to issues 
 with Matlab's speed, memory management, etc.   

 Here’s a partial list of features in Chebfun not in ApproxFun: 

 1)Automatic edge detection and domain splitting 
 2)Support for delta functions 
 3)Built-in time stepping (pde15s) 
 4)Eigenvalue problems 
 5)Automatic nonlinear ODE solver 
 6)Operator exponential 
 7)Smarter constructor for determining convergence 
 8)Automatic differentiation 

 I have no concrete plans at the moment of adding these features, though 
 eigenvalue problems and operator exponentials will likely find their way in 
 at some point.   


 Sheehan 


 On 12 Sep 2014, at 12:14 am, Steven G. Johnson steve...@gmail.com 
 javascript: wrote: 

  This is great! 
  
  At this point, what are the major differences in functionality between 
 ApproxFun and Chebfun? 



[julia-users] Re: FastGauss.jl: fast computation of Gauss quadrature rules

2014-09-07 Thread Alex Townsend
Jason Merrill, 

Thank you for your speed up suggestions. 
Managed to get close to a factor of 2 speed up 
out of GaussLegendre. I quickly looked at 
GaussJacobi too and also got a significant 
speed up there... still more to do on that code. 
 
Alex  

On Tuesday, 2 September 2014 20:52:28 UTC-4, Alex Townsend wrote:

 Both those tools look great. Trying them now.  Thanks a bunch. 
 Alex 

 On Tuesday, 2 September 2014 19:16:36 UTC-4, Jason Merrill wrote:

 On Tuesday, September 2, 2014 5:57:43 AM UTC-7, Alex Townsend wrote:



 On Tuesday, 2 September 2014 03:00:10 UTC-4, Jason Merrill wrote:

 On Monday, September 1, 2014 2:33:31 PM UTC-7, Alex Townsend wrote:

 I have written a package FastGauss.jl available here: 

 https://github.com/ajt60gaibb/FastGauss.jl


 I am a Julia beginner (only been learning for 2 weeks) so I am 
 assuming the code can be 
 improved in a million and one ways. Please tell me if I've done 
 something that Julia does 
 not like. I am not sure if it is appropriate to make this an official 
 package.

  
 One thing to look out for is making sure your functions have consistent 
 return types. E.g. in 
 https://github.com/ajt60gaibb/FastGauss.jl/blob/91e2ac656b856876563d5aacf7b5a405e068b3da/src/GaussLobatto.jl#L4
  
 you have

 Thanks! I tried to get the return types consistent, but obviously missed 
 a few. I've been trying to use @code_typed to tell me this 
 information, but reading the output is a little difficult (at the 
 moment). 


 I think the community as a whole would like to see better tooling around 
 finding and fixing this kind of soft bug.

 You might check out https://github.com/tonyhffong/Lint.jl, and 
 https://github.com/astrieanna/TypeCheck.jl. I haven't tried either of 
 them myself yet, but I've heard people say good things about both of them.
  



[julia-users] Re: FastGauss.jl: fast computation of Gauss quadrature rules

2014-09-02 Thread Alex Townsend


On Tuesday, 2 September 2014 03:00:10 UTC-4, Jason Merrill wrote:

 On Monday, September 1, 2014 2:33:31 PM UTC-7, Alex Townsend wrote:

 I have written a package FastGauss.jl available here: 

 https://github.com/ajt60gaibb/FastGauss.jl


 I am a Julia beginner (only been learning for 2 weeks) so I am assuming 
 the code can be 
 improved in a million and one ways. Please tell me if I've done something 
 that Julia does 
 not like. I am not sure if it is appropriate to make this an official 
 package.

  
 One thing to look out for is making sure your functions have consistent 
 return types. E.g. in 
 https://github.com/ajt60gaibb/FastGauss.jl/blob/91e2ac656b856876563d5aacf7b5a405e068b3da/src/GaussLobatto.jl#L4
  
 you have

Thanks! I tried to get the return types consistent, but obviously missed a 
few. I've been trying to use @code_typed to tell me this 
information, but reading the output is a little difficult (at the moment). 


 if ( n == 1 ) 
 error(Lobatto undefined for n = 1.) 
 elseif ( n == 2 ) 
 x = ([-1.0,1.0],[1.0,1.0]) 
 elseif ( n == 3 ) 
 x = ([-1, 0, 1], [1.0, 4.0, 1.0]/3)
 # ...

 In the n==2 case, you're returning a tuple of two float vectors, but in 
 the n==3 case, you're returning a tuple with one Int vector and one float 
 vector.

 This issue crops up in a few other places, including sometimes returning a 
 number and other times returning a vector.

 Another thing you might want to consider is devectorizing compound 
 operations on vectors to avoid allocating containers to store intermediate 
 results (either using https://github.com/lindahua/Devectorize.jl or 
 manually). To pick one random place where this might be relevant: 
 https://github.com/ajt60gaibb/FastGauss.jl/blob/5e3a8a2f9a7e327622bdd43f69bb712afcb16743/src/GaussJacobi.jl#L36

Good point. This makes a _huge_ difference in speed. Thank you. I had heard 
that devectorize was a good thing in Julia, but I'm from MATLAB where it's 
the opposite. I'll go through the code and update. 


 I'm not 100% sure whether this will be relevant to your API, but many high 
 performance Julia libs expose mutating versions of functions (marked with 
 an ! at the end) that normally return arrays, allowing the caller to 
 instead pass in a preallocated array for the result to be stored in that 
 could potentially be reused from call to call.

OK. I'll have a closer look at some commands with the ! suffix. 


 If a quadrature rule may in some cases be used only once, it might be nice 
 if there were a way to apply the quadrature method to a function on the fly 
 without ever generating the entire node and weight vector.

Thank you very much Jason.
 


[julia-users] Re: FastGauss.jl: fast computation of Gauss quadrature rules

2014-09-02 Thread Alex Townsend
Both those tools look great. Trying them now.  Thanks a bunch. 
Alex 

On Tuesday, 2 September 2014 19:16:36 UTC-4, Jason Merrill wrote:

 On Tuesday, September 2, 2014 5:57:43 AM UTC-7, Alex Townsend wrote:



 On Tuesday, 2 September 2014 03:00:10 UTC-4, Jason Merrill wrote:

 On Monday, September 1, 2014 2:33:31 PM UTC-7, Alex Townsend wrote:

 I have written a package FastGauss.jl available here: 

 https://github.com/ajt60gaibb/FastGauss.jl


 I am a Julia beginner (only been learning for 2 weeks) so I am assuming 
 the code can be 
 improved in a million and one ways. Please tell me if I've done 
 something that Julia does 
 not like. I am not sure if it is appropriate to make this an official 
 package.

  
 One thing to look out for is making sure your functions have consistent 
 return types. E.g. in 
 https://github.com/ajt60gaibb/FastGauss.jl/blob/91e2ac656b856876563d5aacf7b5a405e068b3da/src/GaussLobatto.jl#L4
  
 you have

 Thanks! I tried to get the return types consistent, but obviously missed 
 a few. I've been trying to use @code_typed to tell me this 
 information, but reading the output is a little difficult (at the 
 moment). 


 I think the community as a whole would like to see better tooling around 
 finding and fixing this kind of soft bug.

 You might check out https://github.com/tonyhffong/Lint.jl, and 
 https://github.com/astrieanna/TypeCheck.jl. I haven't tried either of 
 them myself yet, but I've heard people say good things about both of them.
  



[julia-users] FastGauss.jl: fast computation of Gauss quadrature rules

2014-09-01 Thread Alex Townsend
I have written a package FastGauss.jl available here: 

https://github.com/ajt60gaibb/FastGauss.jl

to compute Gauss quadrature rules to 16-digit precision (so far Legendre, 
Jacobi, Lobatto, Radau),
aiming to be the fastest implementation in Julia. For example, this is how 
long 
it takes to compute 1,000,000 Gauss-Legendre nodes and weights: 

tic(), GaussLegendre( 100 ); toc() 
elapsed time: 0.336489122 seconds


In my comparisons, GaussLegendre() is faster than Base.gauss() for n60 
(nothing in it for 
small n), but my implementation right now does not allow for higher 
precision. I couldn't find a
Gauss-Jacobi code in Base. 

I am a Julia beginner (only been learning for 2 weeks) so I am assuming the 
code can be 
improved in a million and one ways. Please tell me if I've done something 
that Julia does 
not like. I am not sure if it is appropriate to make this an official 
package.