libatomprobe
Library for Atom Probe Tomography (APT) computation
example
knapsack.cpp
Go to the documentation of this file.
1
#include <
atomprobe/atomprobe.h
>
2
3
using namespace
std
;
4
using namespace
AtomProbe
;
5
6
int
main
()
7
{
8
9
vector<Weight> wVec;
10
Weight
wt;
11
12
wt.
mass
=0.5;
13
wt.
uniqueId
=1;
14
15
wVec.push_back(wt);
16
17
vector<vector<Weight> > solns;
18
MassTool::bruteKnapsack(wVec,1.0,0.05,3,solns);
19
20
cout <<
"There are :"
<< solns.size() <<
"solns."
<< endl;
21
22
for
(
auto
i=0u;i<solns.size();i++)
23
{
24
cout <<
"=====Soln"
<< i <<
"===="
<< endl;
25
cout <<
" Size:"
<< solns[i].size() << endl;
26
for
(
auto
j=0u;j<solns[i].size();j++)
27
cout << solns[i][j].mass << endl;
28
cout <<
"======================"
<< endl;
29
}
30
31
}
std
STL namespace.
AtomProbe::Weight::mass
float mass
Definition:
massTool.h:35
main
int main()
Definition:
knapsack.cpp:6
AtomProbe::Weight::uniqueId
size_t uniqueId
Definition:
massTool.h:36
AtomProbe
Definition:
axialdf.h:24
atomprobe.h
AtomProbe::Weight
Placeholder class for containing input weights for MassTool.
Definition:
massTool.h:29
Generated on Mon Jul 27 2020 22:40:33 for libatomprobe by
1.8.13