Conjugate transpose: Difference between revisions
m
C++ - changed formatting of output
m (→{{header|REXX}}: changed whitespace, aligned procedure/function statements) |
m (C++ - changed formatting of output) |
||
Line 407:
std::string to_string(const std::complex<scalar_type>& c) {
std::ostringstream out;
out << std::fixed << std::setprecision(precision);
out << '(' << std::setw(precision + 3) << c.real() << ','
<< std::setw(precision + 3) << c.imag() << ')';
return out.str();
}
Line 414 ⟶ 417:
void print(std::ostream& out, const complex_matrix<scalar_type>& a) {
size_t rows = a.rows(), columns = a.columns();
for (size_t row = 0; row < rows; ++row) {
for (size_t column = 0; column < columns; ++column) {
if (column > 0)
out << ' ';
out <<
}
out << '\n';
Line 516 ⟶ 512:
<pre>
Matrix:
( 2.000000,-1.000000)
Conjugate transpose:
( 2.000000,-0.000000)
( 2.000000,-1.000000) ( 3.000000,-0.000000)
( 4.000000,-0.000000) ( 0.000000,-1.000000) ( 1.000000,-0.000000)
Hermitian: true
Normal: true
Line 528 ⟶ 524:
Matrix:
( 0.000000,-0.707107) ( 0.000000, 0.707107) ( 0.000000, 0.000000)
(
Conjugate transpose:
( 0.707107,-0.000000)
( 0.707107,-0.000000) ( 0.000000,-0.707107) ( 0.000000,-0.000000)
(
Hermitian: false
Normal: true
Line 540 ⟶ 536:
Matrix:
( 2.000000,-1.000000)
( 7.000000,-5.000000) ( 1.000000,-4.000000)
Conjugate transpose:
(-3.000000,-5.000000) ( 0.000000,-0.000000) ( 1.000000,-0.000000)
Hermitian: false
Normal: false
|