svd.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  * svd.h
21  * Created: 16 October, 2020
22  *
23  */
24 #ifndef TILEDARRAY_MATH_LINALG_SVD_H__INCLUDED
25 #define TILEDARRAY_MATH_LINALG_SVD_H__INCLUDED
26 
27 #include <TiledArray/config.h>
28 #ifdef TILEDARRAY_HAS_SCALAPACK
30 #endif // TILEDARRAY_HAS_SCALAPACK
32 
33 namespace TiledArray::math::linalg {
34 
35 template <SVD::Vectors Vectors, typename Array>
36 auto svd(const Array& A, TiledRange u_trange = TiledRange(), TiledRange vt_trange = TiledRange()) {
37 #if TILEDARRAY_HAS_SCALAPACK
38  if (A.world().size() > 1 && A.range().volume() > 10000000) {
39  return scalapack::svd<Vectors>(A, u_trange, vt_trange);
40  }
41 #endif
42  return non_distributed::svd<Vectors>(A, u_trange, vt_trange);
43 }
44 
45 } // namespace TiledArray::math::linalg
46 
47 namespace TiledArray {
49 }
50 
51 #endif // TILEDARRAY_MATH_LINALG_SVD_H__INCLUDED
auto svd(const Array &A, TiledRange u_trange=TiledRange(), TiledRange vt_trange=TiledRange())
Definition: svd.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