[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: How to use GLPK.exact ?

2014-04-08 Thread Tony Kelman
It looks like those GLPK binaries are Visual Studio builds, and as I 
understand it recent versions of GMP are difficult if not impossible to 
compile with Visual Studio. In fact GMP was forked into MPIR 
(http://www.mpir.org/#about), with one major motivation being MSVC support. 
MPIR might be usable as a drop-in replacement for GMP?

A MinGW build of GLPK should work with a MinGW build of GMP (like the one 
Julia's using, and probably R too?), but if you want to use a pre-compiled 
binary for one or the other you'll have to be very careful to use 
compatible compiler versions.

-Tony


On Tuesday, April 8, 2014 6:33:34 AM UTC-7, Carlo Baldassi wrote:
>
> Unfortunately, from insepcting GLPK source code it seems that whether to 
> use GNU MP or GLPK bignum is decided at compile time. So it appears that 
> the Windows binaries which are automatically downloaded by the Julia 
> package are just not compiled with GNU MP. As far as I can tell, the 
> options are 1) compile from source in Windows and put the resulting shared 
> library under GLPK/deps/usr/lib 2) find alternative binaries 3) ask the guy 
> which provides the Windows binaries (http://www.xypron.de)
>
> On Tuesday, April 8, 2014 12:14:21 AM UTC+2, Stéphane Laurent wrote:
>>
>> Hello, 
>>
>>  When I use the *exact* function of the GLPK 
>> package, 
>> I get something like that :
>>
>>
>>
>>
>>
>>
>>
>> *julia> GLPK.exact(lp) glp_exact: 6 rows, 9 columns, 18 non-zeros GLPK 
>> bignum module is being used (Consider installing GNU MP to attain a much 
>> better performance.) * 6: objval = 0.107142857142857 (1) * 6: objval = 
>> 0.107142857142857 (1) OPTIMAL SOLUTION FOUND 0*
>>
>>
>> GNU MP  should be installed on my Windows machine 
>> because I use the gmp 
>> packagein
>>  R. What should I do in order that GLPK uses this library in Julia ? 
>>
>

Re: [julia-users] Workflow for modifying a package

2014-04-08 Thread David P. Sanders


El lunes, 7 de abril de 2014 20:09:47 UTC-5, Jameson escribió:
>
> `using X` will always prefer an existing module Main.X over reading 
> code off of the hard drive. 
>
> or you can prefix it with `include("../DataStructures.jl")` 
>
> you may also consider putting your testsuite in a module also (and/or 
> using evalfile instead of include), so that you get an entirely 
> private copy of the module. note that you would need to switch to 
> `using .DataStructures` (with one dot), to make the relative import 
> work correctly 
>

Thanks.

To run the tests from the terminal, the following seems to work:
`require("../src/DataStructures.jl")
include("test_disjoint_sets.jl")
`


 

>
> On Mon, Apr 7, 2014 at 5:45 PM, David P. Sanders 
> > 
> wrote: 
> > Hi, 
> > 
> > I am making some modifications to the DataStructures package to add the 
> > functionality to be able to add new sets in DisjointSets. 
> > 
> > From the command line, it seems to be possible to use 
> > 
> > julia> reload("DataStructures.jl") 
> > 
> > to load my variant of the code. 
> > 
> > My question is about the tests in test_disjoint_set.jl, which is in the 
> test 
> > subdirectory and has the line 
> >   Using DataStructures 
> > 
> > What do I need to do so that the DataStructures.jl file imported is my 
> > modified one from the current parent directory, rather than the one from 
> the 
> > ~/.julia directory? This needs to be done without touching these 
> imports, so 
> > as not to mess up the git repository I guess. 
> > 
> > Thanks, 
> > David. 
>


Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Cameron McBride
I've long enjoyed ruby's `loop` keyword for exactly this type of use.

Cameron


On Tue, Apr 8, 2014 at 4:28 PM, Stefan Karpinski wrote:

> Eh, doesn't seem that hard to write `while true` and `while` by itself is
> kind of confusing. I also don't necessarily think this is how everyone
> should write loops, but I increasingly find myself starting out by writing
> `while true` and then putting conditions where they are needed as I go.
> Then after I've written the loop out, I'll figure out how to refactor it as
> a while condition.
>
>
> On Tue, Apr 8, 2014 at 3:38 PM, Mike Innes  wrote:
>
>> If while true loops are idiomatic, could we perhaps make the true
>> optional?
>>
>>
>> On Tuesday, 8 April 2014 18:57:53 UTC+1, Stefan Karpinski wrote:
>>
>>>  Good idea. For what it's worth, these days I would be perfectly happy
>>> to only program with while true loops and explicit breaks.
>>>
>>> On Apr 8, 2014, at 1:41 PM, Kevin Squire  wrote:
>>>
>>> Although not too frequent, this would be a good FAQ entry.
>>>
>>> Cheers, Kevin
>>>
>>>
>>> On Tuesday, April 8, 2014, Pierre-Yves Gérardy  wrote:
>>>
 This does the trick:

 while true
 # ...
 condition || break
 end



 On Tuesday, April 8, 2014 5:26:00 AM UTC+2, Freddy Chua wrote:
>
> as stated in question..
>

>


Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread Mason McGill


On Tuesday, April 8, 2014 2:18:18 PM UTC-7, Stefan Karpinski wrote:
>
> It may not address the cross-module aspect well. We didn't have modules 
> when I write it originally, so any documentation of that interaction would 
> necessarily be tacked on.
>
> "Modules" comes after "Methods", so "Modules" could be added to, for the 
sake of sequential readers.  The first relevant except from "Modules" is:

Method definitions are a bit special: they do not search modules named in 
using statements. The definitionfunction foo() creates a new foo in the 
current module, unless foo has already been imported from elsewhere. For 
example, in MyModule above we wanted to add a method to the standard show 
function, 
so we had to write import Base.show.

Explaining the difference between redefining and extending a function might 
be beneficial: e.g. saying that someone might want to extend Base.getindexso 
standard library functions can index into instances of their types.  The 
other relevant excerpt is

one typically wants to extend operators rather than creating entirely new 
definitions of them

That line seems to assume the reader understands the difference between 
extending and redefining functions, so explaining it above would help the 
reader understand this section as well.


Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread Stefan Karpinski
It may not address the cross-module aspect well. We didn't have modules
when I write it originally, so any documentation of that interaction would
necessarily be tacked on.


On Tue, Apr 8, 2014 at 5:16 PM, John Travers  wrote:

> On Tuesday, April 8, 2014 10:44:47 PM UTC+2, Mason McGill wrote:
>>
>> At the moment, though, it doesn't look like the difference between
>> declaring new functions extending existing functions is in the relevant
>> sections of the language documentation (I searched "Methods", "Functions",
>> "Types", and "Modules").  It's hinted to in "Modules/Default top-level
>> definitions and bare modules", but never fully explained.  It seems like an
>> important feature to document.
>>
>
> Maybe I misunderstand you, but I think the whole "Methods" section
> addresses exactly this topic.
>
>


Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread John Travers
On Tuesday, April 8, 2014 10:44:47 PM UTC+2, Mason McGill wrote:
>
> At the moment, though, it doesn't look like the difference between 
> declaring new functions extending existing functions is in the relevant 
> sections of the language documentation (I searched "Methods", "Functions", 
> "Types", and "Modules").  It's hinted to in "Modules/Default top-level 
> definitions and bare modules", but never fully explained.  It seems like an 
> important feature to document.
>

Maybe I misunderstand you, but I think the whole "Methods" section 
addresses exactly this topic.



[julia-users] questions about latest documentation

2014-04-08 Thread harven
The documentation is a bit different for the 'latest' version of julia, as 
compared to version 0.2. I have a few questions/remarks about it.

In the main page  of the latest 
version, I don't see the entry "available packages". Or did I miss 
something?
I can access the list of available packages by clicking on the package 
entry in the submenu Manual then by clicking on a link "available packages" 
in the first paragraph. I then get to the desired 
pagebut
 the left bar does not show the list of the packages as in 0.2. It shows 
instead the menu of the manual.

The left part of the main document 
pagecontaining the table of contents is 
greyed,almost washed out, and I find it 
quite hard to read. Is there a reason why is it so? Or is it some problem 
with my browser (firefox)?

Overall I find it slightly harder to navigate than the previous version 
(more clicks needed to reach the content, weird mix of fonts where there 
was previously one consistent choice across a page, see e.g. the 
introduction, 
latestand 
0.2 ). Maybe 
this is just a question of time before I get acquainted with the new 
layout. Cheers


[julia-users] Re: hist on matrices

2014-04-08 Thread Stephen Voinea
Already done and tested. Works great. Thanks for making that happen to 
quickly, Ivar. 

On Tuesday, April 8, 2014 2:15:57 PM UTC-4, Ivar Nesje wrote:
>
> Now the fix has been merged, so now you just have to pull and make to get 
> a working version (or wait for the next nightly release).
>
> Ivar
>
> kl. 19:50:34 UTC+2 tirsdag 8. april 2014 skrev Stephen Voinea følgende:
>>
>> Happy to hear I didn't just point out a bunch of correctly working code 
>> that I didn't understand. Take care. 
>>
>> On Tuesday, April 8, 2014 2:36:23 AM UTC-4, Ivar Nesje wrote:
>>>
>>> I was also confused by  sub(H(H, :, j), so I just removed it. 
>>>
>>> kl. 08:12:04 UTC+2 tirsdag 8. april 2014 skrev Stephen Voinea følgende:

 Thanks again!

 On Tuesday, April 8, 2014 2:00:50 AM UTC-4, Ivar Nesje wrote:
>
> This should be fixed with https://github.com/JuliaLang/julia/pull/6462
>
> kl. 07:39:05 UTC+2 tirsdag 8. april 2014 skrev Ivar Nesje følgende:
>>
>> Thanks for the report.
>>
>> I found the bug in 
>> https://github.com/JuliaLang/julia/blob/master/base/statistics.jl#L470, 
>> because it tries to calculate length(edg) - 1, but actually calculates 
>> length(edg - 1), which is kind of useless.
>>
>> I'll work on a patch (and maybe add a test).
>>
>> Ivar
>>
>> kl. 01:26:43 UTC+2 tirsdag 8. april 2014 skrev Stephen Voinea 
>> følgende:
>>>
>>> If I recall correctly, it used to be that for a matrix M, hist(M)[2] 
>>> would return a matrix whose ith column would be the histogram of the 
>>> ith 
>>> column of M. I know 'hist' was recently updated, and now whenever I 
>>> call it 
>>> on a matrix, I get the following error:
>>>
>>> julia> x = rand(10,10);
>>>
>>> julia> hist(x)
>>> ERROR: Incorrect size of H.
>>>  in hist! at statistics.jl:460
>>>  in hist at statistics.jl:470
>>>  in hist at statistics.jl:472
>>>
>>> I get this even if I provide the number of bins or bin edges. I 
>>> believe H is where hist! is writing the column-wise histogram, but I'm 
>>> not 
>>> sure why it's always of the wrong size. I may be misusing the updated 
>>> 'hist', but I can't figure out how from the code and documentation. 
>>> Thanks 
>>> in advance for any help.
>>>
>>> https://github.com/JuliaLang/julia/blob/master/base/statistics.jl
>>>
>>> julia> versioninfo()
>>> Julia Version 0.3.0-prerelease+2503
>>> Commit 2990c29 (2014-04-06 04:30 UTC)
>>> Platform Info:
>>>   System: Darwin (x86_64-apple-darwin13.1.0)
>>>   CPU: Intel(R) Core(TM) i7 CPU   M 620  @ 2.67GHz
>>>   WORD_SIZE: 64
>>>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
>>>   LAPACK: libopenblas
>>>   LIBM: libopenlibm
>>>
>>

Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread Mason McGill


On Tuesday, April 8, 2014 1:23:57 PM UTC-7, Stefan Karpinski wrote:
>
> On Tue, Apr 8, 2014 at 4:10 PM, Mason McGill 
> 
> > wrote:
>
>>
>> After all this is sorted out, I'd be happy to distill this into a 
>> subsection for the Julia "Types" documentation about conventions for 
>> programming with protocols, if you think it belongs there.
>>
>
> For what it's worth, I do think there is need for multiple inheritance and 
> formal protocols – we just haven't added those features and it's unclear 
> what they should look like. The fact that generic functions live outside of 
> types is a very good thing, however, and should not change (although 
> #1974would
>  allow a more traditional o.o.-like style as well). 
>

At the moment, though, it doesn't look like the difference between 
declaring new functions extending existing functions is in the relevant 
sections of the language documentation (I searched "Methods", "Functions", 
"Types", and "Modules").  It's hinted to in "Modules/Default top-level 
definitions and bare modules", but never fully explained.  It seems like an 
important feature to document.


Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread Stefan Karpinski
No problem – glad we could clear up the confusion. Generic functions take a
little getting used to, but once you do, they're extremely powerful and
quite intuitive.


On Tue, Apr 8, 2014 at 4:30 PM, Mason McGill wrote:

>
>
> On Tuesday, April 8, 2014 1:17:06 PM UTC-7, Isaiah wrote:
>>
>>  This is what I was looking for; so if I understand you correctly, you
>>> satisfy protocols by extending/monkey-patching Base.  This seems
>>> reasonable, but what do you do when you want to define your own protocol
>>> (e.g. Classifier), and Base doesn't have the functions you'd like to
>>> require (e.g. fit, predict)?
>>>
>>
>> As Jameson said (I think): there isn't anything particularly special
>> about Base, except that it's installed/available by default. Users will
>> need to import your library to use your stuff, so if they want to extend a
>> (library) built-in, they will do `import MasonLib: fit, predict` rather
>> than the imports from Base.
>>
>> Oh I see.  Sorry if I was thick about this; the languages I'm most used
> to (C++, D, Python) solve this problem pretty differently.  Julia's
> approach is at least as reasonable, IMO.
>
> Thanks!
> -Mason
>


Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread Mason McGill


On Tuesday, April 8, 2014 1:17:06 PM UTC-7, Isaiah wrote:
>
> This is what I was looking for; so if I understand you correctly, you 
>> satisfy protocols by extending/monkey-patching Base.  This seems 
>> reasonable, but what do you do when you want to define your own protocol 
>> (e.g. Classifier), and Base doesn't have the functions you'd like to 
>> require (e.g. fit, predict)?
>>
>
> As Jameson said (I think): there isn't anything particularly special about 
> Base, except that it's installed/available by default. Users will need to 
> import your library to use your stuff, so if they want to extend a 
> (library) built-in, they will do `import MasonLib: fit, predict` rather 
> than the imports from Base.
>
> Oh I see.  Sorry if I was thick about this; the languages I'm most used to 
(C++, D, Python) solve this problem pretty differently.  Julia's approach 
is at least as reasonable, IMO.

Thanks!
-Mason


Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Stefan Karpinski
Eh, doesn't seem that hard to write `while true` and `while` by itself is
kind of confusing. I also don't necessarily think this is how everyone
should write loops, but I increasingly find myself starting out by writing
`while true` and then putting conditions where they are needed as I go.
Then after I've written the loop out, I'll figure out how to refactor it as
a while condition.


On Tue, Apr 8, 2014 at 3:38 PM, Mike Innes  wrote:

> If while true loops are idiomatic, could we perhaps make the true
> optional?
>
>
> On Tuesday, 8 April 2014 18:57:53 UTC+1, Stefan Karpinski wrote:
>
>> Good idea. For what it's worth, these days I would be perfectly happy to
>> only program with while true loops and explicit breaks.
>>
>> On Apr 8, 2014, at 1:41 PM, Kevin Squire  wrote:
>>
>> Although not too frequent, this would be a good FAQ entry.
>>
>> Cheers, Kevin
>>
>>
>> On Tuesday, April 8, 2014, Pierre-Yves Gérardy  wrote:
>>
>>> This does the trick:
>>>
>>> while true
>>> # ...
>>> condition || break
>>> end
>>>
>>>
>>>
>>> On Tuesday, April 8, 2014 5:26:00 AM UTC+2, Freddy Chua wrote:

 as stated in question..

>>>


Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread Stefan Karpinski
On Tue, Apr 8, 2014 at 4:10 PM, Mason McGill wrote:

>
> This is what I was looking for; so if I understand you correctly, you
> satisfy protocols by extending/monkey-patching Base.
>

An important distinction between this and monkey-patching is that if you
create a new type and then only define methods for which one of the
arguments must be of that type, you are never clobbering functionality that
someone else defined. We don't enforce that, but it's best practice not to
redefine existing functionality. Fortunately, multiple dispatch makes this
easy to do without resorting to monkey patching.


> This seems reasonable, but what do you do when you want to define your own
> protocol (e.g. Classifier), and Base doesn't have the functions you'd like
> to require (e.g. fit, predict)?
>

You just define your own abstract types and generic functions and implement
generic functionality in terms of those generic functions. There's no magic
and it's all just user-level code.

Is it the lack of multiple inheritance that's throwing you? Lack of formal
>> specifications for protocols? The fact that generic functions live outside
>> of types?
>>
>
> Nope; those all seem like thoughtful, reasonable design decisions : )
>
> After all this is sorted out, I'd be happy to distill this into a
> subsection for the Julia "Types" documentation about conventions for
> programming with protocols, if you think it belongs there.
>

For what it's worth, I do think there is need for multiple inheritance and
formal protocols – we just haven't added those features and it's unclear
what they should look like. The fact that generic functions live outside of
types is a very good thing, however, and should not change (although
#1974would allow a
more traditional o.o.-like style as well).


Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread Isaiah Norton
>
> This is what I was looking for; so if I understand you correctly, you
> satisfy protocols by extending/monkey-patching Base.  This seems
> reasonable, but what do you do when you want to define your own protocol
> (e.g. Classifier), and Base doesn't have the functions you'd like to
> require (e.g. fit, predict)?
>

As Jameson said (I think): there isn't anything particularly special about
Base, except that it's installed/available by default. Users will need to
import your library to use your stuff, so if they want to extend a
(library) built-in, they will do `import MasonLib: fit, predict` rather
than the imports from Base.



On Tue, Apr 8, 2014 at 4:10 PM, Mason McGill wrote:

> On Monday, April 7, 2014 8:51:20 PM UTC-7, Stefan Karpinski wrote:
>>
>> A couple of examples of informal protocols that are used all the time in
>> Julia and allow user defined types to easily hook into predefined generic
>> behaviors are the start/done/next protocol for iteration and the order and
>> sort! protocols ordering and sorting things. The ModInt 
>> exampleshows
>>  that if you just define addition and multiplication for a new
>> user-defined numeric type, you can immediately construct matrices of that
>> type and multiply them (unfortunately, this example is currently 
>> broken
>> ).
>>
>> This is what I was looking for; so if I understand you correctly, you
> satisfy protocols by extending/monkey-patching Base.  This seems
> reasonable, but what do you do when you want to define your own protocol
> (e.g. Classifier), and Base doesn't have the functions you'd like to
> require (e.g. fit, predict)?
>
> Is it the lack of multiple inheritance that's throwing you? Lack of formal
>> specifications for protocols? The fact that generic functions live outside
>> of types?
>>
>
> Nope; those all seem like thoughtful, reasonable design decisions : )
>
> After all this is sorted out, I'd be happy to distill this into a
> subsection for the Julia "Types" documentation about conventions for
> programming with protocols, if you think it belongs there.
>


Re: [julia-users] Re: [julia-dev] Re: Polymorphism and user-defined types

2014-04-08 Thread Mason McGill
On Monday, April 7, 2014 8:51:20 PM UTC-7, Stefan Karpinski wrote:
>
> A couple of examples of informal protocols that are used all the time in 
> Julia and allow user defined types to easily hook into predefined generic 
> behaviors are the start/done/next protocol for iteration and the order and 
> sort! protocols ordering and sorting things. The ModInt 
> exampleshows
>  that if you just define addition and multiplication for a new 
> user-defined numeric type, you can immediately construct matrices of that 
> type and multiply them (unfortunately, this example is currently 
> broken
> ).
>
> This is what I was looking for; so if I understand you correctly, you 
satisfy protocols by extending/monkey-patching Base.  This seems 
reasonable, but what do you do when you want to define your own protocol 
(e.g. Classifier), and Base doesn't have the functions you'd like to 
require (e.g. fit, predict)?

Is it the lack of multiple inheritance that's throwing you? Lack of formal 
> specifications for protocols? The fact that generic functions live outside 
> of types?
>

Nope; those all seem like thoughtful, reasonable design decisions : )

After all this is sorted out, I'd be happy to distill this into a 
subsection for the Julia "Types" documentation about conventions for 
programming with protocols, if you think it belongs there.


Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Mike Innes
If while true loops are idiomatic, could we perhaps make the true optional?

On Tuesday, 8 April 2014 18:57:53 UTC+1, Stefan Karpinski wrote:
>
> Good idea. For what it's worth, these days I would be perfectly happy to 
> only program with while true loops and explicit breaks.
>
> On Apr 8, 2014, at 1:41 PM, Kevin Squire > 
> wrote:
>
> Although not too frequent, this would be a good FAQ entry. 
>
> Cheers, Kevin 
>
> On Tuesday, April 8, 2014, Pierre-Yves Gérardy 
> > 
> wrote:
>
>> This does the trick:
>>
>> while true
>> # ...
>> condition || break
>> end
>>
>>
>>
>> On Tuesday, April 8, 2014 5:26:00 AM UTC+2, Freddy Chua wrote:
>>>
>>> as stated in question..
>>>
>>

Re: [julia-users] Re: Radio.jl: a digital communications package

2014-04-08 Thread Kaj Wiik


On Tuesday, April 8, 2014 5:43:05 AM UTC+3, Jay Kickliter wrote:
>
> You're absolutely right tagging, but have no intention of turning Radio 
> into a streaming processing framework. My inspiration is 
> LiquidDSPand Matlab's communications toolbox. If 
> liquid wasn't GPL, I would just write an interface to it. It can be 
> compiled without any dependancies, and has phenomenal documentation.
>

Hmm, there is GSL.jl and GSL is GPL (and in fact also FFTW), I guess there 
are no legal problems in writing an interface (unless you plan to use it in 
a closed source software).

Very interesting thread, a lot of good work, I'd very much like to see the 
RTLSDR interface :-)...

Cheers,
Kaj



[julia-users] Re: hist on matrices

2014-04-08 Thread Ivar Nesje
Now the fix has been merged, so now you just have to pull and make to get a 
working version (or wait for the next nightly release).

Ivar

kl. 19:50:34 UTC+2 tirsdag 8. april 2014 skrev Stephen Voinea følgende:
>
> Happy to hear I didn't just point out a bunch of correctly working code 
> that I didn't understand. Take care. 
>
> On Tuesday, April 8, 2014 2:36:23 AM UTC-4, Ivar Nesje wrote:
>>
>> I was also confused by  sub(H(H, :, j), so I just removed it. 
>>
>> kl. 08:12:04 UTC+2 tirsdag 8. april 2014 skrev Stephen Voinea følgende:
>>>
>>> Thanks again!
>>>
>>> On Tuesday, April 8, 2014 2:00:50 AM UTC-4, Ivar Nesje wrote:

 This should be fixed with https://github.com/JuliaLang/julia/pull/6462

 kl. 07:39:05 UTC+2 tirsdag 8. april 2014 skrev Ivar Nesje følgende:
>
> Thanks for the report.
>
> I found the bug in 
> https://github.com/JuliaLang/julia/blob/master/base/statistics.jl#L470, 
> because it tries to calculate length(edg) - 1, but actually calculates 
> length(edg - 1), which is kind of useless.
>
> I'll work on a patch (and maybe add a test).
>
> Ivar
>
> kl. 01:26:43 UTC+2 tirsdag 8. april 2014 skrev Stephen Voinea følgende:
>>
>> If I recall correctly, it used to be that for a matrix M, hist(M)[2] 
>> would return a matrix whose ith column would be the histogram of the ith 
>> column of M. I know 'hist' was recently updated, and now whenever I call 
>> it 
>> on a matrix, I get the following error:
>>
>> julia> x = rand(10,10);
>>
>> julia> hist(x)
>> ERROR: Incorrect size of H.
>>  in hist! at statistics.jl:460
>>  in hist at statistics.jl:470
>>  in hist at statistics.jl:472
>>
>> I get this even if I provide the number of bins or bin edges. I 
>> believe H is where hist! is writing the column-wise histogram, but I'm 
>> not 
>> sure why it's always of the wrong size. I may be misusing the updated 
>> 'hist', but I can't figure out how from the code and documentation. 
>> Thanks 
>> in advance for any help.
>>
>> https://github.com/JuliaLang/julia/blob/master/base/statistics.jl
>>
>> julia> versioninfo()
>> Julia Version 0.3.0-prerelease+2503
>> Commit 2990c29 (2014-04-06 04:30 UTC)
>> Platform Info:
>>   System: Darwin (x86_64-apple-darwin13.1.0)
>>   CPU: Intel(R) Core(TM) i7 CPU   M 620  @ 2.67GHz
>>   WORD_SIZE: 64
>>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
>>   LAPACK: libopenblas
>>   LIBM: libopenlibm
>>
>

Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Stefan Karpinski
Good idea. For what it's worth, these days I would be perfectly happy to only 
program with while true loops and explicit breaks.

> On Apr 8, 2014, at 1:41 PM, Kevin Squire  wrote:
> 
> Although not too frequent, this would be a good FAQ entry. 
> 
> Cheers, Kevin 
> 
>> On Tuesday, April 8, 2014, Pierre-Yves Gérardy  wrote:
>> This does the trick:
>> 
>> while true
>> # ...
>> condition || break
>> end
>> 
>> 
>> 
>>> On Tuesday, April 8, 2014 5:26:00 AM UTC+2, Freddy Chua wrote:
>>> as stated in question..


[julia-users] Re: hist on matrices

2014-04-08 Thread Stephen Voinea
Happy to hear I didn't just point out a bunch of correctly working code 
that I didn't understand. Take care. 

On Tuesday, April 8, 2014 2:36:23 AM UTC-4, Ivar Nesje wrote:
>
> I was also confused by  sub(H(H, :, j), so I just removed it. 
>
> kl. 08:12:04 UTC+2 tirsdag 8. april 2014 skrev Stephen Voinea følgende:
>>
>> Thanks again!
>>
>> On Tuesday, April 8, 2014 2:00:50 AM UTC-4, Ivar Nesje wrote:
>>>
>>> This should be fixed with https://github.com/JuliaLang/julia/pull/6462
>>>
>>> kl. 07:39:05 UTC+2 tirsdag 8. april 2014 skrev Ivar Nesje følgende:

 Thanks for the report.

 I found the bug in 
 https://github.com/JuliaLang/julia/blob/master/base/statistics.jl#L470, 
 because it tries to calculate length(edg) - 1, but actually calculates 
 length(edg - 1), which is kind of useless.

 I'll work on a patch (and maybe add a test).

 Ivar

 kl. 01:26:43 UTC+2 tirsdag 8. april 2014 skrev Stephen Voinea følgende:
>
> If I recall correctly, it used to be that for a matrix M, hist(M)[2] 
> would return a matrix whose ith column would be the histogram of the ith 
> column of M. I know 'hist' was recently updated, and now whenever I call 
> it 
> on a matrix, I get the following error:
>
> julia> x = rand(10,10);
>
> julia> hist(x)
> ERROR: Incorrect size of H.
>  in hist! at statistics.jl:460
>  in hist at statistics.jl:470
>  in hist at statistics.jl:472
>
> I get this even if I provide the number of bins or bin edges. I 
> believe H is where hist! is writing the column-wise histogram, but I'm 
> not 
> sure why it's always of the wrong size. I may be misusing the updated 
> 'hist', but I can't figure out how from the code and documentation. 
> Thanks 
> in advance for any help.
>
> https://github.com/JuliaLang/julia/blob/master/base/statistics.jl
>
> julia> versioninfo()
> Julia Version 0.3.0-prerelease+2503
> Commit 2990c29 (2014-04-06 04:30 UTC)
> Platform Info:
>   System: Darwin (x86_64-apple-darwin13.1.0)
>   CPU: Intel(R) Core(TM) i7 CPU   M 620  @ 2.67GHz
>   WORD_SIZE: 64
>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
>   LAPACK: libopenblas
>   LIBM: libopenlibm
>


Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Kevin Squire
Although not too frequent, this would be a good FAQ entry.

Cheers, Kevin

On Tuesday, April 8, 2014, Pierre-Yves Gérardy  wrote:

> This does the trick:
>
> while true
> # ...
> condition || break
> end
>
>
>
> On Tuesday, April 8, 2014 5:26:00 AM UTC+2, Freddy Chua wrote:
>>
>> as stated in question..
>>
>


Re: [julia-users] Radio.jl: a digital communications package

2014-04-08 Thread Miguel Bazdresch
Jay,

Indeed, the disadvantage of typing is that the simulator becomes somewhat
inflexible, in a sense. I'm still not sure my typing scheme is good, but
the only way to know is to try it. Just as an example, I initially thought
every waveform should have a "starting time" field. Now I'm not so sure.

I will open source my package when it's more functional and when the typing
system is better ironed out. I really don't know, at this time, whether
different people writing their own digital comm packages is inefficient or
not. There are many ways to implement such a package, and it may be that
between several people we can explore the alternatives quicker, and then
let people choose a "winner".

Having said that, I do envision eventually to make my package capable of
multiprocessing. Behind my vision of having "blocks" that take input and
produce output, independently of other blocks, is to be able to assign each
block to different processors. I have a separate package that explores
these ideas (https://bitbucket.org/mbaz/chango). In digital comm,
simulations can take so long that, even at Julia's speed, I see parallelism
as necessary.

I also expect to be able to interface to external sources and sinks --
chango.jl already can interface with a sound card in Linux.

-- mb


On Tue, Apr 8, 2014 at 11:18 AM, Jay Kickliter wrote:

> Thanks for the info. I've trying to come up with a type scheme. Say I
> create some modulated symbols, then interpolate them with a nyquist filter,
> then upsample and shift the signal with a mixer. It would be nice to know
> the relative sample rate and center frequency of the signal, plus mod type.
> But I can't quite see what makes sense until I actually start using the
> code, which is why I haven't been typing everything yet. It sound like
> you've given it a lot of thought.
>
> Are you planning on open sourcing your code, or is it too specific to what
> you're doing? If you are going to open source it I'd hate be writing
> duplicate code, especially if you have better ideas. I just want a decent
> comms framework so I can pitch Julia to my company as an alternative to
> Matlab.
>
>
> On Tuesday, April 8, 2014 7:32:29 AM UTC-6, Miguel Bazdresch wrote:
>
>> Jay,
>>
>> I'm also writing a package to do digital communications simulation, to
>> support my work both in research and in teaching. There's too little
>> functionality at this point to make it worth sharing, but I thought I'd
>> share a couple of ideas.
>>
>> I'm using julia's type system to define bits, symbols, and waveform
>> types. They're all vectors of numbers, but the type works as a label or
>> identifier. I think this makes it easier for students to build their
>> simulations: they don't have to mentally keep track of the meaning of each
>> vector. Also, it makes it easy to detect errors such as adding a bit vector
>> to a signal vector.
>>
>> Using types like this makes it easy to carry simulation information
>> around. For example, the waveform type has a field for the sampling
>> interval, and my spectrum plotting function gets that information from the
>> waveform itself.
>>
>> This also allows me to define blocks that take vectors of one type and
>> output a different type. For example, a matched filter takes a waveform and
>> outputs a symbol vector. With a large enough library of blocks, you can
>> draw a diagram of your system and translate that into a simulation very
>> easily. Any inconsistencies are detected by the type system itself.
>>
>> -- mb
>>
>>
>> On Sun, Apr 6, 2014 at 4:02 PM, Jay Kickliter wrote:
>>
>>> I didn't tag the subject with [ANN] since *Radio.jl
>>> * is barely a package yet.
>>> But I am looking for feedback, feature requests, and hopefully some help.
>>>
>>> I'm mainly writing the package to support my work with space
>>> communications, so I will be focusing on Phase Shift Keying and rectangular
>>> Quadrature Amplitude Modulation. But Julia needs a general comms package.
>>> If you have any needs/suggestions please let me know.
>>>
>>> I mistakenly re-implemeted some of *DSP.jl*'s functionality, and some
>>> of what I've written is missing from it. Maybe Radio's filtering functions
>>> should be moved to DSP?
>>>
>>
>>


Re: [julia-users] Re: "Getting around" a PosDefException

2014-04-08 Thread Stefan Karpinski
Is it possible to default to unpivoted and if that fails detect that a
pivoted Cholesky might have worked and include a recommendation to try the
pivoted version in the error message?


On Tue, Apr 8, 2014 at 10:58 AM, Andreas Noack Jensen <
andreasnoackjen...@gmail.com> wrote:

> It would be helpful if the LAPACK codes were written out in the Julia
> exception, but it is not most exciting thing to write. The un-pivoted
> Cholesky factor is not triangular, so I think returning that would also
> cause some confusion.
>
>
> 2014-04-08 16:50 GMT+02:00 Iain Dunning :
>
> Jiahao: interesting link! Do you think we should put the meaning of that
>> error code somewhere? Maybe best would be as the actual message of the
>> PosDefException.
>> Andreas: if we un-pivot the result then the user would be unaware,
>> correct? I feel like chol() is the "casual" way of doing it and should make
>> a best effort to work, whereas cholfact is the more poweruser version.
>> David: I was indeed playing around with max-cut, check out
>> https://github.com/JuliaOpt/JuMP.jl/blob/sdp/examples/maxcut_sdp.jl
>>
>> Cheers,
>> Iain
>>
>>
>> On Tuesday, April 8, 2014 5:58:36 AM UTC-4, David de Laat wrote:
>>>
>>> You can also use a hack to make the matrix positive definite:
>>> mineig = minimum(eigvals(M))
>>> M -= mineig * eye(M)
>>>
>>> (And in case you're working on max-cut you can also use
>>> M = (M - mineig * eye(M)) / (1-mineig)
>>> so that the linear constraints in the semidefinite program are still
>>> satisfied by the new matrix M.)
>>>
>>> Best,
>>> David
>>>
>>
>
>
> --
> Med venlig hilsen
>
> Andreas Noack Jensen
>


Re: [julia-users] Radio.jl: a digital communications package

2014-04-08 Thread Jay Kickliter
Thanks for the info. I've trying to come up with a type scheme. Say I 
create some modulated symbols, then interpolate them with a nyquist filter, 
then upsample and shift the signal with a mixer. It would be nice to know 
the relative sample rate and center frequency of the signal, plus mod type. 
But I can't quite see what makes sense until I actually start using the 
code, which is why I haven't been typing everything yet. It sound like 
you've given it a lot of thought.

Are you planning on open sourcing your code, or is it too specific to what 
you're doing? If you are going to open source it I'd hate be writing 
duplicate code, especially if you have better ideas. I just want a decent 
comms framework so I can pitch Julia to my company as an alternative to 
Matlab.

On Tuesday, April 8, 2014 7:32:29 AM UTC-6, Miguel Bazdresch wrote:
>
> Jay,
>
> I'm also writing a package to do digital communications simulation, to 
> support my work both in research and in teaching. There's too little 
> functionality at this point to make it worth sharing, but I thought I'd 
> share a couple of ideas.
>
> I'm using julia's type system to define bits, symbols, and waveform types. 
> They're all vectors of numbers, but the type works as a label or 
> identifier. I think this makes it easier for students to build their 
> simulations: they don't have to mentally keep track of the meaning of each 
> vector. Also, it makes it easy to detect errors such as adding a bit vector 
> to a signal vector.
>
> Using types like this makes it easy to carry simulation information 
> around. For example, the waveform type has a field for the sampling 
> interval, and my spectrum plotting function gets that information from the 
> waveform itself.
>
> This also allows me to define blocks that take vectors of one type and 
> output a different type. For example, a matched filter takes a waveform and 
> outputs a symbol vector. With a large enough library of blocks, you can 
> draw a diagram of your system and translate that into a simulation very 
> easily. Any inconsistencies are detected by the type system itself.
>
> -- mb
>
>
> On Sun, Apr 6, 2014 at 4:02 PM, Jay Kickliter 
> 
> > wrote:
>
>> I didn't tag the subject with [ANN] since *Radio.jl 
>> * is barely a package yet. But 
>> I am looking for feedback, feature requests, and hopefully some help.
>>
>> I'm mainly writing the package to support my work with space 
>> communications, so I will be focusing on Phase Shift Keying and rectangular 
>> Quadrature Amplitude Modulation. But Julia needs a general comms package. 
>> If you have any needs/suggestions please let me know.
>>
>> I mistakenly re-implemeted some of *DSP.jl*'s functionality, and some of 
>> what I've written is missing from it. Maybe Radio's filtering functions 
>> should be moved to DSP?
>>
>
>

Re: [julia-users] Hyper-Dual numbers

2014-04-08 Thread John Myles White
Hi Rob,

Please do submit your package to METADATA now that it has a well-defined 
license. It seems like a really useful tool to have available.

 -- John

On Apr 6, 2014, at 4:21 PM, Robert J Goedman  wrote:

> Hi John,
> 
> Jeff has updated his source files with the MIT license and I've pasted those 
> into the LICENSE file of the Julia package.
> 
> Jason Merrill has also given good feedback that I'm still looking into. My 
> interpretation of his feedback (a single package covering different hyper 
> number types and orders) is substantial more work and will definitely take 
> longer. So maybe we should publish the current version?
> 
> Regards,
> Rob J. Goedman
> goed...@icloud.com
> 
> 
> 
> On Apr 6, 2014, at 12:14 PM, Jeffrey Fike  wrote:
> 
>> Rob,
>> 
>> Thanks for your interest.  I have been meaning to look into an actual open 
>> source license.  I went with the MIT license.  I have updated the code on 
>> the website to reflect this.  Please let me know if you need any additional 
>> information.
>> 
>> Jeff Fike
> 
> On Mar 29, 2014, at 5:55 PM, John Myles White  
> wrote:
> 
>> Thanks for looking into it, Rob. In the absence of a license, the code is 
>> technically not free to use. But I imagine the authors would like to share 
>> their code, so it should be easy to convince them to use something formal 
>> like the MIT or BSD licenses.
>> 
>>  — John
>> 
>> On Mar 29, 2014, at 5:52 PM, Robert J Goedman  wrote:
>> 
>>> John,
>>> 
>>> No license is mentioned on the c++ code nor on the matlab versions as far 
>>> as I can see.
>>> 
>>> I'll send the authors an email.
>>> 
>>> Regards,
>>> Rob J. Goedman
>>> goed...@icloud.com
>>> 
> 
>>> On Mar 29, 2014, at 5:47 PM, John Myles White  
>>> wrote:
>>> 
 This looks really cool. Any idea what the license was on the original file?
 
  — John
 
 On Mar 29, 2014, at 5:43 PM, Robert J Goedman  wrote:
 
> Hi,
> 
> As a first 'jump into the fray' exercise I've attempted to translate 
> Jeffrey Fike's hyper-dual numbers code from c++ to Julia, more or less 
> following the DualNumbers package.
> 
> The c++ code can be found at 
> http://adl.stanford.edu/hyperdual/hyperdual.h . The paper itself at 
> http://adl.stanford.edu/hyperdual/Fike_AIAA-2011-886.pdf .
> 
> The Julia package can be found at: 
> https://github.com/goedman/HyperDualNumbers.jl.git .
> 
> Of course, I'm pretty new at this so I'm sure there will be errors and 
> poor practices. So any feedback is appreciated.
> 
> Also, I'm wondering if the type should be called Hyper or a better name 
> would be HyperDual.
> 
> This work was triggered by the interesting threads around openPP, 
> TaylorSeries.jl, Calculus2, PowerSeries.jl (and at some time I hope 
> MCMC.jl).
> 
> Rob J. Goedman
> goed...@icloud.com
> 
> 



Re: [julia-users] Re: "Getting around" a PosDefException

2014-04-08 Thread Andreas Noack Jensen
It would be helpful if the LAPACK codes were written out in the Julia
exception, but it is not most exciting thing to write. The un-pivoted
Cholesky factor is not triangular, so I think returning that would also
cause some confusion.


2014-04-08 16:50 GMT+02:00 Iain Dunning :

> Jiahao: interesting link! Do you think we should put the meaning of that
> error code somewhere? Maybe best would be as the actual message of the
> PosDefException.
> Andreas: if we un-pivot the result then the user would be unaware,
> correct? I feel like chol() is the "casual" way of doing it and should make
> a best effort to work, whereas cholfact is the more poweruser version.
> David: I was indeed playing around with max-cut, check out
> https://github.com/JuliaOpt/JuMP.jl/blob/sdp/examples/maxcut_sdp.jl
>
> Cheers,
> Iain
>
>
> On Tuesday, April 8, 2014 5:58:36 AM UTC-4, David de Laat wrote:
>>
>> You can also use a hack to make the matrix positive definite:
>> mineig = minimum(eigvals(M))
>> M -= mineig * eye(M)
>>
>> (And in case you're working on max-cut you can also use
>> M = (M - mineig * eye(M)) / (1-mineig)
>> so that the linear constraints in the semidefinite program are still
>> satisfied by the new matrix M.)
>>
>> Best,
>> David
>>
>


-- 
Med venlig hilsen

Andreas Noack Jensen


Re: [julia-users] Hyper-Dual numbers

2014-04-08 Thread Robert J Goedman
Thanks Jason, that helps a lot. Also for the pointer to the reverse mode AD. 
And you are quite right, number types in Julia is fun and a good learning step 
in my case.  As were your suggestions and looking at the different approach 
taken by PowerSeries and TaylorSeries as far as type definitions go! I'll 
certainly continue to follow the PowerSeries & TaylorSeries discussion.

My interest in HyperDual numbers was triggered by the accuracy argument in the 
HyperNumber paper (in fact I only need the gradient).

Time to go back to focus on MCMC and a full Julia version of a Stan like tool.

Regards,
Rob J. Goedman
goed...@icloud.com



On Apr 7, 2014, at 10:34 AM, Jason Merrill  wrote:

> Also check out the work that Miles Lubin and others are doing on reverse mode 
> automatic differentiation. Some really cool stuff in the pipeline.
> 
> On Monday, April 7, 2014 8:35:10 AM UTC-7, Jason Merrill wrote:
> I partly meant to suggest that PowerSeries.jl 
> https://github.com/jwmerrill/PowerSeries.jl might also meet your needs for 
> 2nd order forward automatic differentiation, and it also already works to 
> higher orders.
> 
> PowerSeries.jl works by computing truncated power series of functions. You 
> can read derivatives off the series coefficients because
> 
> f(x + e) = f(x) + f'(x) e + f''(x)/2 e^2 + f'''(x)/3! e^3 + ...
> 
> You can choose what order to compute to for any given application.
> 
> To borrow your README example:
> 
> julia> using PowerSeries
> 
> julia> t0 = series(1.5, 1.0, 0.0)
> Series2{Float64}(1.5,1.0,0.0)
> 
> julia> f(x) = e^x / (sqrt(sin(x)^3 + cos(x)^3))
> f (generic function with 1 method)
> 
> # f(1.5 + e) = 4.50 + 4.05e + 4.73e^2 + ...
> julia> f(t0)
> Series2{Float64}(4.497780053946162,4.05342789389862,4.731536840798301)
> 
> # First derivative
> julia> polyder(f(t0))
> Series1{Float64}(4.05342789389862,9.463073681596603)
> 
> # Second derivative
> julia> polyder(polyder(f(t0)))
> 9.463073681596603
> 
> # If you start from the beginning with a higher order series,
> # then you'll be able to take higher order derivatives at the end
> julia> polyder(polyder(polyder(f(series(1.5, 1.0, 0.0, 0.0)
> 32.16790451368894
> 
> As far as I can tell (and I could well be wrong!), if you're interested in 
> differentiating programs to higher orders, truncated power series are a more 
> fit-to-purpose extension of Dual numbers than HyperDual numbers are.
> 
> This whole space is pretty lively right now. I think everyone is realizing 
> how easy it is to write new Number types in Julia, and there are *a lot* of 
> useful notions of number.
> 
> If PowerSeries.jl does end up fitting your purpose, there's plenty of room 
> for contribution/improvement. There's a good discussion going on in an issue 
> right now on figuring out how to combine the best aspects of PowerSeries.jl 
> and a new package called TaylorSeriesl.jl 
> https://github.com/jwmerrill/PowerSeries.jl/issues/7
> 
> Or if I've missed something and HyperDual numbers have some important 
> advantage, that would be good to know!
> 
> 
> On Sunday, April 6, 2014 4:21:33 PM UTC-7, Rob J Goedman wrote:
> Hi John,
> 
> Jeff has updated his source files with the MIT license and I've pasted those 
> into the LICENSE file of the Julia package.
> 
> Jason Merrill has also given good feedback that I'm still looking into. My 
> interpretation of his feedback (a single package covering different hyper 
> number types and orders) is substantial more work and will definitely take 
> longer. So maybe we should publish the current version?
> 
> Regards,
> Rob J. Goedman
> goe...@icloud.com
> 
> 
> 
> On Apr 6, 2014, at 12:14 PM, Jeffrey Fike  wrote:
> 
>> Rob,
>> 
>> Thanks for your interest.  I have been meaning to look into an actual open 
>> source license.  I went with the MIT license.  I have updated the code on 
>> the website to reflect this.  Please let me know if you need any additional 
>> information.
>> 
>> Jeff Fike
> 
> On Mar 29, 2014, at 5:55 PM, John Myles White  wrote:
> 
>> Thanks for looking into it, Rob. In the absence of a license, the code is 
>> technically not free to use. But I imagine the authors would like to share 
>> their code, so it should be easy to convince them to use something formal 
>> like the MIT or BSD licenses.
>> 
>>  — John
>> 
>> On Mar 29, 2014, at 5:52 PM, Robert J Goedman  wrote:
>> 
>>> John,
>>> 
>>> No license is mentioned on the c++ code nor on the matlab versions as far 
>>> as I can see.
>>> 
>>> I'll send the authors an email.
>>> 
>>> Regards,
>>> Rob J. Goedman
>>> goe...@icloud.com
>>> 
> 
>>> On Mar 29, 2014, at 5:47 PM, John Myles White  wrote:
>>> 
 This looks really cool. Any idea what the license was on the original file?
 
  — John
 
 On Mar 29, 2014, at 5:43 PM, Robert J Goedman  wrote:
 
> Hi,
> 
> As a first 'jump into the fray' exercise I've attempted to translate 
> Jeffrey Fike's hyper-dual numbers code from c++ to Julia, more or less 
>

Re: [julia-users] Re: "Getting around" a PosDefException

2014-04-08 Thread Iain Dunning
Jiahao: interesting link! Do you think we should put the meaning of that 
error code somewhere? Maybe best would be as the actual message of the 
PosDefException.
Andreas: if we un-pivot the result then the user would be unaware, correct? 
I feel like chol() is the "casual" way of doing it and should make a best 
effort to work, whereas cholfact is the more poweruser version.
David: I was indeed playing around with max-cut, check out 
https://github.com/JuliaOpt/JuMP.jl/blob/sdp/examples/maxcut_sdp.jl

Cheers,
Iain

On Tuesday, April 8, 2014 5:58:36 AM UTC-4, David de Laat wrote:
>
> You can also use a hack to make the matrix positive definite:
> mineig = minimum(eigvals(M))
> M -= mineig * eye(M)
>
> (And in case you're working on max-cut you can also use
> M = (M - mineig * eye(M)) / (1-mineig) 
> so that the linear constraints in the semidefinite program are still 
> satisfied by the new matrix M.)
>
> Best,
> David
>


Re: [julia-users] Singular Spectrum Analysis in Julia?

2014-04-08 Thread Stefan Karpinski
From perusing the Wikipedia page, this technique looks straightforward to 
implement using the linear algebra tools available. It seems like having a good 
SVD implementation is the main difficulty – which we do. Perhaps there are 
subtleties which aren't captured there but I suspect an R or Python 
implementation could be ported in less than an hour.

> On Apr 8, 2014, at 9:49 AM, Fabian Gans  wrote:
> 
> Hi all, 
> 
> has anyone implemented an SSA algorithm in julia or wrapped a library for it? 
> I could not find anything in the available packages and wanted to make sure I 
> didn't miss it. If not I will stick to R for this 😫. See here 
> http://en.wikipedia.org/wiki/Singular_spectrum_analysis for a description of 
> the algorithm. 
> 
> Cheers
> Fabian


[julia-users] Singular Spectrum Analysis in Julia?

2014-04-08 Thread Fabian Gans
Hi all, 

has anyone implemented an SSA algorithm in julia or wrapped a library for 
it? I could not find anything in the available packages and wanted to make 
sure I didn't miss it. If not I will stick to R for this 😫. See here 
http://en.wikipedia.org/wiki/Singular_spectrum_analysis for a description 
of the algorithm. 

Cheers
Fabian


Re: [julia-users] Re: "Getting around" a PosDefException

2014-04-08 Thread David de Laat
You can also use a hack to make the matrix positive definite:
mineig = minimum(eigvals(M))
M -= mineig * eye(M)

(And in case you're working on max-cut you can also use
M = (M - mineig * eye(M)) / (1-mineig) 
so that the linear constraints in the semidefinite program are still 
satisfied by the new matrix M.)

Best,
David


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

2014-04-08 Thread Carlo Baldassi
Unfortunately, from insepcting GLPK source code it seems that whether to 
use GNU MP or GLPK bignum is decided at compile time. So it appears that 
the Windows binaries which are automatically downloaded by the Julia 
package are just not compiled with GNU MP. As far as I can tell, the 
options are 1) compile from source in Windows and put the resulting shared 
library under GLPK/deps/usr/lib 2) find alternative binaries 3) ask the guy 
which provides the Windows binaries (http://www.xypron.de)

On Tuesday, April 8, 2014 12:14:21 AM UTC+2, Stéphane Laurent wrote:
>
> Hello, 
>
>  When I use the *exact* function of the GLPK 
> package, 
> I get something like that :
>
>
>
>
>
>
>
> *julia> GLPK.exact(lp) glp_exact: 6 rows, 9 columns, 18 non-zeros GLPK 
> bignum module is being used (Consider installing GNU MP to attain a much 
> better performance.) * 6: objval = 0.107142857142857 (1) * 6: objval = 
> 0.107142857142857 (1) OPTIMAL SOLUTION FOUND 0*
>
>
> GNU MP  should be installed on my Windows machine 
> because I use the gmp packagein 
> R. What should I do in order that GLPK uses this library in Julia ? 
>


[julia-users] Re: I noticed there is no do while loop

2014-04-08 Thread Pierre-Yves Gérardy
This does the trick:

while true
# ...
condition || break
end



On Tuesday, April 8, 2014 5:26:00 AM UTC+2, Freddy Chua wrote:
>
> as stated in question..
>


Re: [julia-users] Radio.jl: a digital communications package

2014-04-08 Thread Miguel Bazdresch
Jay,

I'm also writing a package to do digital communications simulation, to
support my work both in research and in teaching. There's too little
functionality at this point to make it worth sharing, but I thought I'd
share a couple of ideas.

I'm using julia's type system to define bits, symbols, and waveform types.
They're all vectors of numbers, but the type works as a label or
identifier. I think this makes it easier for students to build their
simulations: they don't have to mentally keep track of the meaning of each
vector. Also, it makes it easy to detect errors such as adding a bit vector
to a signal vector.

Using types like this makes it easy to carry simulation information around.
For example, the waveform type has a field for the sampling interval, and
my spectrum plotting function gets that information from the waveform
itself.

This also allows me to define blocks that take vectors of one type and
output a different type. For example, a matched filter takes a waveform and
outputs a symbol vector. With a large enough library of blocks, you can
draw a diagram of your system and translate that into a simulation very
easily. Any inconsistencies are detected by the type system itself.

-- mb


On Sun, Apr 6, 2014 at 4:02 PM, Jay Kickliter wrote:

> I didn't tag the subject with [ANN] since *Radio.jl
> * is barely a package yet. But
> I am looking for feedback, feature requests, and hopefully some help.
>
> I'm mainly writing the package to support my work with space
> communications, so I will be focusing on Phase Shift Keying and rectangular
> Quadrature Amplitude Modulation. But Julia needs a general comms package.
> If you have any needs/suggestions please let me know.
>
> I mistakenly re-implemeted some of *DSP.jl*'s functionality, and some of
> what I've written is missing from it. Maybe Radio's filtering functions
> should be moved to DSP?
>


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

2014-04-08 Thread Ivar Nesje
He might have been confused because you linked to the 0.1 version of the 
documentation where GPLK apparently was in the standard library.

Ivar

kl. 08:24:43 UTC+2 tirsdag 8. april 2014 skrev Stéphane Laurent følgende:
>
> 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*
>
>