/* 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. */ // Illustrate a function like Lapack's simple drivers #include #include "LapackWrap/Lapack.h" #include "LapackWrap/RectLURep.h" #include "LapackWrap/SymPosDefPackedLURep.h" template LapackUnfactored< RectLURep > xForAxEqb(LapackMatrix& matrixA, ConcreteFortranArray2d& b) { return matrixA.factor().solve(b); } int main() { LapackUnfactored< RectLURep > a1(2, 2); a1(0,0) = 2; a1(0,1) = 3; a1(1,0) = 5; a1(1,1) = 6; ConcreteFortranArray2d b1(2, 1); b1(0,0) = 4; b1(1,0) = 7; cout << xForAxEqb(a1, b1) << endl; LapackUnfactored< SymPosDefPackedLURep > a2(2, 2); a2(0,0) = 2; a2(0,1) = -2; a2(1,1) = 5; ConcreteFortranArray2d b2(2, 2); b2(0,0) =-2; b2(0,1) = 2; b2(1,0) = 8; b2(1,1) = -8; cout << xForAxEqb(a2, b2) << endl; return 0; }