Browse Subversion Repository
Contents of /BLDConograph_ver1/trunk/src/lattice_symmetry/ReducedLatticeToCheckBravais.cc
Parent Directory
| Revision Log
Revision 32 -
( show annotations)
( download)
( as text)
Sat Aug 6 01:34:09 2016 UTC
(7 years, 7 months ago)
by rtomiyasu
File MIME type: text/x-c++src
File size: 24098 byte(s)
Monoclinic(B) -> Monoclinic(C)
| 1 |
/* |
| 2 |
* The MIT License |
| 3 |
|
| 4 |
BLDConograph (Bravais lattice determination module in Conograph) |
| 5 |
|
| 6 |
Copyright (c) <2012> <Ryoko Oishi-Tomiyasu, KEK> |
| 7 |
|
| 8 |
Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 |
of this software and associated documentation files (the "Software"), to deal |
| 10 |
in the Software without restriction, including without limitation the rights |
| 11 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 |
copies of the Software, and to permit persons to whom the Software is |
| 13 |
furnished to do so, subject to the following conditions: |
| 14 |
|
| 15 |
The above copyright notice and this permission notice shall be included in |
| 16 |
all copies or substantial portions of the Software. |
| 17 |
|
| 18 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 21 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 23 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 24 |
THE SOFTWARE. |
| 25 |
* |
| 26 |
*/ |
| 27 |
#include "check_equiv.hh" |
| 28 |
#include "ReducedLatticeToCheckBravais.hh" |
| 29 |
#include "../utility_lattice_reduction/put_Buerger_reduced_lattice.hh" |
| 30 |
#include "../utility_lattice_reduction/put_Selling_reduced_lattice.hh" |
| 31 |
#include "../utility_func/zmath.hh" |
| 32 |
#include "../utility_data_structure/FracMat.hh" |
| 33 |
|
| 34 |
|
| 35 |
static void put_transform_matrix_from_sell_to_neighbor_base(vector< NRMat<Int4> >& arg, |
| 36 |
const bool& does_prudent_search) |
| 37 |
{ |
| 38 |
// { hB * g : g^{-1} is one of the following matrices } are the matrices in Table 6, Oishi-Tomiyasu, Acta. Cryst. (2012). |
| 39 |
static const Int4 ISIZE = 69; |
| 40 |
static const Int4 mat_tray[ISIZE][3][3] |
| 41 |
= { |
| 42 |
{ { 1, 0, 0 }, |
| 43 |
{ 0, 1, 0 }, |
| 44 |
{ 0, 0, 1 } }, |
| 45 |
{ { 1, 0, 0 }, |
| 46 |
{ 0, 0, 1 }, |
| 47 |
{ 0, 1, 0 } }, |
| 48 |
{ { 1, 0, 0 }, |
| 49 |
{ 0, 1, 1 }, |
| 50 |
{ 0, -1, 0 } }, |
| 51 |
{ { 1, 0, 0 }, |
| 52 |
{ 0, -1, 0 }, |
| 53 |
{ 0, 1, 1 } }, |
| 54 |
{ { 1, 0, 0 }, |
| 55 |
{ -1, 1, 0 }, |
| 56 |
{ 0, 0, 1 } }, |
| 57 |
{ { 1, 0, 0 }, |
| 58 |
{ -1, 1, 0 }, |
| 59 |
{ 0, -1, -1 } }, |
| 60 |
{ { 1, 0, 0 }, |
| 61 |
{ 0, 0, 1 }, |
| 62 |
{ -1, 1, 0 } }, |
| 63 |
{ { 1, 0, 0 }, |
| 64 |
{ 0, -1, -1 }, |
| 65 |
{ -1, 1, 0 } }, |
| 66 |
{ { 1, 0, 0 }, |
| 67 |
{ 0, 0, 1 }, |
| 68 |
{ 0, -1, -1 } }, |
| 69 |
{ { 1, 0, 0 }, |
| 70 |
{ 0, -1, -1 }, |
| 71 |
{ 0, 0, 1 } }, |
| 72 |
{ { 1, 0, 0 }, |
| 73 |
{ 0, 1, 1 }, |
| 74 |
{ -1, 0, -1 } }, |
| 75 |
{ { 1, 0, 0 }, |
| 76 |
{ 0, 0, 1 }, |
| 77 |
{ -1, -1, -1 } }, |
| 78 |
{ { 0, 0, 1 }, |
| 79 |
{ 1, 0, 0 }, |
| 80 |
{ 0, 1, 0 } }, |
| 81 |
{ { -1, 1, 0 }, |
| 82 |
{ 1, 0, 0 }, |
| 83 |
{ 0, 0, 1 } }, |
| 84 |
{ { -1, 1, 0 }, |
| 85 |
{ 1, 0, 0 }, |
| 86 |
{ 0, -1, -1 } }, |
| 87 |
{ { 0, 0, 1 }, |
| 88 |
{ 1, 0, 0 }, |
| 89 |
{ -1, 1, 0 } }, |
| 90 |
{ { 0, 0, 1 }, |
| 91 |
{ 1, 0, 0 }, |
| 92 |
{ 0, -1, -1 } }, |
| 93 |
{ { 0, 0, 1 }, |
| 94 |
{ 1, 0, 0 }, |
| 95 |
{ -1, -1, -1 } }, |
| 96 |
{ { -1, 1, 0 }, |
| 97 |
{ 0, 0, 1 }, |
| 98 |
{ 1, 0, 0 } }, |
| 99 |
{ { 0, 0, 1 }, |
| 100 |
{ -1, 1, 0 }, |
| 101 |
{ 1, 0, 0 } }, |
| 102 |
{ { 0, 0, 1 }, |
| 103 |
{ -1, -1, -1 }, |
| 104 |
{ 1, 0, 0 } }, |
| 105 |
{ { 1, 0, 0 }, |
| 106 |
{ 0, 1, 0 }, |
| 107 |
{ -1, 0, 1 } }, |
| 108 |
{ { 1, 0, 0 }, |
| 109 |
{ 0, 1, 0 }, |
| 110 |
{ 0, -1, -1 } }, |
| 111 |
{ { 1, 0, 0 }, |
| 112 |
{ -1, 0, 1 }, |
| 113 |
{ 0, 1, 0 } }, |
| 114 |
{ { 1, 0, 0 }, |
| 115 |
{ 0, -1, -1 }, |
| 116 |
{ 0, 1, 0 } }, |
| 117 |
{ { 1, 0, 0 }, |
| 118 |
{ 0, 0, 1 }, |
| 119 |
{ 0, -1, 0 } }, |
| 120 |
{ { 1, 0, 0 }, |
| 121 |
{ -1, 1, -1 }, |
| 122 |
{ 0, -1, 0 } }, |
| 123 |
{ { 1, 0, 0 }, |
| 124 |
{ 0, -1, 0 }, |
| 125 |
{ 0, 0, 1 } }, |
| 126 |
{ { 1, 0, 0 }, |
| 127 |
{ 0, -1, 0 }, |
| 128 |
{ -1, 1, -1 } }, |
| 129 |
{ { 1, 0, 0 }, |
| 130 |
{ 0, 1, 1 }, |
| 131 |
{ 0, 0, -1 } }, |
| 132 |
{ { 1, 0, 0 }, |
| 133 |
{ 0, 0, -1 }, |
| 134 |
{ 0, 1, 1 } }, |
| 135 |
{ { 1, 0, 0 }, |
| 136 |
{ 0, 0, -1 }, |
| 137 |
{ -1, -1, 0 } }, |
| 138 |
{ { 1, 0, 0 }, |
| 139 |
{ 0, 1, 1 }, |
| 140 |
{ -1, -1, 0 } }, |
| 141 |
{ { 1, 0, 0 }, |
| 142 |
{ -1, -1, 0 }, |
| 143 |
{ 0, 0, -1 } }, |
| 144 |
{ { 1, 0, 0 }, |
| 145 |
{ -1, -1, 0 }, |
| 146 |
{ 0, 1, 1 } }, |
| 147 |
{ { 1, 0, 0 }, |
| 148 |
{ 0, 0, 1 }, |
| 149 |
{ -1, 1, -1 } }, |
| 150 |
{ { 1, 0, 0 }, |
| 151 |
{ -1, 1, -1 }, |
| 152 |
{ 0, 0, 1 } }, |
| 153 |
{ { 1, 0, 0 }, |
| 154 |
{ -1, 0, 1 }, |
| 155 |
{ 0, -1, -1 } }, |
| 156 |
{ { 1, 0, 0 }, |
| 157 |
{ 0, -1, -1 }, |
| 158 |
{ -1, 0, 1 } }, |
| 159 |
{ { -1, 0, 1 }, |
| 160 |
{ 1, 0, 0 }, |
| 161 |
{ 0, 1, 0 } }, |
| 162 |
{ { 0, -1, -1 }, |
| 163 |
{ 1, 0, 0 }, |
| 164 |
{ 0, 1, 0 } }, |
| 165 |
{ { 0, 0, 1 }, |
| 166 |
{ 1, 0, 0 }, |
| 167 |
{ 0, -1, 0 } }, |
| 168 |
{ { -1, 1, -1 }, |
| 169 |
{ 1, 0, 0 }, |
| 170 |
{ 0, -1, 0 } }, |
| 171 |
{ { 0, 1, 1 }, |
| 172 |
{ 1, 0, 0 }, |
| 173 |
{ 0, 0, -1 } }, |
| 174 |
{ { 0, 0, -1 }, |
| 175 |
{ 1, 0, 0 }, |
| 176 |
{ 0, 1, 1 } }, |
| 177 |
{ { 0, 0, -1 }, |
| 178 |
{ 1, 0, 0 }, |
| 179 |
{ -1, -1, 0 } }, |
| 180 |
{ { 0, 1, 1 }, |
| 181 |
{ 1, 0, 0 }, |
| 182 |
{ -1, -1, 0 } }, |
| 183 |
{ { -1, -1, 0 }, |
| 184 |
{ 1, 0, 0 }, |
| 185 |
{ 0, 0, -1 } }, |
| 186 |
{ { -1, -1, 0 }, |
| 187 |
{ 1, 0, 0 }, |
| 188 |
{ 0, 1, 1 } }, |
| 189 |
{ { 0, 0, 1 }, |
| 190 |
{ 1, 0, 0 }, |
| 191 |
{ -1, 1, -1 } }, |
| 192 |
{ { -1, 1, -1 }, |
| 193 |
{ 1, 0, 0 }, |
| 194 |
{ 0, 0, 1 } }, |
| 195 |
{ { -1, 0, 1 }, |
| 196 |
{ 1, 0, 0 }, |
| 197 |
{ 0, -1, -1 } }, |
| 198 |
{ { 0, -1, -1 }, |
| 199 |
{ 1, 0, 0 }, |
| 200 |
{ -1, 0, 1 } }, |
| 201 |
{ { 0, 1, 1 }, |
| 202 |
{ 0, 0, -1 }, |
| 203 |
{ 1, 0, 0 } }, |
| 204 |
{ { 0, 0, -1 }, |
| 205 |
{ 0, 1, 1 }, |
| 206 |
{ 1, 0, 0 } }, |
| 207 |
{ { 0, 0, -1 }, |
| 208 |
{ -1, -1, 0 }, |
| 209 |
{ 1, 0, 0 } }, |
| 210 |
{ { 0, 1, 1 }, |
| 211 |
{ -1, -1, 0 }, |
| 212 |
{ 1, 0, 0 } }, |
| 213 |
{ { -1, -1, 0 }, |
| 214 |
{ 0, 0, -1 }, |
| 215 |
{ 1, 0, 0 } }, |
| 216 |
{ { -1, -1, 0 }, |
| 217 |
{ 0, 1, 1 }, |
| 218 |
{ 1, 0, 0 } }, |
| 219 |
{ { 0, 0, 1 }, |
| 220 |
{ -1, 1, -1 }, |
| 221 |
{ 1, 0, 0 } }, |
| 222 |
{ { -1, 1, -1 }, |
| 223 |
{ 0, 0, 1 }, |
| 224 |
{ 1, 0, 0 } }, |
| 225 |
{ { -1, 0, 1 }, |
| 226 |
{ 0, -1, -1 }, |
| 227 |
{ 1, 0, 0 } }, |
| 228 |
{ { 0, -1, -1 }, |
| 229 |
{ -1, 0, 1 }, |
| 230 |
{ 1, 0, 0 } }, |
| 231 |
{ { 1, 1, 0 }, |
| 232 |
{ 0, 0, 1 }, |
| 233 |
{ 0, -1, -1 } }, |
| 234 |
{ { 1, 1, 0 }, |
| 235 |
{ 0, -1, -1 }, |
| 236 |
{ 0, 0, 1 } }, |
| 237 |
{ { 0, 0, 1 }, |
| 238 |
{ 1, 1, 0 }, |
| 239 |
{ 0, -1, -1 } }, |
| 240 |
{ { 0, -1, -1 }, |
| 241 |
{ 1, 1, 0 }, |
| 242 |
{ 0, 0, 1 } }, |
| 243 |
{ { 0, 0, 1 }, |
| 244 |
{ 0, -1, -1 }, |
| 245 |
{ 1, 1, 0 } }, |
| 246 |
{ { 0, -1, -1 }, |
| 247 |
{ 0, 0, 1 }, |
| 248 |
{ 1, 1, 0 } } |
| 249 |
}; |
| 250 |
|
| 251 |
const Int4 ISIZE2 = (does_prudent_search?ISIZE:21); |
| 252 |
arg.clear(); |
| 253 |
arg.resize(ISIZE2, NRMat<Int4>(3,3)); |
| 254 |
for(Int4 i=0; i<ISIZE2; i++) |
| 255 |
{ |
| 256 |
NRMat<Int4>& arg_ref = arg[i]; |
| 257 |
const Int4 (*mat)[3] = mat_tray[i]; |
| 258 |
for(Int4 i2=0; i2<3; i2++) |
| 259 |
{ |
| 260 |
for(Int4 j2=0; j2<3; j2++) |
| 261 |
{ |
| 262 |
arg_ref[i2][j2] = mat[i2][j2]; |
| 263 |
} |
| 264 |
} |
| 265 |
} |
| 266 |
} |
| 267 |
|
| 268 |
|
| 269 |
static void put_transform_matrix_from_sell_to_neighbor_rhom(vector< NRMat<Int4> >& arg, |
| 270 |
const bool& does_prudent_search) |
| 271 |
{ |
| 272 |
|
| 273 |
// The inverses of the matrices in Table 6, Oishi-Tomiyasu, Acta. Cryst. (2012). |
| 274 |
static const Int4 ISIZE = 64; |
| 275 |
static const Int4 mat_tray[ISIZE][3][3] |
| 276 |
= { |
| 277 |
{ { 1, 0, 0 }, |
| 278 |
{ 0, 1, 0 }, |
| 279 |
{ 0, 0, 1 } }, |
| 280 |
{ { 1, 0, 0 }, |
| 281 |
{ 0, 1, 0 }, |
| 282 |
{ -1, -1, -1 } }, |
| 283 |
{ { 1, 0, 0 }, |
| 284 |
{ -1, -1, -1 }, |
| 285 |
{ 0, 1, 0 } }, |
| 286 |
{ { 1, 0, 0 }, |
| 287 |
{ -1, 0, 1 }, |
| 288 |
{ 0, -1, 0 } }, |
| 289 |
{ { 1, 0, 0 }, |
| 290 |
{ 0, 1, -1 }, |
| 291 |
{ 0, -1, 0 } }, |
| 292 |
{ { 1, 0, 0 }, |
| 293 |
{ 0, -1, 0 }, |
| 294 |
{ -1, 0, 1 } }, |
| 295 |
{ { 1, 0, 0 }, |
| 296 |
{ 0, -1, 0 }, |
| 297 |
{ 0, 1, -1 } }, |
| 298 |
{ { 1, 0, 0 }, |
| 299 |
{ -1, 0, 1 }, |
| 300 |
{ 0, 1, -1 } }, |
| 301 |
{ { 1, 0, 0 }, |
| 302 |
{ 0, 1, -1 }, |
| 303 |
{ -1, 0, 1 } }, |
| 304 |
{ { -1, -1, -1 }, |
| 305 |
{ 1, 0, 0 }, |
| 306 |
{ 0, 1, 0 } }, |
| 307 |
{ { -1, 0, 1 }, |
| 308 |
{ 1, 0, 0 }, |
| 309 |
{ 0, -1, 0 } }, |
| 310 |
{ { 0, 1, -1 }, |
| 311 |
{ 1, 0, 0 }, |
| 312 |
{ 0, -1, 0 } }, |
| 313 |
{ { -1, 0, 1 }, |
| 314 |
{ 1, 0, 0 }, |
| 315 |
{ 0, 1, -1 } }, |
| 316 |
{ { 0, 1, -1 }, |
| 317 |
{ 1, 0, 0 }, |
| 318 |
{ -1, 0, 1 } }, |
| 319 |
{ { -1, 0, 1 }, |
| 320 |
{ 0, 1, -1 }, |
| 321 |
{ 1, 0, 0 } }, |
| 322 |
{ { 0, 1, -1 }, |
| 323 |
{ -1, 0, 1 }, |
| 324 |
{ 1, 0, 0 } }, |
| 325 |
{ { 1, 0, 0 }, |
| 326 |
{ 0, 1, 1 }, |
| 327 |
{ 0, -1, 0 } }, |
| 328 |
{ { 1, 0, 0 }, |
| 329 |
{ -1, 0, -1 }, |
| 330 |
{ 0, -1, 0 } }, |
| 331 |
{ { 1, 0, 0 }, |
| 332 |
{ 0, -1, 0 }, |
| 333 |
{ 0, 1, 1 } }, |
| 334 |
{ { 1, 0, 0 }, |
| 335 |
{ 0, -1, 0 }, |
| 336 |
{ -1, 0, -1 } }, |
| 337 |
{ { 1, 0, 0 }, |
| 338 |
{ 0, 1, 1 }, |
| 339 |
{ -1, -1, 0 } }, |
| 340 |
{ { 1, 0, 0 }, |
| 341 |
{ -1, -1, 0 }, |
| 342 |
{ 0, 1, 1 } }, |
| 343 |
{ { 0, 1, 1 }, |
| 344 |
{ 1, 0, 0 }, |
| 345 |
{ 0, -1, 0 } }, |
| 346 |
{ { -1, 0, -1 }, |
| 347 |
{ 1, 0, 0 }, |
| 348 |
{ 0, -1, 0 } }, |
| 349 |
{ { 0, 1, 1 }, |
| 350 |
{ 1, 0, 0 }, |
| 351 |
{ -1, -1, 0 } }, |
| 352 |
{ { -1, -1, 0 }, |
| 353 |
{ 1, 0, 0 }, |
| 354 |
{ 0, 1, 1 } }, |
| 355 |
{ { 0, 1, 1 }, |
| 356 |
{ -1, -1, 0 }, |
| 357 |
{ 1, 0, 0 } }, |
| 358 |
{ { -1, -1, 0 }, |
| 359 |
{ 0, 1, 1 }, |
| 360 |
{ 1, 0, 0 } }, |
| 361 |
{ { 1, 0, 0 }, |
| 362 |
{ 0, 1, 0 }, |
| 363 |
{ 0, 0, -1 } }, |
| 364 |
{ { 1, 0, 0 }, |
| 365 |
{ 0, 1, 0 }, |
| 366 |
{ -1, 0, 1 } }, |
| 367 |
{ { 1, 0, 0 }, |
| 368 |
{ 0, 1, 0 }, |
| 369 |
{ 0, -1, -1 } }, |
| 370 |
{ { 1, 0, 0 }, |
| 371 |
{ 0, 1, 0 }, |
| 372 |
{ -1, -1, 1 } }, |
| 373 |
{ { 1, 0, 0 }, |
| 374 |
{ 0, 0, -1 }, |
| 375 |
{ 0, 1, 0 } }, |
| 376 |
{ { 1, 0, 0 }, |
| 377 |
{ -1, 0, 1 }, |
| 378 |
{ 0, 1, 0 } }, |
| 379 |
{ { 1, 0, 0 }, |
| 380 |
{ 0, -1, -1 }, |
| 381 |
{ 0, 1, 0 } }, |
| 382 |
{ { 1, 0, 0 }, |
| 383 |
{ -1, -1, 1 }, |
| 384 |
{ 0, 1, 0 } }, |
| 385 |
{ { 1, 0, 0 }, |
| 386 |
{ -1, 1, -1 }, |
| 387 |
{ 0, -1, 0 } }, |
| 388 |
{ { 1, 0, 0 }, |
| 389 |
{ 0, -1, 0 }, |
| 390 |
{ -1, 1, -1 } }, |
| 391 |
{ { 1, 0, 0 }, |
| 392 |
{ -1, 1, 0 }, |
| 393 |
{ 0, -1, -1 } }, |
| 394 |
{ { 1, 0, 0 }, |
| 395 |
{ 0, -1, -1 }, |
| 396 |
{ -1, 1, 0 } }, |
| 397 |
{ { 1, 0, 0 }, |
| 398 |
{ 0, 1, 0 }, |
| 399 |
{ 0, -1, 1 } }, |
| 400 |
{ { 1, 0, 0 }, |
| 401 |
{ 0, 1, 0 }, |
| 402 |
{ -1, 0, -1 } }, |
| 403 |
{ { 1, 0, 0 }, |
| 404 |
{ 0, 0, -1 }, |
| 405 |
{ 0, -1, 0 } }, |
| 406 |
{ { -1, 0, 1 }, |
| 407 |
{ 1, 0, 0 }, |
| 408 |
{ 0, 1, 0 } }, |
| 409 |
{ { 0, -1, -1 }, |
| 410 |
{ 1, 0, 0 }, |
| 411 |
{ 0, 1, 0 } }, |
| 412 |
{ { -1, -1, 1 }, |
| 413 |
{ 1, 0, 0 }, |
| 414 |
{ 0, 1, 0 } }, |
| 415 |
{ { -1, 1, -1 }, |
| 416 |
{ 1, 0, 0 }, |
| 417 |
{ 0, -1, 0 } }, |
| 418 |
{ { 1, 0, 0 }, |
| 419 |
{ 0, -1, 0 }, |
| 420 |
{ -1, 1, 1 } }, |
| 421 |
{ { -1, 1, 0 }, |
| 422 |
{ 1, 0, 0 }, |
| 423 |
{ 0, -1, -1 } }, |
| 424 |
{ { 0, -1, -1 }, |
| 425 |
{ 1, 0, 0 }, |
| 426 |
{ -1, 1, 0 } }, |
| 427 |
{ { 1, 0, 0 }, |
| 428 |
{ 0, -1, 1 }, |
| 429 |
{ 0, 1, 0 } }, |
| 430 |
{ { 1, 0, 0 }, |
| 431 |
{ -1, 0, -1 }, |
| 432 |
{ 0, 1, 0 } }, |
| 433 |
{ { 0, -1, 1 }, |
| 434 |
{ 1, 0, 0 }, |
| 435 |
{ 0, 1, 0 } }, |
| 436 |
{ { -1, 0, -1 }, |
| 437 |
{ 1, 0, 0 }, |
| 438 |
{ 0, 1, 0 } }, |
| 439 |
{ { -1, 1, 1 }, |
| 440 |
{ 1, 0, 0 }, |
| 441 |
{ 0, -1, 0 } }, |
| 442 |
{ { 1, 0, 0 }, |
| 443 |
{ -1, 1, 1 }, |
| 444 |
{ 0, -1, 0 } }, |
| 445 |
{ { -1, 1, 0 }, |
| 446 |
{ 0, -1, -1 }, |
| 447 |
{ 1, 0, 0 } }, |
| 448 |
{ { 0, -1, -1 }, |
| 449 |
{ -1, 1, 0 }, |
| 450 |
{ 1, 0, 0 } }, |
| 451 |
{ { -1, -1, 0 }, |
| 452 |
{ 0, 1, -1 }, |
| 453 |
{ 1, 0, 0 } }, |
| 454 |
{ { 0, 1, -1 }, |
| 455 |
{ -1, -1, 0 }, |
| 456 |
{ 1, 0, 0 } }, |
| 457 |
{ { -1, -1, 0 }, |
| 458 |
{ 1, 0, 0 }, |
| 459 |
{ 0, 1, -1 } }, |
| 460 |
{ { 0, 1, -1 }, |
| 461 |
{ 1, 0, 0 }, |
| 462 |
{ -1, -1, 0 } }, |
| 463 |
{ { 1, 0, 0 }, |
| 464 |
{ -1, -1, 0 }, |
| 465 |
{ 0, 1, -1 } }, |
| 466 |
{ { 1, 0, 0 }, |
| 467 |
{ 0, 1, -1 }, |
| 468 |
{ -1, -1, 0 } } |
| 469 |
}; |
| 470 |
|
| 471 |
const Int4 ISIZE2 = (does_prudent_search?ISIZE:16); |
| 472 |
arg.clear(); |
| 473 |
arg.resize(ISIZE2, NRMat<Int4>(3,3)); |
| 474 |
for(Int4 i=0; i<ISIZE2; i++) |
| 475 |
{ |
| 476 |
NRMat<Int4>& arg_ref = arg[i]; |
| 477 |
const Int4 (*mat)[3] = mat_tray[i]; |
| 478 |
for(Int4 i2=0; i2<3; i2++) |
| 479 |
{ |
| 480 |
for(Int4 j2=0; j2<3; j2++) |
| 481 |
{ |
| 482 |
arg_ref[i2][j2] = mat[i2][j2]; |
| 483 |
} |
| 484 |
} |
| 485 |
} |
| 486 |
} |
| 487 |
|
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
// The second variable is the inverse matrix of the first variable. |
| 492 |
static vector< vector< pair< NRMat<Int4>, FracMat > > > put_Transform_Matrix_base() |
| 493 |
{ |
| 494 |
static const NRMat<Int4> tmat_prim_to_Acell1 = transpose( BravaisType::putTransformMatrixFromPrimitiveToBase(BaseA_Axis) ); |
| 495 |
static const NRMat<Int4> tmat_prim_to_Bcell1 = transpose( BravaisType::putTransformMatrixFromPrimitiveToBase(BaseB_Axis) ); |
| 496 |
static const NRMat<Int4> tmat_prim_to_Ccell1 = transpose( BravaisType::putTransformMatrixFromPrimitiveToBase(BaseC_Axis) ); |
| 497 |
|
| 498 |
vector< vector< pair< NRMat<Int4>, FracMat > > > S_min_to_sell(6); |
| 499 |
vector< pair< NRMat<Int4>, FracMat > >& S_minA_to_sell_qck = S_min_to_sell[(size_t)BaseA_Axis*2]; |
| 500 |
vector< pair< NRMat<Int4>, FracMat > >& S_minA_to_sell_prd = S_min_to_sell[(size_t)BaseA_Axis*2+1]; |
| 501 |
vector< pair< NRMat<Int4>, FracMat > >& S_minB_to_sell_qck = S_min_to_sell[(size_t)BaseB_Axis*2]; |
| 502 |
vector< pair< NRMat<Int4>, FracMat > >& S_minB_to_sell_prd = S_min_to_sell[(size_t)BaseB_Axis*2+1]; |
| 503 |
vector< pair< NRMat<Int4>, FracMat > >& S_minC_to_sell_qck = S_min_to_sell[(size_t)BaseC_Axis*2]; |
| 504 |
vector< pair< NRMat<Int4>, FracMat > >& S_minC_to_sell_prd = S_min_to_sell[(size_t)BaseC_Axis*2+1]; |
| 505 |
|
| 506 |
vector< NRMat<Int4> > mat_tray; |
| 507 |
NRMat<Int4> mat(3,3); |
| 508 |
put_transform_matrix_from_sell_to_neighbor_base(mat_tray, false); |
| 509 |
|
| 510 |
for(vector< NRMat<Int4> >::const_iterator it=mat_tray.begin(); it!=mat_tray.end(); it++) |
| 511 |
{ |
| 512 |
mat = mprod(*it, tmat_prim_to_Acell1); |
| 513 |
S_minA_to_sell_qck.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 514 |
|
| 515 |
mat = mprod(*it, tmat_prim_to_Bcell1); |
| 516 |
S_minB_to_sell_qck.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 517 |
|
| 518 |
mat = mprod(*it, tmat_prim_to_Ccell1); |
| 519 |
S_minC_to_sell_qck.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 520 |
} |
| 521 |
|
| 522 |
put_transform_matrix_from_sell_to_neighbor_base(mat_tray, true); |
| 523 |
|
| 524 |
for(vector< NRMat<Int4> >::const_iterator it=mat_tray.begin(); it!=mat_tray.end(); it++) |
| 525 |
{ |
| 526 |
mat = mprod(*it, tmat_prim_to_Acell1); |
| 527 |
S_minA_to_sell_prd.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 528 |
mat = mprod(*it, tmat_prim_to_Bcell1); |
| 529 |
S_minB_to_sell_prd.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 530 |
mat = mprod(*it, tmat_prim_to_Ccell1); |
| 531 |
S_minC_to_sell_prd.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 532 |
} |
| 533 |
|
| 534 |
return S_min_to_sell; |
| 535 |
} |
| 536 |
|
| 537 |
|
| 538 |
// The second variable is the inverse matrix of the first variable. |
| 539 |
static vector< pair< NRMat<Int4>, FracMat > > put_Transform_Matrix_face() |
| 540 |
{ |
| 541 |
// \tr{hF^{-1}}(2 3), hF is the matrix in Table 4, Oishi-Tomiyasu, Acta Cryst. (2012). |
| 542 |
static const NRMat<Int4> tmat_prim_to_face = transpose( BravaisType::putTransformMatrixFromPrimitiveToFace() ); |
| 543 |
|
| 544 |
vector< pair< NRMat<Int4>, FracMat > > S_min_to_sell; |
| 545 |
|
| 546 |
// < \tr{hF^{-1}}(2 3), (2 3) \tr{hF} > |
| 547 |
S_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( tmat_prim_to_face, FInverse3( tmat_prim_to_face ) ) ); |
| 548 |
|
| 549 |
// < (1 3 2) \tr{hF^{-1}}(2 3), (2 3) \tr{hF} (1 2 3) > |
| 550 |
NRMat<Int4> mat = mprod(put_matrix_ZXY(), tmat_prim_to_face); |
| 551 |
S_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 552 |
|
| 553 |
// < (1 2 3) \tr{hF^{-1}}(2 3), (2 3) \tr{hF} (1 3 2) > |
| 554 |
mat = mprod(put_matrix_YZX(), tmat_prim_to_face); |
| 555 |
S_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 556 |
|
| 557 |
return S_min_to_sell; |
| 558 |
} |
| 559 |
|
| 560 |
|
| 561 |
// The second variable is the inverse matrix of the first variable. |
| 562 |
static vector< pair< NRMat<Int4>, FracMat > > put_Transform_Matrix_body() |
| 563 |
{ |
| 564 |
// \tr{hI^{-1}}(2 3), hI is the matrix in Table 5, Oishi-Tomiyasu, Acta Cryst. (2012). |
| 565 |
static const NRMat<Int4> tmat_prim_to_body = BravaisType::putTransformMatrixFromBodyToPrimitive(); |
| 566 |
|
| 567 |
vector< pair< NRMat<Int4>, FracMat > > InvS_min_to_sell; |
| 568 |
|
| 569 |
// < \tr{hI^{-1}}(2 3), (2 3) \tr{hI} > |
| 570 |
InvS_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( tmat_prim_to_body, FInverse3( tmat_prim_to_body ) ) ); |
| 571 |
|
| 572 |
// < (1 3 2) \tr{hI^{-1}}(2 3), (2 3) \tr{hI} (1 2 3) > |
| 573 |
NRMat<Int4> mat = mprod(put_matrix_ZXY(), tmat_prim_to_body); |
| 574 |
InvS_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 575 |
|
| 576 |
// < (1 2 3) \tr{hI^{-1}}(2 3), (2 3) \tr{hI} (1 3 2) > |
| 577 |
mat = mprod(put_matrix_YZX(), tmat_prim_to_body); |
| 578 |
InvS_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 579 |
|
| 580 |
return InvS_min_to_sell; |
| 581 |
} |
| 582 |
|
| 583 |
|
| 584 |
// The second variable is the inverse matrix of the first variable. |
| 585 |
static vector< vector< pair< NRMat<Int4>, FracMat > > > put_Transform_Matrix_rhom() |
| 586 |
{ |
| 587 |
// Definition of \tr{hR}. |
| 588 |
static const NRMat<Int4> tmat_prim_to_rhomhex = transpose( BravaisType::putTransformMatrixFromPrimitiveToRhomHex() ); |
| 589 |
|
| 590 |
vector< vector< pair< NRMat<Int4>, FracMat > > > S_min_to_sell(4); |
| 591 |
vector< pair< NRMat<Int4>, FracMat > >& S_min_rho_to_sell_qck = S_min_to_sell[(size_t)Rho_Axis*2]; |
| 592 |
vector< pair< NRMat<Int4>, FracMat > >& S_min_rho_to_sell_prd = S_min_to_sell[(size_t)Rho_Axis*2+1]; |
| 593 |
vector< pair< NRMat<Int4>, FracMat > >& S_min_hex_to_sell_qck = S_min_to_sell[(size_t)Hex_Axis*2]; |
| 594 |
vector< pair< NRMat<Int4>, FracMat > >& S_min_hex_to_sell_prd = S_min_to_sell[(size_t)Hex_Axis*2+1]; |
| 595 |
|
| 596 |
vector< NRMat<Int4> > mat_tray; |
| 597 |
NRMat<Int4> mat(3,3); |
| 598 |
put_transform_matrix_from_sell_to_neighbor_rhom(mat_tray, false); |
| 599 |
|
| 600 |
for(vector< NRMat<Int4> >::const_iterator it=mat_tray.begin(); it!=mat_tray.end(); it++) |
| 601 |
{ |
| 602 |
// < g^{-1}, g > |
| 603 |
S_min_rho_to_sell_qck.push_back( pair< NRMat<Int4>, FracMat >( *it, FInverse3( *it ) ) ); |
| 604 |
|
| 605 |
// < g^{-1}*\tr{hR}, \tr{hR}^{-1}*g > |
| 606 |
mat = mprod(*it, tmat_prim_to_rhomhex); |
| 607 |
S_min_hex_to_sell_qck.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 608 |
} |
| 609 |
|
| 610 |
put_transform_matrix_from_sell_to_neighbor_rhom(mat_tray, true); |
| 611 |
|
| 612 |
for(vector< NRMat<Int4> >::const_iterator it=mat_tray.begin(); it!=mat_tray.end(); it++) |
| 613 |
{ |
| 614 |
// < g^{-1}, g > |
| 615 |
S_min_rho_to_sell_prd.push_back( pair< NRMat<Int4>, FracMat >( *it, FInverse3( *it ) ) ); |
| 616 |
|
| 617 |
// < g^{-1}*\tr{hR}, \tr{hR}^{-1}*g > |
| 618 |
mat = mprod(*it, tmat_prim_to_rhomhex); |
| 619 |
S_min_hex_to_sell_prd.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 620 |
} |
| 621 |
|
| 622 |
return S_min_to_sell; |
| 623 |
} |
| 624 |
|
| 625 |
|
| 626 |
const vector< pair< NRMat<Int4>, FracMat > > ReducedLatticeToCheckBravais::m_trans_mat_red_F = put_Transform_Matrix_face(); |
| 627 |
const vector< pair< NRMat<Int4>, FracMat > > ReducedLatticeToCheckBravais::m_trans_mat_red_I = put_Transform_Matrix_body(); |
| 628 |
const vector< vector< pair< NRMat<Int4>, FracMat > > > ReducedLatticeToCheckBravais::m_trans_mat_red_rhom = put_Transform_Matrix_rhom(); |
| 629 |
const vector< vector< pair< NRMat<Int4>, FracMat > > > ReducedLatticeToCheckBravais::m_trans_mat_red_base = put_Transform_Matrix_base(); |
| 630 |
|
| 631 |
ReducedLatticeToCheckBravais::ReducedLatticeToCheckBravais( |
| 632 |
const eABCaxis& axis1, |
| 633 |
const eRHaxis& axis2, |
| 634 |
const bool& does_prudent_sym_search, |
| 635 |
const Double& resol, const SymMat43_Double & S_red) |
| 636 |
: m_monoclinic_b_type(put_monoclinic_b_type(axis1)), |
| 637 |
m_rhombohedral_type(put_rhombohedral_type(axis2)), |
| 638 |
m_S_super_obtuse( transform_sym_matrix(S_red.second, S_red.first) ) |
| 639 |
{ |
| 640 |
put_S_Buerger_reduced_IF(resol, m_S_super_obtuse, m_S_red_body, false); |
| 641 |
put_S_Buerger_reduced_base(m_monoclinic_b_type, does_prudent_sym_search, resol, m_S_super_obtuse, m_S_red_base); |
| 642 |
put_S_Buerger_reduced_rhom(m_rhombohedral_type, does_prudent_sym_search, resol, m_S_super_obtuse, m_S_red_rhom); |
| 643 |
|
| 644 |
const SymMat<Double> S_super_obtuse3( put_sym_matrix_sizeNplus1toN(m_S_super_obtuse) ); |
| 645 |
const SymMat<Double> inv_S( Inverse3( S_super_obtuse3 ) ); |
| 646 |
|
| 647 |
// Calculate the inverse of m_S_red. |
| 648 |
SymMat<Double> inv_S_super_obtuse(4); |
| 649 |
NRMat<Int4> tmat_inv_S_super_obtuse(4,3); |
| 650 |
|
| 651 |
// inv_S_super_obtuse = transpose( tmat_inv_S_super_obtuse) * inverse(S_super_obtuse3) * tmat_inv_S_super_obtuse. |
| 652 |
put_Selling_reduced_dim_3(inv_S, inv_S_super_obtuse, tmat_inv_S_super_obtuse); |
| 653 |
moveSmallerDiagonalLeftUpper(inv_S_super_obtuse, tmat_inv_S_super_obtuse); |
| 654 |
tmat_inv_S_super_obtuse = put_transform_matrix_row4to3(tmat_inv_S_super_obtuse); |
| 655 |
transpose_square_matrix(tmat_inv_S_super_obtuse); |
| 656 |
|
| 657 |
const SymMat<Double> S_inv_super_obtuse |
| 658 |
= put_sym_matrix_sizeNtoNplus1( transform_sym_matrix( Inverse3(tmat_inv_S_super_obtuse), S_super_obtuse3 ) ); |
| 659 |
|
| 660 |
put_S_Buerger_reduced_IF(resol, S_inv_super_obtuse, m_S_red_face, true); |
| 661 |
|
| 662 |
for(map< SymMat<Double>, NRMat<Int4> >::iterator it=m_S_red_face.begin(); it!=m_S_red_face.end(); it++) |
| 663 |
{ |
| 664 |
it->second = put_transform_matrix_row3to4( mprod(tmat_inv_S_super_obtuse, put_transform_matrix_row4to3(it->second) ) ); |
| 665 |
} |
| 666 |
} |
| 667 |
|
| 668 |
|
| 669 |
ReducedLatticeToCheckBravais::~ReducedLatticeToCheckBravais() |
| 670 |
{ |
| 671 |
} |
| 672 |
|
| 673 |
|
| 674 |
// On input, inv_flag = false indicates that S_super_obtuse_equiv is Selling-reduced, |
| 675 |
// and inv_flag = true indicates that Inverse(S_super_obtuse_equiv) is Selling-reduced. |
| 676 |
// In the former case, on output, S_red_body are symmetric matrices having a body-centered and Buerger-reduced inverse. |
| 677 |
// In the latter case, on output, S_red_IF are symmetric matrices having a face-centered and Buerger-reduced inverse. |
| 678 |
void ReducedLatticeToCheckBravais::put_S_Buerger_reduced_IF( |
| 679 |
const Double& resol, const SymMat<Double>& S_super_obtuse, |
| 680 |
map< SymMat<Double>, NRMat<Int4> >& S_red_IF, |
| 681 |
const bool& inv_flag) |
| 682 |
{ |
| 683 |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_IF = (inv_flag?m_trans_mat_red_F:m_trans_mat_red_I); |
| 684 |
S_red_IF.clear(); |
| 685 |
|
| 686 |
NRMat<Int4> tmat; |
| 687 |
SymMat<Double> S2_red0(3), S2_red(3); |
| 688 |
|
| 689 |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_IF.begin(); it!=tmat_red_IF.end(); it++) |
| 690 |
{ |
| 691 |
const FracMat& inv_mat = it->second; |
| 692 |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_sizeNplus1toN(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
| 693 |
S2_red = S2_red0; |
| 694 |
|
| 695 |
cal_average_crystal_system(D2h, S2_red); |
| 696 |
if( !check_equiv_m(S2_red0, S2_red, resol) ) continue; |
| 697 |
|
| 698 |
tmat = identity_matrix<Int4>(3); |
| 699 |
moveLargerDiagonalLeftUpper(S2_red, tmat); |
| 700 |
tmat = mprod( put_transform_matrix_row3to4(it->first), transpose(tmat) ); // inverse(tmat) = transpose(tmat). |
| 701 |
|
| 702 |
S_red_IF.insert( SymMat43_Double(S2_red, tmat) ); |
| 703 |
} |
| 704 |
} |
| 705 |
|
| 706 |
void ReducedLatticeToCheckBravais::put_S_Buerger_reduced_rhom( |
| 707 |
const BravaisType& rhombohedral_type, |
| 708 |
const bool& does_prudent_sym_search, |
| 709 |
const Double& resol, const SymMat<Double>& S_super_obtuse, |
| 710 |
map< SymMat<Double>, NRMat<Int4> >& S_red_rhomhex) |
| 711 |
{ |
| 712 |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_rhom = m_trans_mat_red_rhom[(size_t)rhombohedral_type.enumRHaxis()*2+(does_prudent_sym_search?1:0)]; |
| 713 |
S_red_rhomhex.clear(); |
| 714 |
|
| 715 |
NRMat<Int4> tmat; |
| 716 |
SymMat<Double> S2_red0(3), S2_red(3); |
| 717 |
|
| 718 |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_rhom.begin(); it!=tmat_red_rhom.end(); it++) |
| 719 |
{ |
| 720 |
const FracMat& inv_mat = it->second; |
| 721 |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_sizeNplus1toN(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
| 722 |
S2_red = S2_red0; |
| 723 |
|
| 724 |
cal_average_crystal_system(rhombohedral_type.enumPointGroup(), S2_red); |
| 725 |
if( !check_equiv_m(S2_red0, S2_red, resol) ) continue; |
| 726 |
|
| 727 |
tmat = put_transform_matrix_row3to4(it->first); |
| 728 |
|
| 729 |
S_red_rhomhex.insert( SymMat43_Double(S2_red, tmat) ); |
| 730 |
} |
| 731 |
} |
| 732 |
|
| 733 |
|
| 734 |
// On input, S_red is Buerger-reduced and S_super_obtuse_equiv is Selling-reduced. |
| 735 |
// On output, S_red_base are symmetric matrices having a base-centered and Buerger-reduced inverse. |
| 736 |
void ReducedLatticeToCheckBravais::put_S_Buerger_reduced_base( |
| 737 |
const BravaisType& monoclinic_b_type, |
| 738 |
const bool& does_prudent_sym_search, |
| 739 |
const Double& resol, const SymMat<Double>& S_super_obtuse, |
| 740 |
map< SymMat<Double>, NRMat<Int4> >& S_red_base) |
| 741 |
{ |
| 742 |
const eBASEaxis ibase_axis = monoclinic_b_type.enumBASEaxis(); |
| 743 |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_base = m_trans_mat_red_base[(size_t)ibase_axis*2+(does_prudent_sym_search?1:0)]; |
| 744 |
|
| 745 |
S_red_base.clear(); |
| 746 |
|
| 747 |
NRMat<Int4> tmat; |
| 748 |
SymMat<Double> S2_red0(3), S2_red(3); |
| 749 |
|
| 750 |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_base.begin(); it!=tmat_red_base.end(); it++) |
| 751 |
{ |
| 752 |
const FracMat& inv_mat = it->second; |
| 753 |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_sizeNplus1toN(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
| 754 |
S2_red = S2_red0; |
| 755 |
|
| 756 |
cal_average_crystal_system(monoclinic_b_type.enumPointGroup(), S2_red); |
| 757 |
|
| 758 |
if( !check_equiv_m(S2_red0, S2_red, resol) ) continue; |
| 759 |
|
| 760 |
tmat = put_transform_matrix_row3to4(it->first); |
| 761 |
if( !putBuergerReducedMonoclinicB(monoclinic_b_type, S2_red, tmat) ) continue; |
| 762 |
|
| 763 |
S_red_base.insert( SymMat43_Double(S2_red, tmat) ); |
| 764 |
} |
| 765 |
} |
| 766 |
|
| 767 |
|
| 768 |
const map< SymMat<Double>, NRMat<Int4> >& ReducedLatticeToCheckBravais::checkCentringType(const BravaisType& brat) const |
| 769 |
{ |
| 770 |
if( brat == m_monoclinic_b_type ) |
| 771 |
{ |
| 772 |
return m_S_red_base; |
| 773 |
} |
| 774 |
else if( brat.enumCentringType() == Face ) |
| 775 |
{ |
| 776 |
return m_S_red_face; |
| 777 |
} |
| 778 |
else if( brat.enumCentringType() == Inner ) |
| 779 |
{ |
| 780 |
return m_S_red_body; |
| 781 |
} |
| 782 |
else if( brat == m_rhombohedral_type ) |
| 783 |
{ |
| 784 |
return m_S_red_rhom; |
| 785 |
} |
| 786 |
else |
| 787 |
{ |
| 788 |
assert(false); |
| 789 |
return m_S_red_body; |
| 790 |
} |
| 791 |
} |
| 792 |
|
| |