test.cpp 358 B

123456789101112131415161718192021
  1. #include <armadillo>
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. arma::mat U, V, X = arma::randu<arma::mat>(5, 5);
  7. arma::vec s;
  8. arma::svd(U,s,V,X);
  9. cout << U << endl << endl;
  10. cout << s << endl << endl;
  11. cout << V << endl << endl;
  12. cout << X << endl << endl;
  13. s.save("s.hdf5", arma::hdf5_binary);
  14. return 0;
  15. }