-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmain.cc
83 lines (69 loc) · 2.18 KB
/
main.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <v8.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include <fcntl.h>
#include <string.h>
#include <string>
#include <vector>
#include <stdio.h>
#include <functional>
#include <stdlib.h>
#include <thread>
#include <chrono>
#include <pthread.h>
#include "core.h"
#define QJS_VERSION "0.0.4"
void banner() {
std::cout << "quantjs v" << QJS_VERSION << std::endl;
std::cout << "Copyright 2013-2014 Johan Astborg" << std::endl;
}
void usage() {
std::cout << "usage: quantjs [--infiles filename(s)...] [--help]" << std::endl;
}
#include <boost/numeric/ublas/hermitian.hpp>
#include <boost/numeric/ublas/io.hpp>
int main(int argc, char* argv[]) {
/*
using namespace boost::numeric::ublas;
hermitian_matrix<std::complex<double>, lower> ml (3, 3);
for (unsigned i = 0; i < ml.size1 (); ++ i) {
for (unsigned j = 0; j < i; ++ j)
ml (i, j) = std::complex<double> (3 * i + j, 3 * i + j);
ml (i, i) = std::complex<double> (4 * i, 0);
}
std::cout << ml << std::endl;
hermitian_matrix<std::complex<double>, upper> mu (3, 3);
for (unsigned i = 0; i < mu.size1 (); ++ i) {
mu (i, i) = std::complex<double> (4 * i, 0);
for (unsigned j = i + 1; j < mu.size2 (); ++ j)
mu (i, j) = std::complex<double> (3 * i + j, 3 * i + j);
}
std::cout << mu << std::endl;
vector<double> v (3);
for (unsigned i = 0; i < v.size (); ++ i)
v (i) = i;
std::cout << v << std::endl;
std::cout << v*10.0 << std::endl;
matrix<double> m (3, 3);
for (unsigned i = 0; i < m.size1 (); ++ i)
for (unsigned j = 0; j < m.size2 (); ++ j)
m (i, j) = 3 * i + j;
std::cout << m << std::endl;
*/
Options options;
if (argc == 1) usage();
for (int i = 1; i < argc; ++i) {
if (!strncmp(argv[i], "--infiles", 8)) options.infile = argv[++i];
if (!strncmp(argv[i], "--help", 6) || !strncmp(argv[i], "-h", 2)) usage();
if (!strncmp(argv[i], "--debug", 7) || !strncmp(argv[i], "-d", 2)) options.debug=true;
}
banner();
if(!options.validate()) {
usage();
return 0;
}
Core Core(options);
Core.run();
return 0;
}