#include <LinOp.hpp>
◆ LinOp()
Linear Operator class for iterative solvers.
- Parameters
-
| type | the type of operator, currently it can only be "mv" (matvec) or "mv_elem" (matvec with pre-store element) |
| nx | the last dimension of operator, this should be the dimension of the input vector when "mv_elem" is used. |
| dtype | the Operator's dtype. Note that this should match the input/output Tensor's dtype. |
| device | the Operator's on device. |
Note:
- the device and dtype should be set. This should be the same as the input and output vectors. by default, we assume custom_f take input and output vector to be on CPU and Double type.
Details:
The LinOp class is a class that defines a custom Linear operation acting on a Tensor or UniTensor. To use, inherit this class and override the matvec function. See the following examples for how to use them.
Example:
c++ API:
output>
python API:
output>
◆ _print()
| void cytnx::LinOp::_print |
( |
| ) |
|
◆ device()
| int cytnx::LinOp::device |
( |
| ) |
const |
|
inline |
◆ dtype()
| int cytnx::LinOp::dtype |
( |
| ) |
const |
|
inline |
◆ matvec()
◆ nx()
◆ operator()()
◆ set_device()
◆ set_dtype()
◆ set_elem()
The documentation for this class was generated from the following file: