main.cc
Upload User: hkdiguang
Upload Date: 2013-05-12
Package Size: 105k
Code Size: 1k
Development Platform:

Unix_Linux

  1. #include <cstring>
  2. #include <cstdlib>
  3. #include <iostream>
  4. #include <svdpack.h>
  5. #include <s_runlas2.h>
  6. #include <s_opts.h>
  7. int main(int argc, char** argv)
  8. {
  9.   if (argc != 3) {
  10.     std::cerr << "Usage: svd <ccs file prefix> <txx|tfn etc.>n";
  11.     return -1;
  12.   }
  13.   // Create struct that holds options for ssvd routines
  14.   ssvd::OptionsStruct svdopts;
  15.   strcpy(svdopts.prefix, "example");
  16.   strcpy(svdopts.txx, "txx");
  17.   // Example values for the params.
  18.   svdopts.lanmax = 4;
  19.   svdopts.endl = -1e-30;
  20.   svdopts.endr = 1e-30;
  21.   svdopts.kappa = 1e-6;
  22.   svdopts.in1 = 0;
  23.   svdopts.vectors = true;
  24.   svdopts.ascii = true;
  25.   svdopts.dofiles = 1;        // Do not store sing vects.
  26.   sprintf(svdopts.out1, "%s.svd", "example");
  27.   sprintf(svdopts.out2, "%s.vec", "example");
  28.   svdopts.nums = 4;
  29.   svdopts.sA   = 0;
  30.   ssvd::svdpack* s = new ssvd::s_runlas2(&svdopts);
  31.   // run this program as: ./svd fileprefix txx
  32.   s->init(argv[1], argv[2]);
  33.   s->runIt();
  34.   return 0;
  35. }