Commit ed56551e authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh

Added shared_ptr based creators to all numerics factories.

parent cfde3f10
Pipeline #70683 passed with stage
in 4 minutes and 32 seconds
/** ExaTN::Numerics: Tensor contraction sequence optimizer factory
REVISION: 2019/09/09
REVISION: 2019/09/10
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -30,6 +30,11 @@ std::unique_ptr<ContractionSeqOptimizer> ContractionSeqOptimizerFactory::createC
return std::unique_ptr<ContractionSeqOptimizer>(nullptr);
}
std::shared_ptr<ContractionSeqOptimizer> ContractionSeqOptimizerFactory::createContractionSeqOptimizerShared(const std::string & name)
{
return std::move(createContractionSeqOptimizer(name));
}
ContractionSeqOptimizerFactory * ContractionSeqOptimizerFactory::get()
{
static ContractionSeqOptimizerFactory single_instance;
......
/** ExaTN::Numerics: Tensor contraction sequence optimizer factory
REVISION: 2019/09/09
REVISION: 2019/09/10
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -38,6 +38,8 @@ public:
/** Creates a new instance of a desired subtype. **/
std::unique_ptr<ContractionSeqOptimizer> createContractionSeqOptimizer(const std::string & name);
/** Creates a new instance of a desired subtype. **/
std::shared_ptr<ContractionSeqOptimizer> createContractionSeqOptimizerShared(const std::string & name);
/** Returns a pointer to the ContractionSeqOptimizerFactory singleton. **/
static ContractionSeqOptimizerFactory * get();
......
/** ExaTN::Numerics: Tensor network builder factory
REVISION: 2019/07/11
REVISION: 2019/09/10
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -28,6 +28,11 @@ std::unique_ptr<NetworkBuilder> NetworkBuildFactory::createNetworkBuilder(const
return std::unique_ptr<NetworkBuilder>(nullptr);
}
std::shared_ptr<NetworkBuilder> NetworkBuildFactory::createNetworkBuilderShared(const std::string & name)
{
return std::move(createNetworkBuilder(name));
}
NetworkBuildFactory * NetworkBuildFactory::get()
{
static NetworkBuildFactory single_instance;
......
/** ExaTN::Numerics: Tensor network builder factory
REVISION: 2019/07/11
REVISION: 2019/09/10
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -37,6 +37,8 @@ public:
/** Creates a new instance of a desired subtype. **/
std::unique_ptr<NetworkBuilder> createNetworkBuilder(const std::string & name);
/** Creates a new instance of a desired subtype. **/
std::shared_ptr<NetworkBuilder> createNetworkBuilderShared(const std::string & name);
/** Returns a pointer to the NetworkBuildFactory singleton. **/
static NetworkBuildFactory * get();
......
/** ExaTN::Numerics: Tensor operation factory
REVISION: 2019/06/03
REVISION: 2019/09/10
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -32,6 +32,11 @@ std::unique_ptr<TensorOperation> TensorOpFactory::createTensorOp(TensorOpCode op
return std::unique_ptr<TensorOperation>(nullptr);
}
std::shared_ptr<TensorOperation> TensorOpFactory::createTensorOpShared(TensorOpCode opcode)
{
return std::move(createTensorOp(opcode));
}
TensorOpFactory * TensorOpFactory::get()
{
static TensorOpFactory single_instance;
......
/** ExaTN::Numerics: Tensor operation factory
REVISION: 2019/06/03
REVISION: 2019/09/10
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -40,6 +40,8 @@ public:
/** Creates a new instance of a desired subtype. **/
std::unique_ptr<TensorOperation> createTensorOp(TensorOpCode opcode);
/** Creates a new instance of a desired subtype. **/
std::shared_ptr<TensorOperation> createTensorOpShared(TensorOpCode opcode);
/** Returns a pointer to the TensorOpFactory singleton. **/
static TensorOpFactory * get();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment