C++ for Mathematicians An Introduction for Students and Professionals phần 1 pot

53 398 1
C++ for Mathematicians An Introduction for Students and Professionals phần 1 pot

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... 11 0 11 7 12 0 12 2 12 9 13 3 13 7 14 1 14 3 14 6 15 0 15 1 15 9 16 2 17 2 18 1 18 4 18 6 19 1 19 2 19 7 19 8 19 8 19 9 200 202 203 207 217 226 230 230 2 31 236 240 2 41 247 255 256 256 2 71 275 277 280 285 xv Programs 14 .1 14.2 14 .3 14 .4 14 .5 14 .6 14 .7 14 .8 14 .9 14 .10 14 .11 14 .12 14 .13 14 .14 15 .1 15.2 15 .3 15 .4 15 .5 A .1 B .1 B.2 A program to illustrate the sorting of string values Accessing command line arguments... 9.3 10 .1 10.2 10 .3 10 .4 10 .5 10 .6 10 .7 10 .8 10 .9 10 .10 10 .11 10 .12 10 .13 11 .1 11. 2 11 .3 11 .4 11 .5 12 .1 12.2 12 .3 12 .4 12 .5 12 .6 12 .7 13 .1 13.2 13 .3 13 .4 13 .5 A program to check the Point class Header file for the PTriple class Program file for the PTriple class A program to find Pythagorean triples A program to find Pythagorean triples using sets... Documenting a procedure for Doxygen Documenting a class and its members for Doxygen 294 298 299 302 303 304 308 313 313 314 3 21 322 325 328 334 339 340 345 3 51 370 382 384 Figures 1. 1 5 .1 5.2 10 .1 10.2 10 .3 10 .4 14 .1 14.2 14 .3 14 .4 14 .5 B .1 B.2 PDP-8 front panel switches A flowchart for the factoring algorithm ... pn for n equal to one million Header file Point.h for the Point class (condensed version) Code for the Point class methods and procedures 5 11 13 15 17 19 21 23 24 32 34 34 35 35 37 38 40 43 44 48 54 56 58 60 63 73 74 75 76 77 79 81 82 84 85 95 10 9 xiii xiv C++ for Mathematicians 6.3 7 .1 7.2 7.3 8 .1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 9 .1 9.2 9.3 10 .1 10.2 10 .3... important, thank you to my wife, Amy, and our children, Jonah, Naomi, Danny, and Rachel, for the world of love and happiness I share with them Ed Scheinerman Baltimore May 24, 2006 Part I Procedures Chapter 1 The Basics 1. 1 What is C++? C++ is a computer programming language Computers are electronic information-processing machines Data and programs in these machines are saved, moved, and transformed... colleague.” I am fortunate to have such a colleague Thank you, Joanne Houlahan for your help (and patience) with getting me unstuck from computer woes I greatly appreciate my department chair, Daniel Naiman, for his support and encouragement for this project It gives me great joy to acknowledge the contributions of my father, Ira, and my son Jonah to the front cover Grandpa took the cover photo and grandson... onto the computer screen Instead, we opt for a bit of (bad) poetry The Basics 5 Program 1. 1: The classic “Hello, world” program updated for the mathematics world 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include using namespace std; /** * A simple program for demonstrating the basics of a C++ project * * It does a good job of demonstrating C++ fundamentals, but a * terrible job with... moved, and transformed in the form of electrical voltages These electrical voltages can be interpreted as a zeros and ones The zeros and ones can be aggregated and interpreted as words, numbers, images, sounds, and so on Long ago, information—be it data or programs—could be entered into the Figure 1. 1: A PDP-8 computer with front panel switches for entering instructions and data (Image courtesy of the... 4 01 402 403 404 405 406 406 407 407 408 408 411 411 413 D Answers 415 Index 487 Programs 1. 1 2 .1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 3 .1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3 .10 3 .11 4 .1 4.2 4.3 4.4 4.5 5 .1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5 .10 6 .1 6.2 Poem Introducing the int type A program to illustrate... the standard cout is std::cout, where std stands for the “standard” namespace In the iostream file, cout and endl are defined to have the full names std::cout and std::endl It is possible to delete line 2 from the program, but then it would be necessary to replace cout with std::cout (and likewise for endl) However, for our purposes, it is much easier to declare: we are going to be using the standard . y0 w0 h1" alt="" C++ for Mathematicians An Introduction for Students and Professionals Edward Scheinerman Cover photograph: Ira Scheinerman Cover design concept: Jonah Scheinerman Published. . . 17 4 10 The Projective Plane 17 7 10 .1 Introduction to the projective plane, RP 2 . . . . . . . . . . . . . . 17 7 10 .2 Designing the classes PPoint and PLine . . . . . . . . . . . . 17 8 10 .3. Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1 10 .4 Protected class members . . . . . . . . . . . . . . . . . . . . . . 18 4 10 .5 Class and file organization for PPoint and

Ngày đăng: 12/08/2014, 12:20

Tài liệu cùng người dùng

Tài liệu liên quan