#include <cstdio>
#include <cstdlib>
int main(int argc, char* argv[]) {
try {
int device = argc > 1 ? atoi(argv[1]) : 0;
float h_buffer[] = {1, 4, 2, 5, 3, 6};
array in(2, 3, h_buffer);
svd(u, s_vec, vt, in);
array s_mat = diag(s_vec, 0,
false);
array in_recon = matmul(u, s_mat, vt(
seq(2), span));
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}
A multi dimensional data container.
An ArrayFire exception class.
virtual const char * what() const
Returns an error message for the exception in a string format.
seq is used to create sequences for indexing af::array
AFAPI void setDevice(const int device)
Sets the current device.