PEXSI
 All Classes Namespaces Files Functions Variables Typedefs Pages
SuperLUGrid.hpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012 The Regents of the University of California,
3  through Lawrence Berkeley National Laboratory.
4 
5 Authors: Mathias Jacquelin and Lin Lin
6 
7 This file is part of PEXSI. All rights reserved.
8 
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are met:
11 
12 (1) Redistributions of source code must retain the above copyright notice, this
13 list of conditions and the following disclaimer.
14 (2) Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
17 (3) Neither the name of the University of California, Lawrence Berkeley
18 National Laboratory, U.S. Dept. of Energy nor the names of its contributors may
19 be used to endorse or promote products derived from this software without
20 specific prior written permission.
21 
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 You are under no obligation whatsoever to provide any bug fixes, patches, or
34 upgrades to the features, functionality or performance of the source code
35 ("Enhancements") to anyone; however, if you choose to make your Enhancements
36 available either publicly, or directly to Lawrence Berkeley National
37 Laboratory, without imposing a separate written license agreement for such
38 Enhancements, then you hereby grant the following license: a non-exclusive,
39 royalty-free perpetual license to install, use, modify, prepare derivative
40 works, incorporate into other computer software, distribute, and sublicense
41 such enhancements or derivative works thereof, in binary and source code form.
42  */
46 #ifndef _PEXSI_SUPERLUGRID_HPP_
47 #define _PEXSI_SUPERLUGRID_HPP_
48 
49 #include "pexsi/environment.hpp"
50 
51 //#include "pexsi/superlu_RealGridData.hpp"
52 //#include "pexsi/superlu_ComplexGridData.hpp"
53 
54 
55 namespace PEXSI{
56 
57 
58 
59 
60 
61 class RealGridInfo;
62 class ComplexGridInfo;
63 
65  public:
66  ComplexGridInfo * info_;
67  public:
68 
70  ~ComplexGridData();
72  ComplexGridData & operator = (const ComplexGridData & g);
73 
74  void GridInit( MPI_Comm comm, Int nprow, Int npcol );
75  void GridExit( );
76 };
77 
78 
80  public:
81  RealGridInfo * info_;
82  public:
83 
84  RealGridData();
85  ~RealGridData();
86  RealGridData(const RealGridData & g);
87  RealGridData & operator = (const RealGridData & g);
88 
89  void GridInit( MPI_Comm comm, Int nprow, Int npcol );
90  void GridExit( );
91 };
92 
93 
94 
95 
98  template< typename T > class SuperLUGrid{
100  public:
101  void * ptrData;
102  public:
103  SuperLUGrid( MPI_Comm comm, int nprow, int npcol ){};
104  ~SuperLUGrid(){};
105 
106  SuperLUGrid(const SuperLUGrid & g){};
107  SuperLUGrid & operator = (const SuperLUGrid & g){};
108  };
109 
110 
111  template< > class SuperLUGrid<Real>{
113  public:
115  public:
116  SuperLUGrid( MPI_Comm comm, int nprow, int npcol );
117  ~SuperLUGrid();
118 
119  SuperLUGrid(const SuperLUGrid & g);
120  SuperLUGrid & operator = (const SuperLUGrid & g);
121  };
122 
123 
124  template< > class SuperLUGrid<Complex>{
126  public:
128  public:
129  SuperLUGrid( MPI_Comm comm, int nprow, int npcol );
130  ~SuperLUGrid();
131 
132 
133  SuperLUGrid(const SuperLUGrid & g);
134  SuperLUGrid & operator = (const SuperLUGrid & g);
135  };
136 
137 }
138 
139 
141 
142 #endif //_PEXSI_SUPERLUGRID_HPP_
Environmental variables.
Implementation of SuperLU processor grid.
Definition: superlu_dist_internal_real.cpp:67
Definition: SuperLUGrid.hpp:79
Definition: SuperLUGrid.hpp:64
RealGridData * ptrData
SuperLUMatrix can have access to the grid information.
Definition: SuperLUGrid.hpp:114
Definition: superlu_dist_internal_complex.cpp:68
void * ptrData
SuperLUMatrix can have access to the grid information.
Definition: SuperLUGrid.hpp:101
ComplexGridData * ptrData
SuperLUMatrix can have access to the grid information.
Definition: SuperLUGrid.hpp:127
A thin interface for the gridinfo_t structure in SuperLU.
Definition: SuperLUGrid.hpp:98