summaryrefslogtreecommitdiffstats
path: root/example.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2012-11-30 15:50:03 -0500
committerErik Schnetter <schnetter@gmail.com>2012-11-30 15:50:03 -0500
commitd2614759a1d542c41af59b04d8711246d2a1e876 (patch)
tree2689209034d9ccc3d29208d50b82b4f89116aa1b /example.cc
downloadvecmathlib-d2614759a1d542c41af59b04d8711246d2a1e876.zip
vecmathlib-d2614759a1d542c41af59b04d8711246d2a1e876.tar.gz
Import initial version
Diffstat (limited to 'example.cc')
-rw-r--r--example.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/example.cc b/example.cc
new file mode 100644
index 0000000..50415c2
--- /dev/null
+++ b/example.cc
@@ -0,0 +1,32 @@
+// -*-C++-*-
+
+#include "vec_float.h"
+#include "vec_double_avx.h"
+
+#include <iostream>
+
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ using namespace vecmathlib;
+ typedef realvec<float,1> realvec_t;
+ // typedef realvec<double,4> realvec_t;
+ typedef realvec_t::boolvec_t boolvec_t;
+ typedef realvec_t::intvec_t intvec_t;
+
+ realvec_t x = 1.0;
+ realvec_t y = x + realvec_t(1.0);
+ y = sqrt(y);
+ realvec_t z = log(y);
+ boolvec_t b = x < y;
+ intvec_t 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