Converts a sparse or dense matrix to an adgCMatrix with the
specified backend, policy, and precision. This is the primary
user-facing constructor for sparse amatrix objects.
Usage
adgCMatrix(
x,
mode = NULL,
backend = NULL,
preferred_backend = NULL,
policy = NULL,
precision = NULL
)Arguments
- x
A
dgCMatrix, othersparseMatrix, or base Rmatrix.- mode
Single string shortcut passed to
.amatrix_resolve_mode(). PassNULLto use the individual arguments.mode = "fast"prefers an available fast-capable accelerator automatically, with CPU fallback.- backend
Alias for
preferred_backend; ignored whenpreferred_backendis non-NULL.- preferred_backend
Single string naming the preferred compute backend.
- policy
Single string; one of
"auto","cpu","mlx","metal","arrayfire","opencl".- precision
Single string;
"strict"or"fast".