00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00035 #ifndef INTREPID_REALSPACETOOLS_HPP
00036 #define INTREPID_REALSPACETOOLS_HPP
00037
00038 #include "Intrepid_ConfigDefs.hpp"
00039 #include "Intrepid_Types.hpp"
00040 #include "Teuchos_oblackholestream.hpp"
00041 #include "Teuchos_TestForException.hpp"
00042
00043 namespace Intrepid {
00044
00048 template<class Scalar>
00049 class RealSpaceTools {
00050
00051 public:
00052
00060 static void absval(Scalar* absArray, const Scalar* inArray, const int size);
00061
00062
00069 static void absval(Scalar* inoutArray, const int size);
00070
00071
00081 template<class ArrayScalar>
00082 static void absval(ArrayScalar & absArray, const ArrayScalar & inArray);
00083
00084
00089 template<class ArrayScalar>
00090 static void absval(ArrayScalar & inoutAbsArray);
00091
00092
00100 static Scalar vectorNorm(const Scalar* inVec, const int dim, const ENorm normType);
00101
00102
00112 template<class VecArray>
00113 static Scalar vectorNorm(const VecArray & inVec, const ENorm normType);
00114
00115
00129 template<class NormArray, class VecArray>
00130 static void vectorNorm(NormArray & normArray, const VecArray & inVecs, const ENorm normType);
00131
00132
00140 static void transpose(Scalar* transposeMat, const Scalar* inMat, const int dim);
00141
00142
00157 template<class ArrayScalar>
00158 static void transpose(ArrayScalar & transposeMats, const ArrayScalar & inMats);
00159
00160
00168 static void inverse(Scalar* inverseMat, const Scalar* inMat, const int dim);
00169
00170
00186 template<class MatArray>
00187 static void inverse(MatArray & inverseMats, const MatArray & inMats);
00188
00189
00196 static Scalar det(const Scalar* inMat, const int dim);
00197
00198
00208 template<class ArrayScalar>
00209 static Scalar det(const ArrayScalar & inMat);
00210
00211
00226 template<class DetArray, class MatArray>
00227 static void det(DetArray & detArray, const MatArray & inMats);
00228
00229
00239 static void add(Scalar* sumArray, const Scalar* inArray1, const Scalar* inArray2, const int size);
00240
00241
00250 static void add(Scalar* inoutSumArray, const Scalar* inArray, const int size);
00251
00252
00264 template<class ArrayScalar>
00265 static void add(ArrayScalar & sumArray, const ArrayScalar & inArray1, const ArrayScalar & inArray2);
00266
00267
00278 template<class ArrayScalar>
00279 static void add(ArrayScalar & inoutSumArray, const ArrayScalar & inArray);
00280
00281
00291 static void subtract(Scalar* diffArray, const Scalar* inArray1, const Scalar* inArray2, const int size);
00292
00293
00302 static void subtract(Scalar* inoutDiffArray, const Scalar* inArray, const int size);
00303
00304
00316 template<class ArrayScalar>
00317 static void subtract(ArrayScalar & diffArray, const ArrayScalar & inArray1, const ArrayScalar & inArray2);
00318
00319
00330 template<class ArrayScalar>
00331 static void subtract(ArrayScalar & inoutDiffArray, const ArrayScalar & inArray);
00332
00333
00343 static void scale(Scalar* scaledArray, const Scalar* inArray, const int size, const Scalar scalar);
00344
00345
00354 static void scale(Scalar* inoutScaledArray, const int size, const Scalar scalar);
00355
00356
00368 template<class ArrayScalar>
00369 static void scale(ArrayScalar & scaledArray, const ArrayScalar & inArray, const Scalar scalar);
00370
00371
00378 template<class ArrayScalar>
00379 static void scale(ArrayScalar & inoutScaledArray, const Scalar scalar);
00380
00381
00389 static Scalar dot(const Scalar* inArray1, const Scalar* inArray2, const int size);
00390
00391
00402 template<class VecArray>
00403 static Scalar dot(const VecArray & inVec1, const VecArray & inVec2);
00404
00405
00419 template<class DotArray, class VecArray>
00420 static void dot(DotArray & dotArray, const VecArray & inVecs1, const VecArray & inVecs2);
00421
00422
00435 static void matvec(Scalar* matVec, const Scalar* inMat, const Scalar* inVec, const int dim);
00436
00437
00456 template<class MatArray, class VecArray>
00457 static void matvec(VecArray & matVecs, const MatArray & inMats, const VecArray & inVecs);
00458
00459
00473 template<class VecArrayOut, class VecArrayIn>
00474 static void vecprod(VecArrayOut & vecProd,
00475 const VecArrayIn & inLeft,
00476 const VecArrayIn & inRight);
00477
00478
00479
00480 };
00481
00482 }
00483
00484
00485 #include <Intrepid_RealSpaceToolsDef.hpp>
00486
00487 #endif