Fortran library for computation? or should I learn C instead?

I think Fortran is a good choice for computation. It works as its name suggests: just translating the formulas and no need to consider how your computer actually works.
The problem is: I can not find free libraries like GSL to do random number generating, minimization, etc. Some professors in our department are using sort of routines from Numberical Recipe, but many people say its performance is not good and it even has some errors. The MKL library from Intel looks complicated and it also lacks some minimization rountines I am looking for.
In C, GSL seems a very popular library for computation. I checked its manual and it contains all the things I need, but unfortunately there is no good interface for Fortran to use it.
So one solution is to switch to C. In fact C is my first language(almost 10 years ago), and every time I see some C code it just reminds me some good memories. I also appreciate the protability of C. So I would like to pick up C again if I have enough time to play around. However, pointers seem a lot of distraction and for now I just want to get things done quickly..
What's your opinion on this? Any idea will be appreciated and I particularly want to hear people from some computation backgrounds. (PS, I am in econ)

Second for Numpy.  The concern with looping seems unwarranted.  If anything, you will need much less looping.  Case in point, the 1D Haar transform.  The first inner for loop has been replaced with a pair of list slices, [0::2] and [1::2].  (Those give the even and odd elements, respectively.)
side note:  All the heavy lifting is done with Blas and Lapack, both very fast C math libs.  It should not be that much slower than straight C.  I really need to do some benchmarking.
Numpy:
def haar1D(vec):
"[(-0.5 to 0.5)] -> [(-0.5 to 0.5)]"
w = len(vec)
while w > 1:
s = (vec[0:w:2] + vec[1:w:2]) / 2.0
d = (vec[0:w:2] - vec[1:w:2]) / 2.0
vec = n.concatenate((s, d, vec[w:]))
w = w / 2
return vec
Compared to the original C code (from http://www.cs.ucf.edu/~mali/haar/):
void haar1d(float *vec, int n)
int i=0;
int w=n;
float *vecp = new float[n];
for(i=0;i<n;i++)
vecp[i] = 0;
while(w>1)
w/=2;
for(i=0;i<w;i++)
vecp[i] = (vec[2*i] + vec[2*i+1])/sqrt(2.0);
vecp[i+w] = (vec[2*i] - vec[2*i+1])/sqrt(2.0);
for(i=0;i<(w*2);i++)
vec[i] = vecp[i];
delete [] vecp;
(I am reasonably certain the whole sqrt(2) thing was a bug.  Have not found it in any other literature.)
Last edited by keenerd (2010-05-02 13:18:09)

Similar Messages

  • Help! (please :) I have a 1GB iPod that's loaded with music for which my computer can no longer find the original files-due to external mass storage crash during recent move. Is there a way to import iPod music back into my iTunes library on computer???

    Help! (please I have a 1GB iPod that's loaded with music for which my computer can no longer find the original files-due to external mass storage crash during recent move. Is there a way to import iPod music back into my iTunes library on computer???

    Or If there is any purchased music then you can try to transfer purchases
    http://support.apple.com/kb/ht1848
    If you're in the US you can reload purchased music
    http://support.apple.com/kb/ht2519

  • I have a Ipod Nano and want to get another one , and use both. Can I use the same computer and library for both?

    I have a Ipod Nano and want to get another one , and use both. Can I use the same computer and library for both?

    Yes

  • I rented the movie "One for the Money" but it isn't on my computer, what should I do?

    I rented the movie "One for the Money" but it's not in my iTunes. iTunes said that I downloaded the movie but it's not on my computer. what should I do? i also rented the movie "The Vow" but it keeps telling me there was an error in the download, but it won't specify what's wrong so that I can fix it.

    What is the code?
    Did you edit the code several times while working on the form?

  • Had to delete iTunes for computer repair. Downloaded new version 10. Would not open -Message: "iTunes Library.itl cannot be read because it was created by a newer version of iTunes"

    After getting message below iTunes will not open- just disappears off screen.
    Had to delete iTunes for computer repair. Downloaded new version 10. Would not open -Message: "iTunes Library.itl cannot be read because it was created by a newer version of iTunes"

    Unless you've recently attempted to downgrade iTunes this is probably a sign of a corrupt library file. See Empty/corrupt library after upgrade/crash.
    tt2

  • HT5958 After i updated my terabyte, when i open fcpx 10.1 my hard drive never appears, so i can't open a new library for a new project. What should i do?

    After i updated my terabyte, when i open fcpx 10.1 my hard drive never appears, so i can't open a new library for a new project. What should i do?

    Hard drives do not appear in the application. Use File>New Library.

  • Which php and my sql tutorials should i learn for making websites like fb, utube etc..?

    http://www.w3schools.com/php/php_ref_ftp.asp this is a link for php......on this page what should i learn for making websites like fb,etc...and also tell me about my sql http://www.w3schools.com/sql/default.asp ....what should i learn about my sql....for making big dynamic websites....

    on this page what should i learn for making websites like fb,etc...
    ...what should i learn about my sql....for making big dynamic websites....
    Everything and a whole lot more...
    David Powers has written some good books on PHP to help you get started.
    http://foundationphp.com/
    Killer PHP Video Tutorials
    http://www.killerphp.com/
    PHP Academy
    http://phpacademy.org/
    Lynda.com PHP & MySql Essential Training
    http://www.lynda.com/PHP-tutorials/php-with-mysql-essential-training/435-2.html
    Nancy O.

  • HT201269 Have new iPhone 5s and older iPad ( looking to buy new iPad ) question for both is should I hook them up to mu computer and back up the computer on each devise and sink and than the next one.  The second question is should I do the I pad first ca

    Have new iPhone 5s and older iPad ( looking to buy new iPad ) question for both is should I hook them up to y computer and back up the computer on each devise and sink and than the next one.  The second question is should I do the I pad first cause it has photos in my email that have not been downloaded and it is one of or is the first model

    No it's not stealing. They have an allowance that you can share with so many computers/devices. You'll have to authorize her computer to play/use anything bought on your acct. You can do this under the Store menu at top when iTunes is open on her computer.
    As far as getting it all on her computer....I think but I am not sure (because I don't use the feature) but I think if you turn on Home Sharing in iTunes it may copy the music to her computer. I don't know maybe it just streams it. If nothing else you can sign into your acct on her computer and download it all to her computer from the cloud. Not sure exactly how to go about that, I haven't had to do that yet. I wonder if once you authorize her computer and then set it up for automatic downloads (under Edit>Preferences>Store) if everything would download. Sorry I'm not much help on that.

  • I use multiple libraries with itunes - should I create a new library for a 2nd iphone

    I use multiple iTunes libraries to manage multiple devices from the same PC.  I'm purchasing an iPhone 6 and currently have a library for my iPhone 4.  Would I create a new library for this new device?  Also, to restore all content to my new phone, Will this restore be done from the existing iPhone 4 library?  Is this process documented?

    I can't address specific issues regarding iPhones, but in general you can manage multiple iDevices from a single iTunes library.  The test approach is to maintain one or more playlists for each iDevice you use, and configure the latter to sync only from the relevant playlists:
    This article: Transfer content from an iPhone, iPad, or iPod touch to a new device - Apple Support documents Apple's guidance regarding transferring content from one iOS device to another.

  • Setting up a shared library for multiple accounts on the same machine

    I am in idiot. I can't figure it out. This is exactly what I did.
    1 - I set up multiple accounts on the computer. 1 for me and another for my wife.
    2 - I loaded all the music into my account's public folder.
    3 - I set the default folder in both hers and mine iTunes for this Public folder
    4 - I then opened iTunes in my account and none of the songs were showing up so I dragged the folder into iTunes and it did its business. Now my account is all set.
    Here are my questions:
    A - Do I need to drag the folder into my wife's account iTunes as well?
    B - If either of us add music when logged in, will it automatically update in the other iTunes interface or is there something specific that needs to (manually) be done?

    Doing it the way you did, you each have your own iTunes library file and are using the same iTunes music folder.
    Changes by one will not be seen by the other and any new music added by one will have to be added to the library by the other.
    Also, if one deletes music, it will be in teh library for the other but it will not be playable because the other person deleted it in the iTunes music folder.
    Launch iTunes, then immediately press and hold Option, then select *Create new library*.
    Create one in Users/Shared.
    Quit iTunes.
    Move all your music into the new /Users/Shared/iTunes/iTunes music folder.
    Login to your Wife's computer account.
    Move all her music into the new /Users/Shared/iTunes/iTunes music folder.
    On her account, launch iTunes, then immediately press and hold Option, then select *Choose existing library*.
    Select the _iTunes library file_ in /Users/Shared/iTunes.
    In iTunes, File -> Add to library and select the iTunes music folder in /Users/Shared/iTunes.
    All the music will be there.
    Quit iTunes and log out of her account and back into your account and launch iTunes normally.
    All music will be there.
    You should go to /Users/Shared/iTunes folder and right click - get info, click *Ownership & Permissions*. Set *You can* to *Read & Write* and set Others to *Read & Write*.
    Click *Apply to enclosed items*.
    Any changes (new/deleted music, ratings, playlists, etc.) by one will be seen by the other sionce you are using the same iTunes library file.
    Only one person can have iTunes open at a time. If you use Fast User switching, one will need to quit iTunes before the other can use it.

  • How do I replace my uncle's itunes library for mine (without deleting it!?)

    The laptop I have my itunes on is breaking down slowly and I want to get more music on my phone but I can't use my laptop as it won't work.
    My uncle's itunes library is on our computer but I don't want to sync with his stuff and lose mine. But I also don't want to delete his. How can I replace mine with his without deleting his own. I pretty sure he has his library on a computer at his house. (I've tried deleting itunes but it keeps coming back up with his stuff. And I've been stuck trying to figure this out for two hours! Please help, going away on holiday soon and would love to have new songs!!)
    Thanks. (It's a windows PC either 7 or 8)

    If you can, backup your library to a portable hard drive. You don't need to be able to run iTunes, but the laptop has to start. Normally all you need to do is copy off the entire iTunes folder from <User's Music> to your external drive.
    Otherwise first learn how to create an alternate library and then switch between multiple libraries so you can restore your Uncle's library when you're done. See iTunes: How to open an alternate iTunes Library file or create a new one.
    Create a new empty library for yourself, ideally at the root of a portable drive so you're all set to use it elsewhere on another computer. Then recover the data from your iPhone with this user tip. Recover your iTunes library from your iPod or iOS device.
    Good luck.
    tt2

  • What language should I learn?

    What single programming language should I learn that is most flexible? It's needs are to form the basis for MacOSX Cocoa applications, Linux command-line programs (and preferably least X11). This I ask here, for scientists likely lurk here, but don't always program in Objective C. (Though I've heard nothing but good things about it!)
    Currently, I use a variant of APL to assist as I work. When simplifying my life, around 1980, I changed to one editor: the platform-independent emacs. Now I should like to do the same with a 'general' programming language.
    Science is free, and scientists (I might suppose) support Richard Stallman's philosophy. Scientific source code needs be freely offered, written in an ISO standard language, and capable of being made platform-independent. It must easily be modified to use scientific libraries (lapack & netlib's others) and write linux, command-line programs, distributed by way of Sourceforge.
    I've been separated from other scientists for a long time. Is there a language satisfying the above scientific requirements that can also write 'modular' object-oriented applications for MacOSX, using the Aqua interface? If there are no caveats to using 'Java' for this purpose, I'll invest time in that. Have scientists or others faced this question?
    Thanks,
    Bruce
    PS. This question arose while searching for a simple little program to change images into icons:
    http://discussions.apple.com/message.jspa?messageID=7511505#7511505
    Here's the continuation of that post, that illustrates the problem, likely faced my many:
    Indeed, ... I could always use GraphicConverter.
    This topic begs the question of why we use GraphicConverter or PhotoShop to change a single color in an image. That's wasn't always supposed to be the case.
    Unix's credo: do only one thing, but do it well, and the popularity of Lotus 1-2-3, decades ago caused a great idea to emerge and gradually grow, until it became alive in developers' minds. Then it suffered a quick death, from unknown causes.
    Modular Software
    One day, a housewife becoming tired of spending a year learning and 'tuning' huge word processors to write a quick note saying she had gone to the corner market and would be back soon. The concept of modular software emerged: one would buy essentially, a text editor, then buy only those extra little modules you needed for your particular use: editing frills (as in emacs), formatting, adding images, importing & exporting formats, &c: 'personal' software. This needed a modular language; and, as it happened, C++ emerged soon. What ever happened to this idea (or the idea of using sounds for messages in addition to alarms, as in Growl), I never understood.
    Simple Software
    Many 'Google Images' have a white borders. It would be a clever idea to make background colors 'pure' (not in need of dithering when converted to a raster image). In the latter case, every GIF image could be dropped on an icon that could convert the lower-righthand pixel (the background) to a 'transparent' color. An old GIF image taken from the web could lose its background, and be ready to paste to the tiny icon in and 'Info Window'.
    Simple Modules
    Ah, but what about a Shft-Cmd-4 copy from my desktop? Mine are in JPEG format. I need to convert it to GIF. I could add a conversion module to the original little program (which could even convert to PNG). Ah, but the color of my Desktop varies or is, at least, not an 8-bit color (thank God). Then I could add a module that 'de-dithers' the color.
    Relation to Unix
    In old Unix these would be filters, something like this:
    cat image | ddthr | rfmt -png > icon
    Now I find myself using PhotoShop or GraphicConverter for finding & changing one color in an image. I'm still looking, and now becoming inclined to start programming again (which was always a mistake in the past).
    Problems with Programming
    Programming, I've avoided for two reasons: (1) two decades ago, I realized I had learned nearly a dozen text editors until I decided to use solely the platform-independent 'emacs'; and (2) I discovered it took me well over 6 months to master any programming language (more for a word processor), yet less than 6 weeks to forget it completely. (In the distant past, it was wise to choose one's language to match the project.)
    Macs
    However, I switched from Unix to Mac so I wouldn't have to think about computing any longer. Macs had always been built for such people as I, they are beautiful, and they can maintain themselves (or, a networked one can be set-up to do so).
    APL
    My preferred language is the APL variant 'J', which I use daily to test hypotheses, as I think about my research. Such a language, by the way, is great for pre-school children who can't read words yet. (Whether they'll ever be able to punctuate English correctly is another matter.)
    http://www.jsoftware.com
    Need for another Language
    However, I need eventually to convert my scientific algorithms to run in a Linux shell, using Linux's operators (such as 'filter' or 'tee') to combine the little modules.
    I'm now considering (re-)learning the platform-independent 'Java' language, and developing applications on Sourceforge. This way, scientific (ie. free) calculations could be integrated into online scientific papers and placed on other websites as well.

    Kappy,
    Sorry, I thought the question would be a common one confronting casual programmers. With such a variety of popular languages, there is likely no simple answer. I rescind the question with an apology and shall investigate my own problem myself. Sorry.
    The question was, being tired of using the wrong but kindly written MacOSX applications, is there a programming language I can learn now that will also serve me in the future?
    1. Now I need to write, for example, the program described to process photographic images, whose structures are arrays of arrays. Is there a language with such structures less bloated than C++?
    2. Old APL an object-orented language designed for quickly writing algorithms for exactly these structures (the common structures in engineering, science, and mathematics).
    3. Is there an object-oriented language for such structures, also used to write MacOSX applications, that one can learn to correctly build applications in 6 months (rather than 6 years)? This means strong typing, static type checking, automatic memory management, &c. An 'interpreter' as well would be nice!
    4. For science, it must be a high-level, very portable but standard language that can be compiled into (say) byte code for a standard virtual machine that is on all computers. For image processing on my own little Mac, it needs to be compiled all the way to Altvec-optimized machine code.
    5. Is there now such a beast? One that can be hooked at a low level with libraries (written in C or C++), and hooked at a high level to an OOUI (Aqua, in particular)?
    Sorry, I expected an engineer to say:-
    'Sure, MacOSX's compiler is based on the GCC, which contains a compiler for Java. It hooks at many levels. We use it to send code to afilliates around the Globe; and even Windows users haven't complained.
    'Several lexical analyzers have even been written (in C) for Java: so you can parse your spam as well!'
    But I don't know the above to be true.
    I was looking for reasons why Java might not be the better of the GCC languages for 'amateur programming'. I'm sorry I 'passed the buck', when I shouldn't have. This footwork I'll do myself after I can again install /Developer.
    Things I expect to be common problems never are.
    Thanks anyway.
    Bruce

  • Library for Modbus ???

    Hi, I have a project to control a motor system.
    The communication is RS485 through Modbus via Serial.
    The computer is the master and the control motor is the slave.
    I have just one system to control
    I found 3 free driver.
    MODBUS Library for LabVIEW Version 1.21
    http://www.ni.com/example/29756/en/
    LabVIEW Modbus API v1.1.3.32
    https://decibel.ni.com/content/docs/DOC-30140
    MODBUS included in DSC module for LV2014
    http://zone.ni.com/reference/en-XX/help/370622M-01/lvmve/choose_modbus_ioserver_vi/
    I already made a development with 1.21 from NI.
    Should it better to use Modbus library from DSC module ?
    What do you suggest me ?
    thanks in advance

    Hi Minikisscool,
    The Modbus Library for DSC is probably the more convenient to use but you need for that to have purchased the DSC module.
    The option you have choosen (the free low level API) is probably the most commonly used and if you did not experience any particular troubles using it, I suggest you stick to it ; )
    Have a nice day,
    M-Junior

  • Can't choose certificate for computer identification in VPN settings

    When I click on the "Choose" button in the dialog for computer identification in VPN settings, nothing happens. Is there any way to configure the certificate manually on the Terminal until this bug is fixed?

    Same thing here. This seems like a huge-gaping-hole type bug but I can't find anything about it doing any kind of searching
    I've managed to get the machine certificate to "stick" by the following:
    1. Select Shared Secret and enter some random text.
    2. Click OK and click Apply.
    3. Now go to the auth settings again and set the machine cert.
    4. Click OK and Apply.
    Setting should stick now.
    No luck with the User certificate though
    I've been able to track down the preference change to this file:
    /Library/Preferences/SystemConfiguration/preferences.plist
    In this file, supposing you use password authentication, there are entries as such:
    <key>AuthPassword</key>
    <string>6247164D-49F3-49A2-A933-0D95B5400A33</string>
    <key>AuthPasswordEncryption</key>
    <string>Keychain</string>
    Now if you use a certificate, there is only the following:
    <key>AuthProtocol</key>
    <array>
    <string>EAP</string>
    </array>
    As you can see from here, nothing gets saved about the user certificate... grr!
    Is there anyone who successfully used the OS X VPN this way?
    Thanks

  • Delete file from iTunes Library and Computer

    I convert a lot of my own TV shows for playback on iPad/iPod touch. Once I have watched the show I delete it from my library.
    It used to be that when I deleted from my library, I would get a message asking if I wanted to delete from library only or from library AND computer. It does not ask me this anymore.
    I went into preferences and clicked on "reset all warnings" but that didn't fix the problem. Any tips on how to restore this functionality?

    What I mean is I don't want an extra copy of the file made when I add something to my library. I already have the file where I want it.
    I did try your suggestion, and just as I suspected, it made an extra copy in a different location on my computer, then when I deleted it, yes, it asked me if I wanted to move it to the recycle bin, but it only deleted the copy, not the original.
    I'm marking your response as helpful, as I can use it as a workaround if I can't find a better solution, but I have never done it this way before. I've always had full control over which folders my shows were in, and only one copy. And when I've deleted, it has deleted the original file, not just a copy of it.

Maybe you are looking for

  • IPod nano won't recharge

    I have a 8Gb 2nd generation nano. I've had it for a month with no issues until last week. Last week, it stopped recharging. It wouldn't charge with an AC adapter or when connected to a PC via a USB cable. It would only charge, briefly, when syncing w

  • Printer Paused - "/usr/lib/cups/backend/hp failed" [SOLVED]

    Nothing that I try to print with CUPS goes to the printer, it just sits in the job list saying "Pending". CUPS says the status of my printer is: Paused - "/usr/lib/cups/backend/hp failed" Restarting CUPS or DBus does nothing. I didn't notice any upda

  • Why do print margins change when I save or print as a pdf?

    I am printing from a church software program.  I need to save the report as a pdf so that it will print and fold on our new Xerox.  However when I print to pdf, the margins change and the text boxes slightly move and no longer line up with the prepri

  • How to define a text index in data modeler

    Hello, how to define a text index (indextype is ctxsys.context) in data modeler? The SQL-command would be: create index P1_TEXT_BESCHR_SPRACHE on P1_PDM_MODUL_SPRACHE(BESCHREIBUNG) indextype is ctxsys.context parameters ('lexer global_lexer language

  • I NEED HELP MY NOKIA LUMIA 822 IS ALL BLACK SCREEN...

       ok so, my dad has a nokia lumia 822. he said that he tried to unlock his phone, so he slid the page up and i guess it asked him for a system update? so he accidently pressed ok, or yes, or whatever and his screen went all black then later showed a