BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
op_AR_MatrixEqualEqual.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12
13#ifndef BELFEM_OP_AR_MATRIXEQUALEQUAL_HPP
14#define BELFEM_OP_AR_MATRIXEQUALEQUAL_HPP
15
16#include "cl_AR_Matrix.hpp"
17
18namespace belfem
19{
20//------------------------------------------------------------------------------
21 template< typename T >
22 bool
23 operator==( const Matrix <T> & aA,
24 const Matrix <T> & aB )
25 {
26 return ( std::size_t ) arma::as_scalar(
27 arma::accu( aA.matrix_data() == aB.matrix_data() ) )
28 == ( std::size_t ) aA.n_rows()*aA.n_cols() ;
29 }
30
31// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
32
33 template< typename T >
34 bool
35 operator==( const T & aA,
36 const Matrix <T> & aB )
37 {
38 return ( std::size_t ) arma::as_scalar(
39 arma::accu( aA == aB.matrix_data() ) )
40 == ( std::size_t ) aA.n_rows()*aA.n_cols() ;
41 return aA == aB.matrix_data();
42 }
43
44// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45
46 template< typename T >
47 bool
48 operator==( const Matrix <T> & aA,
49 const T & aB )
50 {
51 return ( std::size_t ) arma::as_scalar(
52 arma::accu( aA.matrix_data() == aB ) )
53 == ( std::size_t ) aA.n_rows()*aA.n_cols() ;
54 }
55
56//------------------------------------------------------------------------------
57}
58#endif //BELFEM_OP_AR_MATRIXEQUALEQUAL_HPP
MatrixType & matrix_data()
Definition cl_AR_Matrix.hpp:157
size_t n_rows() const
Definition cl_AR_Matrix.hpp:205
size_t n_cols() const
Definition cl_AR_Matrix.hpp:213
USER GUIDES:
Definition cl_Capacitor.cpp:16
bool operator==(const Matrix< T > &aA, const Matrix< T > &aB)
Definition op_AR_MatrixEqualEqual.hpp:23