89 if constexpr (is_symmetric_matrix<E>) {
93 for (
size_t i = 0; i < etl::dim<0>(expr) - 1; ++i) {
94 for (
size_t j = i + 1; j < etl::dim<0>(expr); ++j) {
95 if (expr(i, j) != expr(j, i)) {
113 template <
typename E>
116 if constexpr (is_lower_matrix<E>) {
120 else if constexpr (is_strictly_lower_matrix<E>) {
124 else if constexpr (is_uni_lower_matrix<E>) {
128 else if constexpr (is_diagonal_matrix<E>) {
132 for (
size_t i = 0; i < etl::dim<0>(expr) - 1; ++i) {
133 for (
size_t j = i + 1; j < etl::dim<0>(expr); ++j) {
134 if (expr(i, j) != 0.0) {
152 template <
typename E>
155 if constexpr (is_uni_lower_matrix<E>) {
159 for (
size_t i = 0; i < etl::dim<0>(expr); ++i) {
160 if (expr(i, i) != 1.0) {
164 for (
size_t j = i + 1; j < etl::dim<0>(expr); ++j) {
165 if (expr(i, j) != 0.0) {
183 template <
typename E>
186 if constexpr (is_strictly_lower_matrix<E>) {
190 for (
size_t i = 0; i < etl::dim<0>(expr); ++i) {
191 for (
size_t j = i; j < etl::dim<0>(expr); ++j) {
192 if (expr(i, j) != 0.0) {
210 template <
typename E>
213 if constexpr (is_upper_matrix<E>) {
217 else if constexpr (is_strictly_upper_matrix<E>) {
221 else if constexpr (is_uni_upper_matrix<E>) {
225 else if constexpr (is_diagonal_matrix<E>) {
229 for (
size_t i = 1; i < etl::dim<0>(expr); ++i) {
230 for (
size_t j = 0; j < i; ++j) {
231 if (expr(i, j) != 0.0) {
249 template <
typename E>
252 if constexpr (is_uni_upper_matrix<E>) {
256 for (
size_t i = 0; i < etl::dim<0>(expr); ++i) {
257 if (expr(i, i) != 1.0) {
261 for (
size_t j = 0; j < i; ++j) {
262 if (expr(i, j) != 0.0) {
280 template <
typename E>
283 if constexpr (is_strictly_upper_matrix<E>) {
287 for (
size_t i = 0; i < etl::dim<0>(expr); ++i) {
288 for (
size_t j = 0; j <= i; ++j) {
289 if (expr(i, j) != 0.0) {
307 template <
typename E>
317 template <
typename E>
320 if constexpr (is_diagonal_matrix<E>) {
324 for (
size_t i = 0; i < etl::dim<0>(expr); ++i) {
325 for (
size_t j = 0; j < etl::dim<0>(expr); ++j) {
326 if (i != j && expr(i, j) != 0.0) {
344 template <
typename E>
346 if constexpr (is_complex<E>) {
348 if constexpr (is_hermitian_matrix<E>) {
355 for (
size_t i = 0; i < etl::dim<0>(expr); ++i) {
356 for (
size_t j = 0; j < etl::dim<0>(expr); ++j) {
357 if (i != j && expr(i, j) !=
get_conj(expr(j, i))) {
bool is_triangular(E &&expr)
Indicates if the given expression is a triangular matrix or not.
Definition: adapters.hpp:308
constexpr bool is_strictly_lower_matrix
Traits indicating if the given ETL type is a strictly lower triangular matrix.
Definition: adapters.hpp:57
constexpr bool is_lower_matrix
Traits indicating if the given ETL type is a lower triangular matrix.
Definition: adapters.hpp:50
constexpr bool is_strictly_upper_matrix
Traits indicating if the given ETL type is a strictly upper triangular matrix.
Definition: adapters.hpp:64
bool is_lower_triangular(E &&expr)
Indicates if the given expression is a lower triangular matrix or not.
Definition: adapters.hpp:114
Root namespace for the ETL library.
Definition: adapter.hpp:15
constexpr bool is_upper_matrix
Traits indicating if the given ETL type is an upper triangular matrix.
Definition: adapters.hpp:43
bool is_uni_lower_triangular(E &&expr)
Indicates if the given expression is a uni lower triangular matrix or not.
Definition: adapters.hpp:153
bool is_symmetric(E &&expr)
Indicates if the given expression is a symmetric matrix or not.
Definition: adapters.hpp:87
constexpr bool is_uni_lower_matrix
Traits indicating if the given ETL type is a uni lower triangular matrix.
Definition: adapters.hpp:71
constexpr bool is_symmetric_matrix
Traits indicating if the given ETL type is a symmetric matrix.
Definition: adapters.hpp:22
bool is_square(E &&expr)
Indicates if the given expression is a square matrix or not.
Definition: globals.hpp:30
bool is_upper_triangular(E &&expr)
Indicates if the given expression is a upper triangular matrix or not.
Definition: adapters.hpp:211
bool is_diagonal(E &&expr)
Indicates if the given expression is a diagonal matrix or not.
Definition: adapters.hpp:318
std::complex< T > get_conj(const std::complex< T > &c)
Returns the conjugate of the given complex number.
Definition: complex.hpp:555
constexpr bool is_uni_upper_matrix
Traits indicating if the given ETL type is a uni upper triangular matrix.
Definition: adapters.hpp:78
bool is_uni_upper_triangular(E &&expr)
Indicates if the given expression is a strictly upper triangular matrix or not.
Definition: adapters.hpp:250
bool is_hermitian(E &&expr)
Indicates if the given expression represents an hermitian matrix.
Definition: adapters.hpp:345
constexpr bool is_hermitian_matrix
Traits indicating if the given ETL type is a hermitian matrix.
Definition: adapters.hpp:29
bool is_strictly_lower_triangular(E &&expr)
Indicates if the given expression is a strictly lower triangular matrix or not.
Definition: adapters.hpp:184
constexpr bool is_diagonal_matrix
Traits indicating if the given ETL type is a diagonal matrix.
Definition: adapters.hpp:36
bool is_strictly_upper_triangular(E &&expr)
Indicates if the given expression is a strictly upper triangular matrix or not.
Definition: adapters.hpp:281