BELFEM 0.9.4
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_det.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
17
25
26#ifndef BELFEM_FN_DET_HPP
27#define BELFEM_FN_DET_HPP
28
29#include "assert.hpp"
30#ifdef BELFEM_ARMADILLO
31#include "fn_AR_det.hpp"
32#elif BELFEM_BLAZE
33#include "fn_BZ_det.hpp"
34#endif
35
36namespace belfem
37{
38
39//------------------------------------------------------------------------------
40 template< typename T >
41 auto
42 det( const Matrix< T > & aA )
43 -> decltype( det( aA.matrix_data())) const
44 {
45 BELFEM_ASSERT( aA.n_rows() == aA.n_cols(),
46 "det(): matrix must be square ( %lu x %lu )",
47 ( unsigned long ) aA.n_rows(), ( unsigned long ) aA.n_cols() );
48 return det( aA.matrix_data());
49 }
50
51//------------------------------------------------------------------------------
52
53 template< typename T >
54 auto
56 -> decltype( det( aA.matrix_data() ) )
57 {
58 BELFEM_ASSERT( aA.n_rows() == aA.n_cols(),
59 "det(): matrix must be square ( %lu x %lu )",
60 ( unsigned long ) aA.n_rows(), ( unsigned long ) aA.n_cols() );
61 return det( aA.matrix_data() );
62 }
63
64//------------------------------------------------------------------------------
65}
66#endif //BELFEM_FN_DET_HPP
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Dense column-major matrix.
Definition cl_BZ_Matrix.hpp:28
USER GUIDES:
Definition cl_Capacitor.cpp:16
auto det(const T &A) -> decltype(arma::det(A))
Definition fn_AR_det.hpp:23