summaryrefslogtreecommitdiffstats
path: root/example_float.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2015-10-16 13:45:31 -0400
committerErik Schnetter <schnetter@gmail.com>2015-10-16 13:45:31 -0400
commit06ddf9a62fd6e991dfcf0bd2abe0941b960cb2bb (patch)
tree793b48ebee5b9c779c8afd34cc20245c93b9ad9d /example_float.cc
parent71a4a6821276690eed15df8d2c246be499da1e29 (diff)
downloadvecmathlib-06ddf9a62fd6e991dfcf0bd2abe0941b960cb2bb.zip
vecmathlib-06ddf9a62fd6e991dfcf0bd2abe0941b960cb2bb.tar.gz
Reformat source code with clang-format
Note: If you have an existing checkout with modifications, then you should: (1) save your current state on a branch (2) run clang-format on this branch (3) compare this branch to a fresh checkout of the clang-formatted master Since both your branch and master have been formatted with clang-format, this will lead to a very small diff, avoiding spurious changes due to formatting differences.
Diffstat (limited to 'example_float.cc')
-rw-r--r--example_float.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/example_float.cc b/example_float.cc
index fed91c7..4feea0e 100644
--- a/example_float.cc
+++ b/example_float.cc
@@ -7,20 +7,18 @@
using namespace std;
using namespace vecmathlib;
-
-
-int main(int argc, char** argv)
-{
+int main(int argc, char **argv) {
// Declare a float precision vector with an architecture-dependent
// number of elements
float32_vec x;
// Set each element separately. This is inefficient and should be
// avoided if possible, but we want to demonstrate it here anyway.
- for (int i=0; i<float32_vec::size; ++i) x.set_elt(i, float(i));
+ for (int i = 0; i < float32_vec::size; ++i)
+ x.set_elt(i, float(i));
float32_vec y = x + float32_vec(1.0);
y = sqrt(y);
float32_vec z = log(y);
-
+
// Boolean vectors are closely related to either float or float
// vectors, thus we need to make a distinction
bool32_vec b = x < y;
@@ -29,12 +27,12 @@ int main(int argc, char** argv)
// corresponding to "float32_vec", and there is "int_vec"
// correpsonding to "float32_vec".
int32_vec i = convert_int(y);
-
+
cout << "x=" << x << "\n";
cout << "y=" << y << "\n";
cout << "z=" << z << "\n";
cout << "b=" << b << "\n";
cout << "i=" << i << "\n";
-
+
return 0;
}
OpenPOWER on IntegriCloud