next up previous contents
Next: New Features in Version Up: Slate++ Version 1.2 TUTORIAL Previous: Contents   Contents

Subsections

Overview

What is Slate++ ?

Slate++ is an object-oriented collection of C++ templates for creating and manipulating vectors and matrices. It allows one to create vectors and matrices in C++ which ``know'' their dimensions, so they can be passed to functions without extra parameters to keep track of their size. They are dynamically created, which makes them useful for computational work where the dimensions aren't necessarily known ahead of time. Slate++ vectors and matrices have methods which facilitate using their data directly in external C functions (for example, legacy code which hasn't been built with Slate++ in mind). Most basic operations, like addition, subtraction and matrix multiplication, are defined with simple operators ('-', '+' and '*'), making code cleaner and easier to read. Some simple linear algebra algorithms have been implemented, such as determinants and inverses, so that simple computational problems can be solved without resorting to complicated libraries.

Consider the following piece of code which adds two Slate++ vectors to one another, scales a Slate++ matrix by $20.0$, outputs the inverse of the scaled matrix, and then outputs the matrix product of the difference of the vectors with the scaled matrix:

v3 = v1 + v2;
m = 20.0 * m;
cout << inverse(m) << endl;
cout << (v1 - v2) * m << endl;
The point of this example is that matrix and vector manipulation using Slate++ is incredibly simple. The equivalent C/C++ code using only C arrays would require external functions (not operator overloading) for every linear algebra operation. Moreover, these function calls would require extra parameters to describe the shape of the vectors and matrices. Finally, the insertion operator («) can't be used on ordinary C arrays. In a nutshell, the code would be much more complicated to write, and much more difficult to read.

If you're programming in C++, and you're looking for a way to handle vectors and matrices, Slate++ may be a very good solution.

What is Slate++ not?

Slate++ is not a library of numerical methods. While some simple linear algebra routines have been included, they are far from complete, and in any case, most computational programmers will want to rely on their own algorithms and legacy code. The aim of Slate++ is to provide a flexible and intuitive set of vector and matrix objects, which can easily interface with external functions.

Slate++ is not designed for problems involving several dimensions. Its focus is on vectors and matrices, although it's certainly possible to construct arrays of Slate++ vectors and matrices. Techniques for doing this are discussed later in the tutorial.

Slate++ is not designed for problems requiring complicated or specialized data structures (e.g., trees, sparse matrices). While a programmer certainly may find a use for Slate++ vectors and matrices within his or her problem, there are no explicit constructs for simplifying these kinds of structures.

Who is Slate++ targeted toward?

Slate++ is geared toward the C++ programmer who needs to use vectors and matrices for his work, but is unhappy with the standard C++ treatment of arrays. Slate++ is designed to be extremely simple to use, so that it's appropriate for even programmers inexperiened in object-oriented methods or C++ templates. On the other hand, because Slate++ vectors and matrices and be used with external legacy code without much difficulty, Slate++ is equally appropriate for the advanced numerical programmer who wants to clean up his legacy code (say, by designing Slate++ wrappers around the original code) and take advantage of the power of templates.

Who are the Authors?

Brian Thorndyke is a physics researcher at the University of Florida. His work centers around numerical studies of molecular systems, from a quantum mechanical point of view.

Robert Thorndyke is a faculty member in Computer Science at Camosun College in Victoria, British Columbia.

And yes, we're brothers. :)


next up previous contents
Next: New Features in Version Up: Slate++ Version 1.2 TUTORIAL Previous: Contents   Contents
Brian Thorndyke 2003-11-15