Intrepid
Intrepid_MiniTensor_LinearAlgebra.h
1 // @HEADER
2 // ************************************************************************
3 //
4 // Intrepid Package
5 // Copyright (2007) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions: Alejandro Mota (amota@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 
42 #if !defined(Intrepid_MiniTensor_LinearAlgebra_h)
43 #define Intrepid_MiniTensor_LinearAlgebra_h
44 
45 #include "Intrepid_MiniTensor_Tensor.h"
46 
47 namespace Intrepid {
48 
53 template<typename T>
54 T
55 norm(Tensor<T> const & A);
56 
61 template<typename T>
62 T
63 norm_1(Tensor<T> const & A);
64 
69 template<typename T>
70 T
71 norm_infinity(Tensor<T> const & A);
72 
78 template<typename T>
79 Tensor<T>
80 inverse(Tensor<T> const & A);
81 
88 template<typename T>
89 Tensor<T>
90 subtensor(Tensor<T> const & A, Index const i, Index const j);
91 
97 template<typename T>
98 void
99 swap_row(Tensor<T> & A, Index const i, Index const j);
100 
106 template<typename T>
107 void
108 swap_col(Tensor<T> & A, Index const i, Index const j);
109 
114 template<typename T>
115 T
116 det(Tensor<T> const & A);
117 
122 template<typename T>
123 T
124 trace(Tensor<T> const & A);
125 
130 template<typename T>
131 T
132 I1(Tensor<T> const & A);
133 
138 template<typename T>
139 T
140 I2(Tensor<T> const & A);
141 
146 template<typename T>
147 T
148 I3(Tensor<T> const & A);
149 
154 template<typename T>
155 Tensor<T>
156 exp(Tensor<T> const & A);
157 
162 template<typename T>
163 Tensor<T>
164 exp_taylor(Tensor<T> const & A);
165 
171 template<typename T>
172 Tensor<T>
173 exp_pade(Tensor<T> const & A);
174 
179 template<typename T>
180 Tensor<T>
181 log(Tensor<T> const & A);
182 
187 template<typename T>
188 Tensor<T>
189 log_taylor(Tensor<T> const & A);
190 
196 template<typename T>
197 Tensor<T>
198 log_gregory(Tensor<T> const & A);
199 
204 template<typename T>
205 Tensor<T>
206 log_sym(Tensor<T> const & A);
207 
212 template<typename T>
213 Tensor<T>
214 log_eig_sym(Tensor<T> const & A);
215 
221 template<typename T>
222 Tensor<T>
223 log_rotation(Tensor<T> const & R);
224 
230 template<typename T>
231 Tensor<T>
232 log_rotation_pi(Tensor<T> const & R);
233 
237 template<typename T>
238 Tensor<T>
239 gaussian_elimination(Tensor<T> const & A);
240 
246 template<typename T>
247 void
248 givens_left(T const & c, T const & s, Index i, Index k, Tensor<T> & A);
249 
255 template<typename T>
256 void
257 givens_right(T const & c, T const & s, Index i, Index k, Tensor<T> & A);
258 
264 template<typename T>
265 Tensor<T>
266 exp_skew_symmetric(Tensor<T> const & r);
267 
273 template<typename T>
274 T
275 norm_off_diagonal(Tensor<T> const & A);
276 
282 template<typename T>
283 std::pair<Index, Index>
284 arg_max_abs(Tensor<T> const & A);
285 
291 template<typename T>
292 std::pair<Index, Index>
293 arg_max_off_diagonal(Tensor<T> const & A);
294 
302 template<typename T>
303 std::pair<Vector<T>, Tensor<T> >
304 sort_permutation(Vector<T> const & u);
305 
310 template<typename T>
311 boost::tuple<Tensor<T>, Tensor<T>, Tensor<T> >
312 svd(Tensor<T> const & A);
313 
323 template<typename T>
324 Tensor<T>
325 polar_rotation(Tensor<T> const & A);
326 
332 template<typename T>
333 std::pair<Tensor<T>, Tensor<T> >
334 polar_left(Tensor<T> const & A);
335 
341 template<typename T>
342 std::pair<Tensor<T>, Tensor<T> >
343 polar_right(Tensor<T> const & A);
344 
350 template<typename T>
351 std::pair<Tensor<T>, Tensor<T> >
352 polar_left_eig(Tensor<T> const & A);
353 
359 template<typename T>
360 std::pair<Tensor<T>, Tensor<T> >
361 polar_right_eig(Tensor<T> const & A);
362 
368 template<typename T>
369 boost::tuple<Tensor<T>, Tensor<T>, Tensor<T> >
370 polar_left_logV(Tensor<T> const & F);
371 
377 template<typename T>
378 boost::tuple<Tensor<T>, Tensor<T>, Tensor<T> >
379 polar_left_logV_lame(Tensor<T> const & F);
380 
387 template<typename T>
388 Tensor<T>
389 bch(Tensor<T> const & v, Tensor<T> const & r);
390 
396 template<typename T>
397 std::pair<T, T>
398 schur_sym(const T f, const T g, const T h);
399 
404 template<typename T>
405 std::pair<T, T>
406 givens(T const & a, T const & b);
407 
412 template<typename T>
413 std::pair<Tensor<T>, Tensor<T> >
414 eig_sym(Tensor<T> const & A);
415 
420 template<typename T>
421 std::pair<Tensor<T>, Tensor<T> >
422 eig_spd(Tensor<T> const & A);
423 
430 template<typename T>
431 std::pair<Tensor<T>, Tensor<T> >
432 eig_spd_cos(Tensor<T> const & A);
433 
441 template<typename T>
442 std::pair<Tensor<T>, bool >
443 cholesky(Tensor<T> const & A);
444 
445 } // namespace Intrepid
446 
447 #include "Intrepid_MiniTensor_LinearAlgebra.i.h"
448 #include "Intrepid_MiniTensor_LinearAlgebra.t.h"
449 
450 #endif // Intrepid_MiniTensor_LinearAlgebra_h