Changeset cda87e9
- Timestamp:
- 08/26/16 19:28:54 (8 years ago)
- Branches:
- master, pympi
- Children:
- 981e22c
- Parents:
- 72ac664
- git-author:
- Hal Finkel <hfinkel@…> (08/26/16 19:28:54)
- git-committer:
- Hal Finkel <hfinkel@…> (08/26/16 19:28:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GenericIOBenchmarkWrite.cxx
r72ac664 rcda87e9 44 44 #include <cstring> 45 45 #include <cmath> 46 #include <algorithm> 46 47 #include <iostream> 47 48 #include <string> … … 56 57 using namespace std; 57 58 using namespace gio; 59 60 template <typename T> 61 struct Generator { 62 Generator(T start, T inc) : value(start), inc(inc) {} 63 T operator()() { 64 value += inc; 65 return value; 66 } 67 68 T value; 69 T inc; 70 }; 58 71 59 72 int main(int argc, char *argv[]) { … … 120 133 mask.resize(Np + GIO.requestedExtraSpace()/sizeof(MASK_T)); 121 134 122 std:: fill(xx.begin(), xx.end(), 25);123 std:: fill(yy.begin(), yy.end(), 25);124 std:: fill(zz.begin(), zz.end(), 25);125 std:: fill(vx.begin(), vx.end(), 25);126 std:: fill(vy.begin(), vy.end(), 25);127 std:: fill(vz.begin(), vz.end(), 25);128 std:: fill(phi.begin(), phi.end(), 25);129 std:: fill(id.begin(), id.end(), 25);135 std::generate(xx.begin(), xx.end(), Generator<POSVEL_T>(25, 3)); 136 std::generate(yy.begin(), yy.end(), Generator<POSVEL_T>(25, 3)); 137 std::generate(zz.begin(), zz.end(), Generator<POSVEL_T>(25, 3)); 138 std::generate(vx.begin(), vx.end(), Generator<POSVEL_T>(25, 3)); 139 std::generate(vy.begin(), vy.end(), Generator<POSVEL_T>(25, 3)); 140 std::generate(vz.begin(), vz.end(), Generator<POSVEL_T>(25, 3)); 141 std::generate(phi.begin(), phi.end(), Generator<POSVEL_T>(25, 3)); 142 std::generate(id.begin(), id.end(), Generator<ID_T>(25, 3)); 130 143 std::fill(mask.begin(), mask.end(), 25); 131 144
Note: See TracChangeset
for help on using the changeset viewer.