Intrepid
/usr/src/RPM/BUILD/trilinos-11.12.1/packages/intrepid/src/Shared/MiniTensor/Intrepid_MiniTensor_LinearAlgebra.h
00001 // @HEADER
00002 // ************************************************************************
00003 //
00004 //                           Intrepid Package
00005 //                 Copyright (2007) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions: Alejandro Mota (amota@sandia.gov)
00038 //
00039 // ************************************************************************
00040 // @HEADER
00041 
00042 #if !defined(Intrepid_MiniTensor_LinearAlgebra_h)
00043 #define Intrepid_MiniTensor_LinearAlgebra_h
00044 
00045 #include "Intrepid_MiniTensor_Tensor.h"
00046 
00047 namespace Intrepid {
00048 
00053 template<typename T, Index N>
00054 T
00055 norm(Tensor<T, N> const & A);
00056 
00061 template<typename T, Index N>
00062 T
00063 norm_1(Tensor<T, N> const & A);
00064 
00069 template<typename T, Index N>
00070 T
00071 norm_infinity(Tensor<T, N> const & A);
00072 
00078 template<typename T, Index N>
00079 Tensor<T, N>
00080 inverse(Tensor<T, N> const & A);
00081 
00088 template<typename T, Index N>
00089 Tensor<T, dimension_subtract<N, 1>::value >
00090 subtensor(Tensor<T, N> const & A, Index const i, Index const j);
00091 
00097 template<typename T, Index N>
00098 void
00099 swap_row(Tensor<T, N> & A, Index const i, Index const j);
00100 
00106 template<typename T, Index N>
00107 void
00108 swap_col(Tensor<T, N> & A, Index const i, Index const j);
00109 
00114 template<typename T, Index N>
00115 T
00116 det(Tensor<T, N> const & A);
00117 
00122 template<typename T, Index N>
00123 T
00124 trace(Tensor<T, N> const & A);
00125 
00130 template<typename T, Index N>
00131 T
00132 I1(Tensor<T, N> const & A);
00133 
00138 template<typename T, Index N>
00139 T
00140 I2(Tensor<T, N> const & A);
00141 
00146 template<typename T, Index N>
00147 T
00148 I3(Tensor<T, N> const & A);
00149 
00154 template<typename T, Index N>
00155 Tensor<T, N>
00156 exp(Tensor<T, N> const & A);
00157 
00162 template<typename T, Index N>
00163 Tensor<T, N>
00164 exp_taylor(Tensor<T, N> const & A);
00165 
00171 template<typename T, Index N>
00172 Tensor<T, N>
00173 exp_pade(Tensor<T, N> const & A);
00174 
00179 template<typename T, Index N>
00180 Tensor<T, N>
00181 log(Tensor<T, N> const & A);
00182 
00187 template<typename T, Index N>
00188 Tensor<T, N>
00189 log_taylor(Tensor<T, N> const & A);
00190 
00196 template<typename T, Index N>
00197 Tensor<T, N>
00198 log_gregory(Tensor<T, N> const & A);
00199 
00204 template<typename T, Index N>
00205 Tensor<T, N>
00206 log_sym(Tensor<T, N> const & A);
00207 
00212 template<typename T, Index N>
00213 Tensor<T, N>
00214 log_eig_sym(Tensor<T, N> const & A);
00215 
00221 template<typename T, Index N>
00222 Tensor<T, N>
00223 log_rotation(Tensor<T, N> const & R);
00224 
00230 template<typename T, Index N>
00231 Tensor<T, N>
00232 log_rotation_pi(Tensor<T, N> const & R);
00233 
00238 template<typename T, Index N>
00239 Tensor<T, N>
00240 gaussian_elimination(Tensor<T, N> const & A);
00241 
00248 template<typename T, Index N>
00249 void
00250 givens_left(T const & c, T const & s, Index i, Index k, Tensor<T, N> & A);
00251 
00258 template<typename T, Index N>
00259 void
00260 givens_right(T const & c, T const & s, Index i, Index k, Tensor<T, N> & A);
00261 
00266 template<typename T, Index N>
00267 void
00268 rank_one_left(T const & beta, Vector<T, N> const & v, Tensor<T, N> & A);
00269 
00274 template<typename T, Index N>
00275 void
00276 rank_one_right(T const & beta, Vector<T, N> const & v, Tensor<T, N> & A);
00277 
00283 template<typename T, Index N>
00284 Tensor<T, N>
00285 exp_skew_symmetric(Tensor<T, N> const & r);
00286 
00292 template<typename T, Index N>
00293 T
00294 norm_off_diagonal(Tensor<T, N> const & A);
00295 
00301 template<typename T, Index N>
00302 std::pair<Index, Index>
00303 arg_max_abs(Tensor<T, N> const & A);
00304 
00310 template<typename T, Index N>
00311 std::pair<Index, Index>
00312 arg_max_off_diagonal(Tensor<T, N> const & A);
00313 
00321 template<typename T, Index N>
00322 std::pair<Vector<T, N>, Tensor<T, N> >
00323 sort_permutation(Vector<T, N> const & u);
00324 
00329 template<typename T, Index N>
00330 boost::tuple<Tensor<T, N>, Tensor<T, N>, Tensor<T, N> >
00331 svd(Tensor<T, N> const & A);
00332 
00342 template<typename T, Index N>
00343 Tensor<T, N>
00344 polar_rotation(Tensor<T, N> const & A);
00345 
00351 template<typename T, Index N>
00352 std::pair<Tensor<T, N>, Tensor<T, N> >
00353 polar_left(Tensor<T, N> const & A);
00354 
00360 template<typename T, Index N>
00361 std::pair<Tensor<T, N>, Tensor<T, N> >
00362 polar_right(Tensor<T, N> const & A);
00363 
00369 template<typename T, Index N>
00370 std::pair<Tensor<T, N>, Tensor<T, N> >
00371 polar_left_eig(Tensor<T, N> const & A);
00372 
00378 template<typename T, Index N>
00379 std::pair<Tensor<T, N>, Tensor<T, N> >
00380 polar_right_eig(Tensor<T, N> const & A);
00381 
00387 template<typename T, Index N>
00388 boost::tuple<Tensor<T, N>, Tensor<T, N>, Tensor<T, N> >
00389 polar_left_logV(Tensor<T, N> const & F);
00390 
00391 template<typename T, Index N>
00392 boost::tuple<Tensor<T, N>, Tensor<T, N>, Tensor<T, N> >
00393 polar_left_logV_eig(Tensor<T, N> const & F);
00394 
00400 template<typename T, Index N>
00401 boost::tuple<Tensor<T, N>, Tensor<T, N>, Tensor<T, N> >
00402 polar_left_logV_lame(Tensor<T, N> const & F);
00403 
00410 template<typename T, Index N>
00411 Tensor<T, N>
00412 bch(Tensor<T, N> const & v, Tensor<T, N> const & r);
00413 
00419 template<typename T>
00420 std::pair<T, T>
00421 schur_sym(const T f, const T g, const T h);
00422 
00427 template<typename T>
00428 std::pair<T, T>
00429 givens(T const & a, T const & b);
00430 
00435 template<typename T, Index N>
00436 std::pair<Tensor<T, N>, Tensor<T, N> >
00437 eig_sym(Tensor<T, N> const & A);
00438 
00443 template<typename T, Index N>
00444 std::pair<Tensor<T, N>, Tensor<T, N> >
00445 eig_spd(Tensor<T, N> const & A);
00446 
00453 template<typename T, Index N>
00454 std::pair<Tensor<T, N>, Tensor<T, N> >
00455 eig_spd_cos(Tensor<T, N> const & A);
00456 
00464 template<typename T, Index N>
00465 std::pair<Tensor<T, N>, bool >
00466 cholesky(Tensor<T, N> const & A);
00467 
00468 } // namespace Intrepid
00469 
00470 #include "Intrepid_MiniTensor_LinearAlgebra.i.h"
00471 #include "Intrepid_MiniTensor_LinearAlgebra.t.h"
00472 
00473 #endif // Intrepid_MiniTensor_LinearAlgebra_h