template<typename ValueType, typename MemorySpace, typename IndexType = int>
class cusp::identity_operator< ValueType, MemorySpace, IndexType >
Simple identity operator.
- Template Parameters
-
IndexType | Type used for operator indices (e.g. int ). |
ValueType | Type used for operator values (e.g. float ). |
MemorySpace | A memory space (e.g. cusp::host_memory or cusp::device_memory ) |
- Overview
- A
linear
operator that copies the input vector to the output vector unchanged. Corresponds to the identity matrix (I).
- Example
- The following code snippet demonstrates using the identity operator.
int main(void)
{
const int N = 4;
A(x,y);
}
- Examples:
- bicgstab.cu, cg.cu, and cr.cu.
Definition at line 183 of file linear_operator.h.
template<typename ValueType, typename MemorySpace, typename IndexType = int>
template<typename VectorType1 , typename VectorType2 >
void cusp::identity_operator< ValueType, MemorySpace, IndexType >::operator() |
( |
const VectorType1 & |
x, |
|
|
VectorType2 & |
y |
|
) |
| const |
|
inline |
Apply the identity_operator
to vector x and produce vector y.
- Template Parameters
-
VectorType1 | Type of the input vector |
VectorType2 | Type of the output vector |
- Parameters
-
x | Input vector to copy. |
y | Output vector to produce. |
Definition at line 213 of file linear_operator.h.