Register to reply

C++ books for mathematicians

by sunjin09
Tags: c++, mathematician
Share this thread:
sunjin09
#1
Mar13-12, 07:15 PM
P: 312
I am an electrical engineer who does quite some engineering math in my work. I also need to use computers quite a bit, but ALWAYS find the entire culture of unix and C/Fortran coding intimidating. Here is an example:
I tried to compile my "hello.cc", I typed "gcc hello.cc" and got "a.out". I typed "a.out", it complained command not found, after hours of struggling I discovered I should type "./a.out" instead...

I have always been using matlab for all my computation needs since the documentations are meant for mathematicians rather than computer scientists. I want to learn some C since I heard its faster, but so far I found all of those books heavy on computer side but light on math side, i.e., examples given in those books are unbearably boring and stupid and I will lose interest very quickly; on the other side they sometimes go too deep (for me) under the hood of unix and there's no way to follow those Greeks.

I did find this book
http://www.amazon.com/C-Mathematicia.../dp/158488584X
a little more interesting, however those high school math examples are still on the boring side. What I'm interested in is solving LARGE SCALE problems, i.e., array operations, numerical linear algebra, etc. Is there a book that would assume little unix background and still teaches you how to use c++ to solve problem of this kind? Any suggestions are welcome. Thank you.
Phys.Org News Partner Science news on Phys.org
Experts defend operational earthquake forecasting, counter critiques
EU urged to convert TV frequencies to mobile broadband
Sierra Nevada freshwater runoff could drop 26 percent by 2100
Daverz
#2
Mar14-12, 12:36 AM
P: 902
Not a direct answer to your question, but I would recommend taking a look at numpy:

http://scipy.org/Getting_Started
MattPD
#3
Mar14-12, 08:01 AM
P: 4
The only book of this kind I can think of is: Barton, John J.; Nackman, Lee R. (1994). Scientific and Engineering C++: An Introduction with Advanced Techniques and Examples.
The authors are competent (e.g., introduced Barton–Nackman trick -- http://en.wikipedia.org/wiki/Barton%...3Nackman_trick) and the book covers the topics you're interested in (e.g., linear algebra).
Unfortunately, there's a big HOWEVER -- while the book is great for its time, C++ has changed quite a lot since then (the 1998 standard -- and, more recently, 2011), so you'd have to be a rather competent reader yourself in order to determine how the examples, principles, etc. translate to standard C++.
That's why I think it might be better to start with a good C++ book first, if you have programmed before I recommend "Accelerated C++" by Koenig and Moo, it's pretty short (< 400 pages), so chances are you won't get a chance to get bored ;)

sunjin09
#4
Mar14-12, 01:21 PM
P: 312
C++ books for mathematicians

Quote Quote by Daverz View Post
Not a direct answer to your question, but I would recommend taking a look at numpy:

http://scipy.org/Getting_Started
Thank you for the tip, this is certainly a good alternative for matlab and it's free, I'm not sure about the speed though.
sunjin09
#5
Mar14-12, 01:23 PM
P: 312
Quote Quote by MattPD View Post
The only book of this kind I can think of is: Barton, John J.; Nackman, Lee R. (1994). Scientific and Engineering C++: An Introduction with Advanced Techniques and Examples.
The authors are competent (e.g., introduced Barton–Nackman trick -- http://en.wikipedia.org/wiki/Barton%...3Nackman_trick) and the book covers the topics you're interested in (e.g., linear algebra).
Unfortunately, there's a big HOWEVER -- while the book is great for its time, C++ has changed quite a lot since then (the 1998 standard -- and, more recently, 2011), so you'd have to be a rather competent reader yourself in order to determine how the examples, principles, etc. translate to standard C++.
That's why I think it might be better to start with a good C++ book first, if you have programmed before I recommend "Accelerated C++" by Koenig and Moo, it's pretty short (< 400 pages), so chances are you won't get a chance to get bored ;)
Thank you for your suggestions especially the however part, I will certainly check out these resources bearing in mind the comments you made about them
Daverz
#6
Mar15-12, 07:03 AM
P: 902
Quote Quote by sunjin09 View Post
Thank you for the tip, this is certainly a good alternative for matlab and it's free, I'm not sure about the speed though.
Numpy itself is pretty fast because it's calling optimized C and Fortran code. It can also be compiled with the Intel MKL libraries to make it even faster. You can find precompiled win32 binaries here:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

You should also check out Sage:

http://www.sagemath.org/
chiro
#7
Mar15-12, 07:24 AM
P: 4,573
Quote Quote by sunjin09 View Post
I am an electrical engineer who does quite some engineering math in my work. I also need to use computers quite a bit, but ALWAYS find the entire culture of unix and C/Fortran coding intimidating. Here is an example:
I tried to compile my "hello.cc", I typed "gcc hello.cc" and got "a.out". I typed "a.out", it complained command not found, after hours of struggling I discovered I should type "./a.out" instead...

I have always been using matlab for all my computation needs since the documentations are meant for mathematicians rather than computer scientists. I want to learn some C since I heard its faster, but so far I found all of those books heavy on computer side but light on math side, i.e., examples given in those books are unbearably boring and stupid and I will lose interest very quickly; on the other side they sometimes go too deep (for me) under the hood of unix and there's no way to follow those Greeks.

I did find this book
http://www.amazon.com/C-Mathematicia.../dp/158488584X
a little more interesting, however those high school math examples are still on the boring side. What I'm interested in is solving LARGE SCALE problems, i.e., array operations, numerical linear algebra, etc. Is there a book that would assume little unix background and still teaches you how to use c++ to solve problem of this kind? Any suggestions are welcome. Thank you.
The Numerical Recipes in C/C++ might be up your alley:

http://www.nr.com/oldverswitcher.html

http://www.amazon.com/Numerical-Reci.../dp/0521750334


Register to reply

Related Discussions
Good physics books for mathematicians Science & Math Textbooks 7
Books/Publication written by famous physicists/mathematicians Science & Math Textbooks 6
Dose Mathematicians understand their books? Academic Guidance 58
Good physics books for mathematicians Classical Physics 2
Amateur mathematicians versus professional mathematicians Academic Guidance 7