Re: [julia-users] Re: Julia equivalent to a static member function in C++/MATLAB

2015-09-26 Thread Joel Andersson
Yes, this is all clear. Joel

[julia-users] Julia equivalent to a static member function in C++/MATLAB

2015-09-25 Thread Joel Andersson
Hi, In C++ or in MATLAB I would use static member functions to keep the constructors nice and simple, e.g. class MyMatrix { public: static MyMatrix zeros(int n, int m); static MyMatrix ones(int n, int m); static MyMatrix eye(int n); ... }; Which allows me to create class instances

[julia-users] Calling static methods via PyCall?

2014-05-07 Thread Joel Andersson
Hi! I'm new to Julia and am trying to figure out the syntax for calling static methods in via PyCall. The following works fine in Python: import casadi as c x = c.MX.sym(x,2,2) c.gradient(c.det(x),x) % Out[8]: MX((det(x)*inv(x)')) I'm trying to do the same in Julia via PyCall, but it fails on

[julia-users] Re: Calling static methods via PyCall?

2014-05-07 Thread Joel Andersson
Great thanks! Mighty impressed that it actually works! Congrats! Looking forward to that . overload! Joel On Wednesday, May 7, 2014 5:23:20 PM UTC+2, Steven G. Johnson wrote: The problem is that @pyimport is deciding that c.MX is a function (the constructor for the MX type), and is