Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Introduction to SourcePro C++

6.2 An Example Using the Linear Algebra and Essential Tools Modules

Classes of the Business Analysis Module can be used with other SourcePro C++ modules to solve specialized problems in business and research. The following example uses classes of both the Linear Algebra Module and the Essential Tools Module. In this example, a number of systems of equations are solved by means of a single LU decomposition. The collection classes of the Essential Tools Module are useful for managing these huge amounts of data.

First, the program reads a matrix from the standard input stream. The symmetric matrix RWSymMat<double> is decomposed, if possible, by creating an RWSymFact<double> object. The program then creates an Essential Tools Module list object, RWTPtrDlist<DoubleVec>, which holds the vectors for solving the system. The list is filled until the end of file is reached; vectors are stored by pointers. Finally, the systems are solved using the list iterator RWTPtrDist::iterator from the Essential Tools Module, and the solutions are printed.

Example 5: Using the Linear Algebra, Essential Math, and Essential Tools Modules

Program output:



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.