heig.h
Go to the documentation of this file.
1 /*
2  * This file is a part of TiledArray.
3  * Copyright (C) 2020 Virginia Tech
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Eduard Valeyev
19  *
20  * heig.h
21  * Created: 16 October, 2020
22  *
23  */
24 #ifndef TILEDARRAY_MATH_LINALG_HEIG_H__INCLUDED
25 #define TILEDARRAY_MATH_LINALG_HEIG_H__INCLUDED
26 
27 #include <TiledArray/config.h>
28 #if TILEDARRAY_HAS_SCALAPACK
30 #endif
32 
33 namespace TiledArray::math::linalg {
34 
35 template <typename Array>
36 auto heig(const Array& A, TiledRange evec_trange = TiledRange()) {
37 #if TILEDARRAY_HAS_SCALAPACK
38  if (A.world().size() > 1 && A.range().volume() > 10000000) {
39  return scalapack::heig(A, evec_trange);
40  }
41 #endif
42  return non_distributed::heig(A, evec_trange);
43 }
44 
45 template <typename ArrayA, typename ArrayB, typename EVecType = ArrayA>
46 auto heig(const ArrayA& A, const ArrayB& B, TiledRange evec_trange = TiledRange()) {
47 #if TILEDARRAY_HAS_SCALAPACK
48  if (A.world().size() > 1 && A.range().volume() > 10000000) {
49  return scalapack::heig(A, B, evec_trange);
50  }
51 #endif
52  return non_distributed::heig(A, B, evec_trange);
53 }
54 
55 } // namespace TiledArray::math::linalg
56 
57 namespace TiledArray {
59 }
60 
61 #endif // TILEDARRAY_MATH_LINALG_HEIG_H__INCLUDED
auto heig(const Array &A, TiledRange evec_trange=TiledRange(), size_t NB=default_block_size())
Solve the standard eigenvalue problem with ScaLAPACK.
Definition: heig.h:59
auto heig(const Array &A, TiledRange evec_trange=TiledRange())
Definition: heig.h:36
Range data of a tiled array.
Definition: tiled_range.h:32
const range_type & range() const
Tile range accessor.
Definition: dist_array.h:932
Forward declarations.
Definition: dist_array.h:57
World & world() const
World accessor.
Definition: dist_array.h:1007
auto heig(const Array &A, TiledRange evec_trange=TiledRange())
Solve the standard eigenvalue problem with LAPACK.
Definition: heig.h:54