-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSymOp.cpp
More file actions
38 lines (33 loc) · 1.06 KB
/
SymOp.cpp
File metadata and controls
38 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: SymOp.cpp
* Author: tg
*
* Created on June 9, 2020, 8:58 AM
*/
#include "SymOp.h"
#include "myExceptions.h"
#include <iomanip>
SymOp::SymOp(const std::vector<float>& R) {
if (R.size() != 9 && R.size() != 12)
throw myExcepts::Dimension("Symop must be initialised from 9 or 12 numbers.");
for (std::vector<float>::const_iterator it = R.begin(); it != R.end(); ++it) {
size_t idx = it - R.begin();
op_[idx] = *it;
}
}
std::ostream& operator<<(std::ostream& out, const SymOp& R) {
for (int i = 0; i < 12; i += 4) {
out << std::fixed << std::setprecision(0)
<< std::setw(3) << R.op_[i]
<< std::setw(3) << R.op_[i + 1]
<< std::setw(3) << R.op_[i + 2] << " "
<< std::setw(6) << std::setprecision(3) << R.op_[i + 3]
<< '\n';
}
return out;
}