12 #ifndef EXATN_NUMERICS_FUNCTOR_INIT_VAL_HPP_
13 #define EXATN_NUMERICS_FUNCTOR_INIT_VAL_HPP_
15 #include "Identifiable.hpp"
17 #include "tensor_basic.hpp"
19 #include "tensor_method.hpp"
33 template<
typename NumericType>
37 virtual const std::string name()
const override
38 {
return "TensorFunctorInitVal";}
40 virtual const std::string description()
const override
41 {
return "Initializes a tensor to a scalar value";}
43 virtual void pack(BytePacket & packet)
override
45 appendToBytePacket(&packet,init_val_.real());
46 appendToBytePacket(&packet,init_val_.imag());
50 virtual void unpack(BytePacket & packet)
override
53 extractFromBytePacket(&packet,real);
54 extractFromBytePacket(&packet,imag);
55 init_val_ = std::complex<double>{real,imag};
59 virtual int apply(talsh::Tensor & local_tensor)
override;
63 std::complex<double> init_val_;
70 #endif //EXATN_NUMERICS_FUNCTOR_INIT_VAL_HPP_