fn_inv.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2011 Conrad Sanderson
3 //
4 // This file is part of the Armadillo C++ library.
5 // It is provided without any warranty of fitness
6 // for any purpose. You can redistribute this file
7 // and/or modify it under the terms of the GNU
8 // Lesser General Public License (LGPL) as published
9 // by the Free Software Foundation, either version 3
10 // of the License or (at your option) any later version.
11 // (see http://www.opensource.org/licenses for more info)
12 
13 
16 
17 
18 
20 template<typename T1>
22 const Op<T1, op_inv>
23 inv
24  (
26  const bool slow = false,
28  )
29  {
32 
33  return Op<T1, op_inv>(X.get_ref(), ((slow == false) ? 0 : 1), 0);
34  }
35 
36 
37 
39 template<typename T1>
41 const T1&
42 inv(const Op<T1, op_inv>& X, const bool slow = false)
43  {
45  arma_ignore(slow);
46 
47  return X.m;
48  }
49 
50 
51 
53 template<typename T1>
56 inv
57  (
58  const Op<T1, op_trimat>& X,
59  const bool slow = false,
61  )
62  {
64  arma_ignore(slow);
66 
67  return Op<T1, op_inv_tr>(X.m, X.aux_uword_a, 0);
68  }
69 
70 
71 
73 template<typename T1>
76 inv
77  (
78  const Op<T1, op_sympd>& X,
79  const bool slow = false,
81  )
82  {
84  arma_ignore(slow);
86 
87  return Op<T1, op_inv_sympd>(X.m, 0, 0);
88  }
89 
90 
91 
92 template<typename T1>
93 inline
94 bool
95 inv
96  (
99  const bool slow = false,
101  )
102  {
104  arma_ignore(junk);
105 
106  try
107  {
108  out = inv(X,slow);
109  }
110  catch(std::runtime_error&)
111  {
112  return false;
113  }
114 
115  return true;
116  }
117 
118 
119 
arma_inline const derived & get_ref() const
Definition: Base_meat.hpp:22
arma_aligned const T1 & m
storage of reference to the operand (eg. a matrix)
Definition: Op_bones.hpp:45
#define arma_ignore(variable)
arma_inline const Op< T1, op_inv > inv(const Base< typename T1::elem_type, T1 > &X, const bool slow=false, const typename arma_blas_type_only< typename T1::elem_type >::result *junk=0)
delayed matrix inverse (general matrices)
Definition: fn_inv.hpp:24
#define arma_extra_debug_sigprint
Definition: debug.hpp:1116
Dense matrix class.
#define arma_inline
arma_aligned uword aux_uword_a
storage of auxiliary data, uword format
Definition: Op_bones.hpp:47


armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:57