Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
Loading...
Searching...
No Matches
Enumerations | Functions
Conversions

Conversion Operations on Containers. More...

Collaboration diagram for Conversions:

Enumerations

enum  Morpheus::conversion_error_e { Morpheus::DYNAMIC_TO_PROXY = 0 , Morpheus::PROXY_TO_DYNAMIC , Morpheus::CONV_SUCCESS }
 Enum values for in-place conversion status. More...
 

Functions

template<typename ExecSpace , typename SourceType , typename DestinationType >
void Morpheus::convert (const SourceType &src, DestinationType &dst)
 Performs a conversion operation between two containers. More...
 
template<typename ExecSpace , typename SourceType >
conversion_error_e Morpheus::convert (SourceType &src, const formats_e index)
 Performs an in-place conversion operation of the DynamicMatrix container to the format indicated by the enum index. More...
 
template<typename ExecSpace , typename SourceType >
conversion_error_e Morpheus::convert (SourceType &src, const int index)
 Performs an in-place conversion operation of the DynamicMatrix container to the format indicated by the index. More...
 

Detailed Description

Conversion Operations on Containers.

Enumeration Type Documentation

◆ conversion_error_e

Enum values for in-place conversion status.

Enumerator
DYNAMIC_TO_PROXY 

Dynamic to Proxy conversion failed.

PROXY_TO_DYNAMIC 

Proxy to Dynamic conversion failed.

CONV_SUCCESS 

In-place conversion successful.

Function Documentation

◆ convert() [1/3]

template<typename ExecSpace , typename SourceType , typename DestinationType >
void Morpheus::convert ( const SourceType &  src,
DestinationType &  dst 
)

Performs a conversion operation between two containers.

Template Parameters
ExecSpaceExecution space to run the algorithm
SourceTypeThe type of the source container
DestinationTypeThe type of the destination container
Parameters
srcThe source container we are converting from
dstThe destination container we are converting to

◆ convert() [2/3]

template<typename ExecSpace , typename SourceType >
conversion_error_e Morpheus::convert ( SourceType &  src,
const formats_e  index 
)

Performs an in-place conversion operation of the DynamicMatrix container to the format indicated by the enum index.

Template Parameters
ExecSpaceExecution space to run the algorithm
SourceTypeThe type of the source container
Parameters
srcThe source container to convert
indexThe enum index of the format to convert to
Returns
conversion_error_e Error code
Note
The src container must be a DynamicMatrix for the conversion to take place.
Internally the in-place conversion is achieved using a temporary CooMatrix container.
In case the conversion fails internally it throws an error and the state and data of the input container are maintained.

◆ convert() [3/3]

template<typename ExecSpace , typename SourceType >
conversion_error_e Morpheus::convert ( SourceType &  src,
const int  index 
)

Performs an in-place conversion operation of the DynamicMatrix container to the format indicated by the index.

Template Parameters
ExecSpaceExecution space to run the algorithm
SourceTypeThe type of the source container
Parameters
srcThe source container to convert
indexThe index of the container we will be converting to
Returns
conversion_error_e Error code