Conjugate transpose: Difference between revisions
m
C++ - changed output formatting
m (C++ - changed formatting of output) |
m (C++ - changed output formatting) |
||
Line 345:
for (const auto& row : values) {
assert(row.size() <= columns_);
std::copy(begin(row), end(row), &elements_[
i += columns_;
}
}
Line 409 ⟶ 410:
const int precision = 6;
out << std::fixed << std::setprecision(precision);
out
if
out << " + " << std::setw(precision + 2) << c.imag() << 'i';
else if (c.imag() == 0)
out << " + " << std::setw(precision + 2) << 0.0 << 'i';
else
out << " - " << std::setw(precision + 2) << -c.imag() << 'i';
return out.str();
}
Line 485 ⟶ 491:
using matrix = complex_matrix<double>;
matrix matrix1(3, 3, {{{2, 0}, {2, 1}, {4, 0}},
{{
double n = std::sqrt(0.5);
matrix matrix2(3, 3, {{{n, 0}, {n, 0}, {0, 0}},
{{
{{0,
matrix matrix3(3, 3, {{{2, 2}, {3, 1}, {-3, 5}},
{{
test(matrix1);
Line 512 ⟶ 515:
<pre>
Matrix:
Conjugate transpose:
Hermitian: true
Normal: true
Line 524 ⟶ 527:
Matrix:
Conjugate transpose:
Hermitian: false
Normal: true
Line 536 ⟶ 539:
Matrix:
Conjugate transpose:
Hermitian: false
Normal: false
|