File: sumDecomposition.cpp

package info (click to toggle)
dmrgpp 6.06-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 113,900 kB
  • sloc: cpp: 80,986; perl: 14,772; ansic: 2,923; makefile: 83; sh: 17
file content (20 lines) | stat: -rw-r--r-- 605 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "SumDecomposition.h"

int main(int argc, char* argv[])
{
	if (argc < 3)
		return 1;
	int total = atoi(argv[1]);
	int sum = atoi(argv[2]);
	int selection = (argc > 3) ? atoi(argv[3]) : 0;
	PsimagLite::SumDecomposition::SelEnum sel = PsimagLite::SumDecomposition::SEL_ALL;
	if (selection < 0)
		sel = PsimagLite::SumDecomposition::SEL_SIZE;
	if (selection >= 0 && argc > 3)
		sel = PsimagLite::SumDecomposition::SEL_INDEX;
	PsimagLite::SumDecomposition sd(total, sum, sel, selection);
	if (sel != PsimagLite::SumDecomposition::SEL_SIZE)
		std::cout << sd;
	else
		std::cout << sd.size() << "\n";
}