03.12.2012 Views

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Classes<br />

Chapter 3<br />

“Computer science is no more about computers than astronomy is about telescopes.”<br />

— Edsger W. Dijkstra.<br />

“Accordingly, computer science is more than programming language details.”<br />

Good programming is more then drilling on small language details and more then cleverly<br />

manipulating specific bits on the latest and greatest computer hardware. Focusing primarily<br />

on technical details can lead to clever codes that per<strong>for</strong>m a certain task in a certain context<br />

extremely efficiently. If one is good at this one might even create the fastest solution <strong>for</strong> this<br />

task and gain the admiration of the geeks.<br />

3.1 Program <strong>for</strong> universal meaning not <strong>for</strong> technical details<br />

Writing leading-edge scientific software with such an attitude is very painful and likely to fail.<br />

The most important tasks in scientific programming are:<br />

• Identifying the mathematical abstractions that are important in the domain; and<br />

• Representing this abstractions comprehensively and efficiently in software.<br />

Common abstractions that appear in almost every scientific application are vector spaces and<br />

linear operators. A linear operator projects from one vector space to another one.<br />

First we should decide how to represent this abstraction in a program. Be v an element of a<br />

vector space and L a linear operator. Then C ++ allows us to represent the application of L on<br />

v as<br />

or<br />

L(v)<br />

L ∗ v<br />

Which one is better suited is not so easy to say. What is easy to say is that both are better<br />

then<br />

65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!