OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ComplexMatrix& ConjugateTranspose() { | 52 ComplexMatrix& ConjugateTranspose() { |
53 this->CopyDataToScratch(); | 53 this->CopyDataToScratch(); |
54 int num_rows = this->num_rows(); | 54 int num_rows = this->num_rows(); |
55 this->SetNumRows(this->num_columns()); | 55 this->SetNumRows(this->num_columns()); |
56 this->SetNumColumns(num_rows); | 56 this->SetNumColumns(num_rows); |
57 this->Resize(); | 57 this->Resize(); |
58 return ConjugateTranspose(this->scratch_elements()); | 58 return ConjugateTranspose(this->scratch_elements()); |
59 } | 59 } |
60 | 60 |
61 ComplexMatrix& ConjugateTranspose(const ComplexMatrix& operand) { | 61 ComplexMatrix& ConjugateTranspose(const ComplexMatrix& operand) { |
62 CHECK_EQ(operand.num_rows(), this->num_columns()); | 62 RTC_CHECK_EQ(operand.num_rows(), this->num_columns()); |
63 CHECK_EQ(operand.num_columns(), this->num_rows()); | 63 RTC_CHECK_EQ(operand.num_columns(), this->num_rows()); |
64 return ConjugateTranspose(operand.elements()); | 64 return ConjugateTranspose(operand.elements()); |
65 } | 65 } |
66 | 66 |
67 ComplexMatrix& ZeroImag() { | 67 ComplexMatrix& ZeroImag() { |
68 complex<T>* const data = this->data(); | 68 complex<T>* const data = this->data(); |
69 size_t size = this->num_rows() * this->num_columns(); | 69 size_t size = this->num_rows() * this->num_columns(); |
70 for (size_t i = 0; i < size; ++i) { | 70 for (size_t i = 0; i < size; ++i) { |
71 data[i] = complex<T>(data[i].real(), 0); | 71 data[i] = complex<T>(data[i].real(), 0); |
72 } | 72 } |
73 | 73 |
(...skipping 14 matching lines...) Expand all Loading... |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 return *this; | 91 return *this; |
92 } | 92 } |
93 }; | 93 }; |
94 | 94 |
95 } // namespace webrtc | 95 } // namespace webrtc |
96 | 96 |
97 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_COMPLEX_MATRIX_H_ | 97 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_COMPLEX_MATRIX_H_ |
OLD | NEW |