/* Example programs from the book Scientific and Engineering Programming in C++: An Introduction with Advanced Techniques and Examples, Addison-Wesley, 1994. (c) COPYRIGHT INTERNATIONAL BUSINESS MACHINES CORPORATION 1994. ALL RIGHTS RESERVED. See README file for further details. */ #ifndef AugmentedLapackUnfactoredH #define AugmentedLapackUnfactoredH #include "LapackWrap/Lapack.h" template class AugmentedLapackUnfactored : // A:b for problem Ax = b; public virtual Array2d, private LapackUnfactored { public: AugmentedLapackUnfactored(const ConstArray2d& a, const ConstArray2d& b); typedef Rep::Unfactored::EltT EltT; typedef Rep::Unknowns Unknowns; typedef Rep::Knowns Knowns; Array& solve(Rep::Unknowns& x); // factor and solve for x in-place. Array& solve(Array1d& x); // factor and solve for x in-place. LapackUnfactored::factor; LapackUnfactored::rep; LapackUnfactored::rank; LapackUnfactored::shape; LapackUnfactored::numElts; LapackUnfactored::operator[]; LapackUnfactored::operator(); AugmentedLapackUnfactored& operator=(const AugmentedLapackUnfactored& rhs){ LapackUnfactored::operator=(rhs); // copy matrix. bp = rhs.bp; // Copy b from Ax=b. return *this; } protected: AugmentedLapackUnfactored(Subscript nrows, Subscript ncols); Knowns& rhs() { return *bp; } private: CopiedObjPtr bp; }; #ifdef XLC_QNOTEMPINC #include "LapackWrap/AugmentedLapackUnfactored.c" #endif #endif