Indeed, I can not understand why there are vectors at all? I also have difficulty understanding what julia> function myfunc(c::MySimpleContainer, which is what you wanted to do, gets passed off to BLAS which is highly optimized, and that couldn’t happen for your abstractly typed arrays. I’m sure this not the right way, but I can’t figure out how to stop Julia from turning a row slice, that I would have thought would be a 1xm “array” into an incompatible column “vector”. If we let Ax b A x b, then b b is an m × 1 m × 1 column vector. So, if A A is an m × n m × n matrix (i.e., with n n columns), then the product Ax A x is defined for n × 1 n × 1 column vectors x x. The only way I could get this to work was to use rwXfbi = reshape(Xfb,1,m) We define the matrix-vector product only for the case when the number of columns in A A equals the number of rows in x x. This doesn’t work as Xfbi is converted into an mx1 column vector. Where Y is an nxp array, Xfbi is an nxm array, and A is an mxp array. If I understand correctly, you are say that variables and fields in structs can not be abstract, but that function argument definitions can be? I have struggled quite a bit with understanding how and where to specify and convert types especially for complex vectors, arrays, and matrices. Thanks improbable 22 and Elrod your replies have really helped me without them, I would have mistakenly given up on the language. This is enough reason for me to continue learning the language. Still, julia runs on a Raspberry Pi4 without a license. Summary, for filters time-constrained by complex matrix multiplies, julia can be the same speed as Matlab. I should mention that after installing, I had to quit and restart julia’s REPL before the times changed. To follow up: I installed MKL, and now the times are effectively the same as those of Matlab. If anyone can help identify what I am doing wrong, it would be much appreciated. I also coded a julia multiply using for loops these times were very similar (slightly faster) than just using the simple function shown above. I must be doing something drastically wrong as the julia times for multiplying two comlex matrices are over 1000 times longer than matlab times. I couldn’t go over n=1024 in julia as it took too long. Dear All, I have a simple 33 matrix(A) and large number of 31 vectors(v) that I want to find Av multiplication for all of the v vectors. The matlab script I ran was: function tmMltplys()įor n=64 Elapsed time is 0.000240 seconds.įor n=128 Elapsed time is 0.000493 seconds.įor n=256 Elapsed time is 0.001726 seconds.įor n=512 Elapsed time is 0.013201 seconds.įor n=1024 Elapsed time is 0.150515 seconds.įor n=2048 Elapsed time is 0.741310 seconds.įor n=4096 Elapsed time is 5.980977 seconds. Using MAT, LinearAlgebra, Printf, BenchmarkTools #!/usr/local/bin/juliaĮNV = "/home/martin/Dropbox/Matlab/Complex/KM_ComplexFilterToolbox" The julia example is rough as I am new to julia. I have made some simple examples in both cases to evaluate the times. I have not been seeing the expected improvements and have tracked the issue down to the time for multiplying complex matrices. I’ve been looking at some different filter approaches for analyzing ECG signals using Matlab and have recently implemented them in julia in order to get a speed improvement.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |