GTK+ IOStream
Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
Main Page
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
mffm
possible.future.additions
examples
intMult
intMult.C
Go to the documentation of this file.
1
/* Copyright 2000-2012 Matt Flax <flatmax@flatmax.org>
2
This file is part of GTK+ IOStream class set
3
4
GTK+ IOStream is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
8
9
GTK+ IOStream is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You have received a copy of the GNU General Public License
15
along with GTK+ IOStream
16
*/
17
// g++ intMult.C -o intMult
18
19
#include "
Tree.H
"
20
21
int
main
(
int
argc,
char
*argv[]){
22
23
Tree
rootNode;
24
25
int
N=3;
26
int
count=(uint)pow(2.0,3.0);
27
int
vals[count];
28
int
output[count];
29
30
for
(
int
i=1;i<=count;i++)
31
vals[i]=i;
32
33
rootNode.
addLayers
(N,vals);
34
35
cout<<
"tree results:\n"
;
36
for
(
int
i=1;i<=count;i++){
37
output[i]=rootNode.
multiply
(i);
38
cout<<output[i]<<endl;
39
}
40
41
42
//brute force
43
cout<<
"tree results:\n"
;
44
for
(
int
i=1;i<=count;i++){
45
int
val=1;
46
for
(
int
j=1; j<i; j++)
47
val*=j;
48
for
(
int
j=i+1; j<=count; j++)
49
val*=j;
50
cout<<val<<endl;
51
}
52
53
return
0;
54
}
Generated on Tue Jun 4 2013 11:03:27 for GTK+ IOStream by
1.8.3.1