C++ books for mathematicians

  • Thread starter sunjin09
  • Start date
  • Tags
    Books C++
In summary, I am an electrical engineer who does quite some engineering math in my work, but I find the entire culture of unix and C/Fortran coding intimidating. I tried to compile my "hello.cc", but got an error message when I tried to type "gcc hello.cc". I also tried compiling it with the Intel MKL libraries, but it was still slow. I found a book that might be a good starting point for learning C++- Scientific and Engineering C++: An Introduction with Advanced Techniques and Examples by John J Barton and Lee R Nackman. The book is great for its time, but C++ has changed a lot since then and I would have to be a rather competent reader myself to be
  • #1
sunjin09
312
0
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
https://www.amazon.com/dp/158488584X/?tag=pfamazon01-20
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.
 
Physics news on Phys.org
  • #2
Not a direct answer to your question, but I would recommend taking a look at numpy:

http://scipy.org/Getting_Started
 
  • #3
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–Nackman_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 ;)
 
Last edited:
  • #4
Daverz said:
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.
 
  • #5
MattPD said:
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–Nackman_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
 
  • #6
sunjin09 said:
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/
 
Last edited:
  • #7
sunjin09 said:
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
https://www.amazon.com/dp/158488584X/?tag=pfamazon01-20
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

https://www.amazon.com/dp/0521750334/?tag=pfamazon01-20
 

1. What is the best C++ book for mathematicians?

The best C++ book for mathematicians would depend on the individual's level of proficiency in programming and mathematics. Some popular options include "Programming: Principles and Practice Using C++" by Bjarne Stroustrup and "C++ for Mathematicians" by Edward Scheinerman.

2. Is C++ difficult for mathematicians to learn?

C++ can be challenging for anyone to learn, regardless of their background. However, as mathematicians are typically skilled in problem-solving and logical thinking, they may find it easier to pick up the language compared to others.

3. Do I need prior programming knowledge to understand a C++ book for mathematicians?

It would be beneficial to have some basic understanding of programming concepts, such as variables, loops, and functions. However, some C++ books for mathematicians may provide a brief introduction to programming before delving into more advanced topics.

4. Can C++ be used for mathematical calculations?

Yes, C++ can be used for mathematical calculations. It has a wide range of mathematical functions and can handle complex calculations efficiently. Many scientific and mathematical software programs are written in C++.

5. Are there any online resources or tutorials for C++ specifically for mathematicians?

Yes, there are many online resources and tutorials available for C++ targeted towards mathematicians. Some popular options include "C++ for Mathematicians" by Dennis E. Shasha and "C++ for Scientists, Engineers and Mathematicians" by Rama Reddy.

Similar threads

  • Science and Math Textbooks
Replies
5
Views
1K
  • Science and Math Textbooks
Replies
6
Views
1K
  • Science and Math Textbooks
Replies
9
Views
868
Replies
5
Views
848
  • Science and Math Textbooks
Replies
2
Views
1K
  • Science and Math Textbooks
Replies
6
Views
940
  • Science and Math Textbooks
Replies
18
Views
2K
  • Science and Math Textbooks
Replies
5
Views
2K
  • Science and Math Textbooks
Replies
7
Views
1K
  • Science and Math Textbooks
Replies
26
Views
4K
Back
Top