Go to the documentation of this file.
25 #ifndef TILEDARRAY_MATH_LINALG_NON_DISTRIBUTED_LU_H__INCLUDED
26 #define TILEDARRAY_MATH_LINALG_NON_DISTRIBUTED_LU_H__INCLUDED
28 #include <TiledArray/config.h>
39 template <
typename ArrayA,
typename ArrayB>
43 auto& world = A.world();
46 if (world.rank() == 0) {
49 world.gop.broadcast_serializable(B_eig, 0);
50 if (x_trange.rank() == 0) x_trange = B.trange();
51 return eigen_to_array<ArrayB>(world, x_trange, B_eig);
57 template <
typename Array>
60 auto& world = A.
world();
62 if (world.rank() == 0) {
65 world.gop.broadcast_serializable(A_eig, 0);
66 if (ainv_trange.rank() == 0) ainv_trange = A.
trange();
67 return eigen_to_array<Array>(A.
world(), ainv_trange, A_eig);
72 #endif // TILEDARRAY_MATH_LINALG_NON_DISTRIBUTED_LU_H__INCLUDED
auto lu_solve(const ArrayA &A, const ArrayB &B, TiledRange x_trange=TiledRange())
Solve a linear system via LU factorization.
void lu_solve(Matrix< T > &A, Matrix< T > &B)
Range data of a tiled array.
const trange_type & trange() const
Tiled range accessor.
void lu_inv(Matrix< T > &A)
World & world() const
World accessor.
auto lu_inv(const Array &A, TiledRange ainv_trange=TiledRange())
Invert a matrix via LU.
auto make_matrix(const DistArray< Tile, Policy > &A)