Main Page
Modules
Namespaces
Classes
Files
File List
File Members
include
armadillo_bits
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>
21
arma_inline
22
const
Op<T1, op_inv>
23
inv
24
(
25
const
Base<typename T1::elem_type,T1>
& X,
26
const
bool
slow =
false
,
27
const
typename
arma_blas_type_only<typename T1::elem_type>::result
*
junk
= 0
28
)
29
{
30
arma_extra_debug_sigprint
();
31
arma_ignore
(
junk
);
32
33
return
Op<T1, op_inv>
(X.
get_ref
(), ((slow ==
false
) ? 0 : 1), 0);
34
}
35
36
37
39
template
<
typename
T1>
40
arma_inline
41
const
T1&
42
inv
(
const
Op<T1, op_inv>
& X,
const
bool
slow =
false
)
43
{
44
arma_extra_debug_sigprint
();
45
arma_ignore
(slow);
46
47
return
X.
m
;
48
}
49
50
51
53
template
<
typename
T1>
54
arma_inline
55
const
Op<T1, op_inv_tr>
56
inv
57
(
58
const
Op<T1, op_trimat>
& X,
59
const
bool
slow =
false
,
60
const
typename
arma_blas_type_only<typename T1::elem_type>::result
*
junk
= 0
61
)
62
{
63
arma_extra_debug_sigprint
();
64
arma_ignore
(slow);
65
arma_ignore
(
junk
);
66
67
return
Op<T1, op_inv_tr>
(X.
m
, X.
aux_uword_a
, 0);
68
}
69
70
71
73
template
<
typename
T1>
74
arma_inline
75
const
Op<T1, op_inv_sympd>
76
inv
77
(
78
const
Op<T1, op_sympd>
& X,
79
const
bool
slow =
false
,
80
const
typename
arma_blas_type_only<typename T1::elem_type>::result
*
junk
= 0
81
)
82
{
83
arma_extra_debug_sigprint
();
84
arma_ignore
(slow);
85
arma_ignore
(
junk
);
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
(
97
Mat<typename T1::elem_type>
& out,
98
const
Base<typename T1::elem_type,T1>
& X,
99
const
bool
slow =
false
,
100
const
typename
arma_blas_type_only<typename T1::elem_type>::result
*
junk
= 0
101
)
102
{
103
arma_extra_debug_sigprint
();
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
Base
Definition:
Base_bones.hpp:25
Base::get_ref
arma_inline const derived & get_ref() const
Definition:
Base_meat.hpp:22
junk
Definition:
typedef.hpp:169
Op
Definition:
forward_bones.hpp:88
Op::m
arma_aligned const T1 & m
storage of reference to the operand (eg. a matrix)
Definition:
Op_bones.hpp:45
arma_ignore
#define arma_ignore(variable)
Definition:
compiler_setup.hpp:23
inv
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
arma_extra_debug_sigprint
#define arma_extra_debug_sigprint
Definition:
debug.hpp:1116
Mat
Dense matrix class.
Definition:
forward_bones.hpp:19
arma_inline
#define arma_inline
Definition:
compiler_setup.hpp:19
arma_blas_type_only
Definition:
restrictors.hpp:125
Op::aux_uword_a
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