1 /*
2 Copyright (c) 2009-2014, Jack Poulson
3 All rights reserved.
4
5 This file is part of Elemental and is under the BSD 2-Clause License,
6 which can be found in the LICENSE file in the root directory, or at
7 http://opensource.org/licenses/BSD-2-Clause
8 */
9 // NOTE: It is possible to simply include "elemental.hpp" instead
10 #include "elemental-lite.hpp"
11 #include ELEM_FOXLI_INC
12 using namespace elem;
13
14 int
main(int argc,char * argv[])15 main( int argc, char* argv[] )
16 {
17 Initialize( argc, argv );
18
19 try
20 {
21 const Int n = Input("--size","size of matrix",100);
22 const double omega = Input("--omega","frequency of FoxLi",16*M_PI);
23 const std::string basename =
24 Input("--basename","basename of file",std::string(""));
25 const bool display = Input("--display","display matrix?",true);
26 const bool print = Input("--print","print matrix?",false);
27 ProcessInput();
28 PrintInputReport();
29
30 if( basename == "" )
31 LogicError("Please specify a basename for writing");
32
33 DistMatrix<Complex<double>> A;
34 FoxLi( A, n, omega );
35 if( display )
36 Display( A, "A" );
37 if( print )
38 Print( A, "A" );
39 Write( A, basename, MATRIX_MARKET );
40
41 DistMatrix<Complex<double>> B;
42 Read( B, basename+".mm" );
43 if( display )
44 Display( B, "B" );
45 if( print )
46 Print( B, "B" );
47 }
48 catch( std::exception& e ) { ReportException(e); }
49
50 Finalize();
51 return 0;
52 }
53