| 123 | using namespace WireProfileHelper; |
| 124 | |
| 125 | WireProfile::Ptr WireProfile::create(const std::string& name) { |
| 126 | if (name == "square") { |
| 127 | MatrixFr loop(4,3); |
| 128 | loop << -1, -1, 0, |
| 129 | 1, -1, 0, |
| 130 | 1, 1, 0, |
| 131 | -1, 1, 0; |
| 132 | Ptr r = Ptr(new WireProfile()); |
| 133 | r->initialize(loop); |
| 134 | return r; |
| 135 | } else if (name == "hexagon") { |
| 136 | return WireProfile::create_isotropic(6); |
| 137 | } else if (name == "octagon") { |
| 138 | return WireProfile::create_isotropic(8); |
| 139 | } else if (name == "triangle") { |
| 140 | return WireProfile::create_isotropic(3); |
| 141 | } else { |
| 142 | std::stringstream err_msg; |
| 143 | err_msg << "Unknown loop profile: " << name; |
| 144 | throw NotImplementedError(err_msg.str()); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | WireProfile::Ptr WireProfile::create_isotropic(size_t num_samples) { |
| 149 | MatrixFr loop = MatrixFr::Zero(num_samples, 3); |
no test coverage detected