main.cc
上传用户:hkdiguang
上传日期:2013-05-12
资源大小:105k
文件大小:1k
- #include <cstring>
- #include <cstdlib>
- #include <iostream>
- #include <svdpack.h>
- #include <s_runlas2.h>
- #include <s_opts.h>
- int main(int argc, char** argv)
- {
- if (argc != 3) {
- std::cerr << "Usage: svd <ccs file prefix> <txx|tfn etc.>n";
- return -1;
- }
- // Create struct that holds options for ssvd routines
- ssvd::OptionsStruct svdopts;
- strcpy(svdopts.prefix, "example");
- strcpy(svdopts.txx, "txx");
- // Example values for the params.
- svdopts.lanmax = 4;
- svdopts.endl = -1e-30;
- svdopts.endr = 1e-30;
- svdopts.kappa = 1e-6;
- svdopts.in1 = 0;
- svdopts.vectors = true;
- svdopts.ascii = true;
- svdopts.dofiles = 1; // Do not store sing vects.
- sprintf(svdopts.out1, "%s.svd", "example");
- sprintf(svdopts.out2, "%s.vec", "example");
- svdopts.nums = 4;
- svdopts.sA = 0;
- ssvd::svdpack* s = new ssvd::s_runlas2(&svdopts);
- // run this program as: ./svd fileprefix txx
- s->init(argv[1], argv[2]);
- s->runIt();
- return 0;
- }