May 20, 2017 14:08
Hi, @Szabolcs I can confirm "-lmathlink" doesn't work. So I still don't know how to make mingw work. But I tried intel compiler, it works. However, in my experience, intel fortran compiler is good, while intel c compiler is not as good as mingw, because the compilation is much slower and performance is not as good as mingw
May 15, 2017 00:29
@Szabolcs So, you mean MathLink libraries is required by LTemplate?
May 14, 2017 13:32
Hi, Szabolcs. Sorry for late reply. This is the full output pastebin.com/seXCd2hP
 
Apr 27, 2017 16:13
Hi, @Gilles , Thank you for answer. I know that spaces is important in bash. But why space is not relevant inside (( ))
 
May 15, 2016 14:28
@Rashid That makes sense. Thank you very much, Rashid : )
May 15, 2016 06:23
@Rashid sorry for late reply. So google translate call an external script, that is why we can't see the result in the source html, am I right?
May 15, 2016 05:36
@Rashid I mean for example this translation page translate.google.com/#en/zh-CN/nobel
May 15, 2016 05:21
Rashid, do you know why the translated result is not in the source html page? I thought every thing should be in the source page. I am not familiar with the web things.
May 15, 2016 05:21
I mean in browser you can look at the source code of the web page. Source page I mean something describe here w3schools.com/html
May 15, 2016 05:21
Thank you so much. I actually corrected "texts" to "textlist" before, however I selected the wrong version. I selected "1"... Anyway, there was another typo in your onlineTran, I corrected it now.
May 15, 2016 05:21
Oops, Now I got this "ReferenceError: "texts" is not defined.(行 6、ファイル「Code」、プロジェクト「doGet」)"
May 15, 2016 05:21
Hi, Rashid. Your approach seems great. I have followed your step. But I got this error: "TypeError: Cannot read property "0" from undefined.(行 \ 3、ファイル「Code」、プロジェクト「doGet」)"
 

 LibraryLink & MathLink

chat about LibraryLink, MathLink and extending Mathematica wit...
Feb 9, 2016 02:41
@halirutan yeah, can't agree more
Feb 9, 2016 02:37
@halirutan Thank you for suggestion, halirutan : ) You are definitely right, but on the other hand, the errors are always due to pitfalls that a programmer is not aware of. I learned a lot recently because I encounter those weird errors, and tried to figure them out. It is kind of another fun of knowing new things.
Feb 9, 2016 02:23
@halirutan About algorithm, I definite not being able to design LU decomposition algorithm, I read books, such as "matrix computation" by Golub, and then write code according the book
Feb 9, 2016 02:18
@halirutan But now the problem change, the reason I can't stand a 10 times slower compiled function of mma is that after I boost 10 times faster using fortran or C++ in the calculation intensive part, I can directly do "just in time" plotting(for this particular problem), don't have to wait too much time, you know that feeling of waiting: ) and even manipulation, that is awesome.
Feb 9, 2016 02:18
@halirutan Er...I just feel that I maybe need fortran from time to time for speed. Actually I've just started using librarylink. Before that I use only mma for numerically computation, at that time, I calculate Eigenvalues of relatively large matrix, so mathematica is pretty good, since it call MKL.
Feb 9, 2016 02:04
@halirutan the z axes is the time divided by timing of "LUno-outer"
Feb 9, 2016 02:03
@halirutan I make "LUno-outer" as reference 1
Feb 9, 2016 02:03
@halirutan my version in the post is a special treatment of 2x2, using direct formula. According to my googleing, it is a general consensus, for inversion or something else, matrix below 4x4, using direct formula is efficient. For general LU decomposition, a self written version is efficient if the dimension is below 10. here is benchmark I did month ago, postimg.org/image/l9ofl2hkh the green is fortran calling intel lapack, the others are routines I write.
Feb 9, 2016 01:52
@halirutan yeah, but lapack is designed for large matrix, it is slow for small matrix. So I write linearsolve by myself.
Feb 9, 2016 00:53
@halirutan You mean probably faster than fortran? C is definitely not suited for matrix arithmetic. My subroutine is matrix intensive. For c++, there is Eigen library which is handy. But for my subroutine it is still slower than fortran. And the compiler is important, for my fortran subroutine gfortran is much slower than intel fortran, while for my c++ routine, g++ is faster than intel icl. Intel fortran is really an excellent compiler.
Feb 9, 2016 00:35
@halirutan I actually made a post mathematica.stackexchange.com/q/105797/4742
Feb 9, 2016 00:35
@halirutan Hi, halirutan. I use fortran, because I need speed. Before that I have tried my best to write compiled function in mma, but it is 10 times slower. I insist on investigating it because I think mixing fortran is a essential method for people who need extreme speed, and also I saw several post on this site asking for method for calling external numerical fortran library. If this kind of calling is defective, though maybe safe in single thread, it is dangerous.
Feb 5, 2016 02:11
@halirutan @Szabolcs the source code is a fixed version of my post mathematica.stackexchange.com/questions/104283/…
Feb 5, 2016 02:05
@halirutan @Szabolcs Hi, halirutan, Szabolcs. Do you remember that I showed that my fortran librarylink will get different answers every evaluation after making it Listable? The Chat history is here http://chat.stackexchange.com/transcript/message/27047477#27047477

I traced the lines that cause the problem. But I don't know why. Here it is

http://pastebin.com/4TdxGydd C source
http://pastebin.com/vF0U50y2 fortran source

I compile them using intel compiler under windows.

And I found if I delete these two calls in the do loop
Jan 23, 2016 12:12
@halirutan @Szabolcs Oh, I forgot to say. I exported the Plot3D on linux as jpg, and unfortunately, it still the same as that in my post
Jan 23, 2016 12:09
@Szabolcs maybe you are interested too, Szabolcs. I need some insight : ) this problem and that plot3D one have puzzled for more than one week
Jan 23, 2016 12:04
Jan 23, 2016 12:04
@halirutan I have to add, the above librarylink function is created by intel compiler. And I just tried on linux, to create the same librarylink function using gcc, and this time, there is no such peculiar thing happen.
 
Feb 9, 2016 00:20
@JasonB Yeah, the documentation is to be blamed. They should addressing the coordinate issue explicitly on the doc page of Image3D
Feb 8, 2016 15:22
@JasonB I am wrong : (
Feb 8, 2016 15:22
@JasonB Oops, the chopping of last dimension is not natural. The natural way should be from right to left.
Feb 8, 2016 15:21
@JasonB I came up with an explanation about why they made the first two dimension reversed. They design it according the most natural way of chopping a cubic. You have to imaging you have a knife at hand, the most natural way of chopping should be from top to bottom, and back to front, finally left to right. What do you think?
Feb 8, 2016 15:06
@JasonB OK, wait and see : )
Feb 8, 2016 15:03
@JasonB I don't have a linux at hand to confirm this. But if it is due to OS, that is also an inconsistency, bug like
Feb 8, 2016 15:00
@JasonB You have to add @ sign. Jason. Or I won't get notified when you reply me...
Feb 8, 2016 14:59
@JasonB Very weird. Maybe we need someone else to confirm your strange image3D
Feb 8, 2016 14:57
@JasonB Yeah, the blurry image is what I got. But I clearly remember the image before your update is also blurry
Feb 8, 2016 14:45
@JasonB Oh, my fault. I made a wrong test. You are right on reverse. Thank you for correcting me. About the image quality, I think your mma is quite different to mine now, see postimg.org/image/oxzgzxeu1 . The image is not the same as yours. Did you update your mma or using a different setting or new computer maybe?
Feb 8, 2016 14:45
Er...Jason B. Don't forget to add @ sign, because I don't want to miss your commnet : )
Feb 8, 2016 14:45
Are you sure not a total reverse? My test shows that total reverse is the right to go. And I remember before your updating, your image3D is the same as OP, but now your image3D is clearer, this is weird, because I can't get such a clear image3D as yours
Feb 8, 2016 14:45
Sorry, I don't get it. What do you mean by "I don't know why mine is more clear, I get pretty much the same image from OP that I would get from my code"
Feb 8, 2016 14:45
I think we should Reverse[colorArray,{1,2,3}] before Image3D, to make the coordinate back to normal
Feb 8, 2016 14:45
@JasonB And also I just realize there is one more problem in coordinate. Check out tutorial/ImageProcessing, in the coordinate section. The coordinate should be upside down, because Image3D stack from top to bottom.
Feb 8, 2016 14:45
@JasonB Why now your image is much clear than OP's? I can not reproduce your image. What have you done?
Feb 8, 2016 14:45
@JasonB An update is enough, it is a small improvement : )
Feb 8, 2016 14:45
@JasonB Hi, Jason B. I found you actually don't need to create an empty Frame. Just embedded the Image3D in Show and apply the Ticks options in Show is a direct way.
Feb 8, 2016 14:45
@JasonB Yeah, this package is really handy. Thanks : )
Feb 8, 2016 14:45
Hi, Jason B. What do you mean by " edit the tickmarks manually "? I didn't find a way for manually editing