ExaTN
Public Member Functions | Protected Attributes | List of all members
exatn::numerics::TensorOperation Class Referenceabstract
Inheritance diagram for exatn::numerics::TensorOperation:
exatn::numerics::TensorOpAdd exatn::numerics::TensorOpContract exatn::numerics::TensorOpCreate exatn::numerics::TensorOpDestroy exatn::numerics::TensorOpTransform

Public Member Functions

 TensorOperation (TensorOpCode opcode, unsigned int num_operands, unsigned int num_scalars)
 
 TensorOperation (const TensorOperation &)=default
 
TensorOperationoperator= (const TensorOperation &)=default
 
 TensorOperation (TensorOperation &&) noexcept=default
 
TensorOperationoperator= (TensorOperation &&) noexcept=default
 
virtual bool isSet () const =0
 
virtual int accept (runtime::TensorNodeExecutor &node_executor, runtime::TensorOpExecHandle *exec_handle)=0
 
virtual void printIt () const
 
virtual void printItFile (std::ofstream &output_file) const
 
TensorOpCode getOpcode () const
 
unsigned int getNumOperands () const
 
unsigned int getNumOperandsSet () const
 
TensorHashType getTensorOperandHash (unsigned int op_num) const
 
std::shared_ptr< TensorgetTensorOperand (unsigned int op_num, bool *conjugated=nullptr) const
 
void setTensorOperand (std::shared_ptr< Tensor > tensor, bool conjugated=false)
 
unsigned int getNumScalars () const
 
unsigned int getNumScalarsSet () const
 
std::complex< double > getScalar (unsigned int scalar_num) const
 
void setScalar (unsigned int scalar_num, const std::complex< double > scalar)
 
const std::string & getIndexPattern () const
 
void setIndexPattern (const std::string &pattern)
 
void setId (std::size_t id)
 
std::size_t getId () const
 

Protected Attributes

std::string pattern_
 
std::vector< std::pair< std::shared_ptr< Tensor >, bool > > operands_
 
std::vector< std::complex< double > > scalars_
 
unsigned int num_operands_
 
unsigned int num_scalars_
 
TensorOpCode opcode_
 
std::size_t id_
 

Constructor & Destructor Documentation

◆ TensorOperation()

exatn::numerics::TensorOperation::TensorOperation ( TensorOpCode  opcode,
unsigned int  num_operands,
unsigned int  num_scalars 
)

Constructs a yet undefined tensor operation with the specified number of tensor/scalar arguments.

Member Function Documentation

◆ accept()

virtual int exatn::numerics::TensorOperation::accept ( runtime::TensorNodeExecutor node_executor,
runtime::TensorOpExecHandle *  exec_handle 
)
pure virtual

Accepts tensor node executor (visitor pattern) which will actually execute the tensor operation in an asynchronous fashion, requiring subsequent synchronization via exec_handle. Returns an integer error code (0:Success).

Implemented in exatn::numerics::TensorOpTransform, exatn::numerics::TensorOpContract, exatn::numerics::TensorOpAdd, exatn::numerics::TensorOpCreate, and exatn::numerics::TensorOpDestroy.

◆ getId()

std::size_t exatn::numerics::TensorOperation::getId ( ) const

Returns the unique integer identifier of the tensor operation.

◆ getIndexPattern()

const std::string & exatn::numerics::TensorOperation::getIndexPattern ( ) const

Returns the symbolic tensor operation specification (index pattern).

◆ getNumOperands()

unsigned int exatn::numerics::TensorOperation::getNumOperands ( ) const

Returns the number of tensor operands required for the tensor operation.

◆ getNumOperandsSet()

unsigned int exatn::numerics::TensorOperation::getNumOperandsSet ( ) const

Returns the number of tensor operands set.

◆ getNumScalars()

unsigned int exatn::numerics::TensorOperation::getNumScalars ( ) const

Returns the number of scalar arguments required for the tensor operation.

◆ getNumScalarsSet()

unsigned int exatn::numerics::TensorOperation::getNumScalarsSet ( ) const

Returns the number of scalar arguments set explicitly.

◆ getOpcode()

TensorOpCode exatn::numerics::TensorOperation::getOpcode ( ) const

Returns the tensor operation code (opcode).

◆ getScalar()

std::complex< double > exatn::numerics::TensorOperation::getScalar ( unsigned int  scalar_num) const

Returns a specific scalar argument.

◆ getTensorOperand()

std::shared_ptr< Tensor > exatn::numerics::TensorOperation::getTensorOperand ( unsigned int  op_num,
bool *  conjugated = nullptr 
) const

Returns a co-owned pointer to a specific tensor operand, or nullptr if not yet set.

◆ getTensorOperandHash()

TensorHashType exatn::numerics::TensorOperation::getTensorOperandHash ( unsigned int  op_num) const

Returns a unique integer tensor operand identifier.

◆ isSet()

virtual bool exatn::numerics::TensorOperation::isSet ( ) const
pure virtual

◆ printIt()

void exatn::numerics::TensorOperation::printIt ( ) const
virtual

Prints.

◆ setId()

void exatn::numerics::TensorOperation::setId ( std::size_t  id)

Sets the unique integer identifier of the tensor operation.

◆ setIndexPattern()

void exatn::numerics::TensorOperation::setIndexPattern ( const std::string &  pattern)

Sets the symbolic tensor operation specification (index pattern). The tensor operation must have all its tensor/scalar operands set at this point.

◆ setScalar()

void exatn::numerics::TensorOperation::setScalar ( unsigned int  scalar_num,
const std::complex< double >  scalar 
)

Sets a specific scalar argument.

◆ setTensorOperand()

void exatn::numerics::TensorOperation::setTensorOperand ( std::shared_ptr< Tensor tensor,
bool  conjugated = false 
)

Sets the next tensor operand.


The documentation for this class was generated from the following files: