Xped
Loading...
Searching...
No Matches
PlainInterface_Cyclops_impl.hpp
Go to the documentation of this file.
1#ifndef PLAIN_INTERFACE_CYCLOPS_IMPL_H_
2#define PLAIN_INTERFACE_CYCLOPS_IMPL_H_
3
4#include "ctf.hpp"
5
6namespace Xped {
7
9{
10 // typedefs
11 using Indextype = int;
23
31
39
40 template <std::size_t Rank, typename Scalar>
42 const Indextype& row_off,
43 const Indextype& col_off,
44 const Indextype& rows,
45 const Indextype& cols,
46 const Scalar& scale,
47 const TType<Scalar, Rank>& T);
48
49 template <std::size_t Rank, typename Scalar>
51 const Indextype& row_off,
52 const Indextype& col_off,
53 const Indextype& rows,
54 const Indextype& cols,
55 const Scalar& scale,
56 const TType<Scalar, Rank>& T);
57
58 template <std::size_t Rank, typename Scalar>
60 const Indextype& row_off,
61 const Indextype& col_off,
62 const Indextype& rows,
63 const Indextype& cols,
64 const std::array<Indextype, Rank>& dims);
65
66 template <typename MT>
67 static void diagonal_head_matrix_to_vector(VType<typename ctf_traits<MT>::Scalar>& V, MT&& M, const Indextype& n_elems);
68
69 template <typename VT>
70 static void vec_diff(VT&& vec, MType<typename ctf_traits<VT>::Scalar>& res);
71
72 template <typename VT>
73 static void vec_add(VT&& vec, MType<typename ctf_traits<VT>::Scalar>& res);
74
75 template <typename MT>
76 static std::tuple<MType<typename ctf_traits<MT>::Scalar>, VType<typename ctf_traits<MT>::Scalar>, MType<typename ctf_traits<MT>::Scalar>>
77 svd(MT&& M);
78
79 template <typename Scalar, typename VT>
80 static MType<Scalar> vec_to_diagmat(VT&& V);
81};
82
83} // namespace Xped
84
85#ifndef XPED_COMPILED_LIB
87#endif
88
89#endif
Definition: bench.cpp:62
Definition: MatrixInterface_Cyclops_impl.hpp:37
static void setZero(MType< Scalar > &M)
Definition: MatrixInterface_Cyclops_impl.cpp:47
static void setConstant(MType< Scalar > &M, const Scalar &val)
Definition: MatrixInterface_Cyclops_impl.cpp:65
static MType< Scalar > construct_with_zero(const MIndextype &rows, const MIndextype &cols, CTF::World &world)
Definition: MatrixInterface_Cyclops_impl.cpp:32
static void print(MT &&M)
Definition: MatrixInterface_Cyclops_impl.cpp:343
static Scalar getVal(const MType< Scalar > &M, const MIndextype &row, const MIndextype &col)
Definition: MatrixInterface_Cyclops_impl.cpp:136
static void setRandom(MType< Scalar > &M)
Definition: MatrixInterface_Cyclops_impl.cpp:53
static MIndextype cols(const MType< Scalar > &M)
Definition: MatrixInterface_Cyclops_impl.cpp:90
static MType< typename ctf_traits< MT1 >::Scalar > difference(MT1 &&M1, MT2 &&M2)
Definition: MatrixInterface_Cyclops_impl.cpp:219
static MIndextype rows(const MType< Scalar > &M)
Definition: MatrixInterface_Cyclops_impl.cpp:84
static MType< Scalar > construct(const MIndextype &rows, const MIndextype &cols, CTF::World &world)
Definition: MatrixInterface_Cyclops_impl.cpp:26
static MType< typename ctf_traits< MT1 >::Scalar > add(MT1 &&M1, MT2 &&M2)
Definition: MatrixInterface_Cyclops_impl.cpp:210
static void setVal(MType< Scalar > &M, const MIndextype row, const MIndextype col, const Scalar &val)
static void scale(MType< Scalar > &M, const Scalar &val)
Definition: MatrixInterface_Cyclops_impl.cpp:228
CTF::Matrix< Scalar > MType
Definition: MatrixInterface_Cyclops_impl.hpp:40
Definition: PlainInterface_Cyclops_impl.hpp:9
static TType< Scalar, Rank > tensor_from_matrix_block(const MType< Scalar > &M, const Indextype &row_off, const Indextype &col_off, const Indextype &rows, const Indextype &cols, const std::array< Indextype, Rank > &dims)
Definition: PlainInterface_Cyclops_impl.cpp:86
static void vec_diff(VT &&vec, MType< typename ctf_traits< VT >::Scalar > &res)
static MType< Scalar > vec_to_diagmat(VT &&V)
Definition: PlainInterface_Cyclops_impl.cpp:165
int Indextype
Definition: PlainInterface_Cyclops_impl.hpp:11
static void add_to_block_from_tensor(MType< Scalar > &M, const Indextype &row_off, const Indextype &col_off, const Indextype &rows, const Indextype &cols, const Scalar &scale, const TType< Scalar, Rank > &T)
Definition: PlainInterface_Cyclops_impl.cpp:63
static void diagonal_head_matrix_to_vector(VType< typename ctf_traits< MT >::Scalar > &V, MT &&M, const Indextype &n_elems)
Definition: PlainInterface_Cyclops_impl.cpp:108
static std::tuple< MType< typename ctf_traits< MT >::Scalar >, VType< typename ctf_traits< MT >::Scalar >, MType< typename ctf_traits< MT >::Scalar > > svd(MT &&M)
Definition: PlainInterface_Cyclops_impl.cpp:138
static void set_block_from_tensor(MType< Scalar > &M, const Indextype &row_off, const Indextype &col_off, const Indextype &rows, const Indextype &cols, const Scalar &scale, const TType< Scalar, Rank > &T)
Definition: PlainInterface_Cyclops_impl.cpp:36
static void scale(MType< Scalar > &M, const Scalar &val)
Definition: MatrixInterface_Cyclops_impl.cpp:228
static void vec_add(VT &&vec, MType< typename ctf_traits< VT >::Scalar > &res)
Definition: TensorInterface_Array_impl.hpp:29
nda::dense_array< Scalar, Rank > TType
Definition: TensorInterface_Array_impl.hpp:44
static void setZero(TType< Scalar, Rank > &T)
Definition: TensorInterface_Array_impl.hpp:95
static void setConstant(TType< Scalar, Rank > &T, const Scalar &val)
Definition: TensorInterface_Array_impl.hpp:107
static std::string print(const TType< Scalar, Rank > &T)
Definition: TensorInterface_Array_impl.hpp:389
static Scalar getVal(const TType< Scalar, Rank > &T, const std::array< Indextype, Rank > &index)
Definition: TensorInterface_Array_impl.hpp:119
static TType< Scalar, Rank > construct(const std::array< Indextype, Rank > &dims, mpi::XpedWorld &world=mpi::getUniverse())
Definition: TensorInterface_Array_impl.hpp:58
static void setVal(TType< Scalar, Rank > &T, const std::array< Indextype, Rank > &index, const Scalar &val)
Definition: TensorInterface_Array_impl.hpp:113
static void setRandom(TType< Scalar, Rank > &T)
Definition: TensorInterface_Array_impl.hpp:101
Definition: VectorInterface_Cyclops_impl.hpp:9
static void setZero(VType< Scalar > &V)
Definition: VectorInterface_Cyclops_impl.cpp:34
static VType< Scalar > construct(const VIndextype &elems, CTF::World &world)
Definition: VectorInterface_Cyclops_impl.cpp:15
static VType< Scalar > construct_with_zero(const VIndextype &elems, CTF::World &world)
Definition: VectorInterface_Cyclops_impl.cpp:21
static void setRandom(VType< Scalar > &V)
Definition: VectorInterface_Cyclops_impl.cpp:40
static std::string print(const VType< Scalar > &V)
Definition: VectorInterface_Cyclops_impl.cpp:92
static void setConstant(VType< Scalar > &V, const Scalar &val)
Definition: VectorInterface_Cyclops_impl.cpp:46
static VType< Scalar > scale(VT1 &&V, const Scalar &val)
Definition: VectorInterface_Cyclops_impl.cpp:75
CTF::Vector< Scalar > VType
Definition: VectorInterface_Cyclops_impl.hpp:12
Definition: MatrixInterface_Cyclops_impl.hpp:10