What C++ Books Are Best for Mathematicians with Limited Unix Experience?

  • Thread starter Thread starter sunjin09
  • Start date Start date
  • Tags Tags
    Books C++
Click For Summary

Discussion Overview

The discussion revolves around finding suitable C++ books for mathematicians, particularly those with limited experience in Unix and programming. Participants express their challenges with existing resources and seek recommendations that balance mathematical applications with programming concepts.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant shares their struggle with Unix and C/Fortran coding, expressing a preference for resources that are more math-focused and less technical.
  • Another participant suggests "Scientific and Engineering C++" by Barton and Nackman, noting its relevance to linear algebra but also its dated content due to changes in C++ standards.
  • A recommendation for "Accelerated C++" by Koenig and Moo is made, highlighting its brevity as a potential advantage for maintaining interest.
  • Some participants mention alternatives to C++, such as numpy and Sage, emphasizing their speed and suitability for mathematical computations.
  • One participant points out that numpy is efficient because it utilizes optimized C and Fortran code, and mentions the possibility of further optimization with Intel MKL libraries.
  • A suggestion for "Numerical Recipes in C/C++" is also made, indicating it might align with the interests of those looking to solve large-scale problems.

Areas of Agreement / Disagreement

Participants express a range of opinions on the suitability of various books and resources, with no consensus on a single best option. Some agree on the challenges of existing materials, while others propose different alternatives, indicating a lack of agreement on the ideal resource.

Contextual Notes

Participants highlight limitations in available resources, including the need for a balance between programming and mathematical content, as well as the challenge of outdated examples in recommended books.

Who May Find This Useful

This discussion may be useful for electrical engineers, mathematicians, and other STEM professionals seeking to learn C++ with a focus on mathematical applications, particularly those who are intimidated by Unix and programming concepts.

sunjin09
Messages
310
Reaction score
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
Not a direct answer to your question, but I would recommend taking a look at numpy:

http://scipy.org/Getting_Started
 
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:
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.
 
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
 
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:
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
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 38 ·
2
Replies
38
Views
12K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K
Replies
2
Views
3K
Replies
4
Views
5K