Overview

Solution of Poisson's equation as the single line of code

  phi=cI(Linv(-4*pi*O(cJ(n))));
requires two capabilities not common in C programs. First, in the above expression, the calls to functions such as cJ(...) return not single numbers but entire arrays. Second, the expression -4*pi*O(...) represents not just simple scalar multiplications but rather multiplication of the scalars -4 and pi with the entire array returned by O(...). We therefore need the ability to work with objects such as arrays as easily as we work with numbers in C.

The C++ language supports the capability of writing software which allows for such operations very generally. However, the octave language already automatically includes these operations, tuned automatically for peak performance, for the typical sort of linear algebraic operations common in scientific computing. We thus shall use octave for the remainder of this course.



Tomas Arias 2005-04-03