1 /*
  2  *   Copyright (c) 2009, Michael Lehn
  3  *
  4  *   All rights reserved.
  5  *
  6  *   Redistribution and use in source and binary forms, with or without
  7  *   modification, are permitted provided that the following conditions
  8  *   are met:
  9  *
 10  *   1) Redistributions of source code must retain the above copyright
 11  *      notice, this list of conditions and the following disclaimer.
 12  *   2) Redistributions in binary form must reproduce the above copyright
 13  *      notice, this list of conditions and the following disclaimer in
 14  *      the documentation and/or other materials provided with the
 15  *      distribution.
 16  *   3) Neither the name of the FLENS development group nor the names of
 17  *      its contributors may be used to endorse or promote products derived
 18  *      from this software without specific prior written permission.
 19  *
 20  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 21  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 22  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 23  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 24  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 25  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 26  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 27  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 28  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 29  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 30  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 31  */
 32 
 33 #ifndef FLENS_LAPACK_TYPEDEFS_H
 34 #define FLENS_LAPACK_TYPEDEFS_H 1
 35 
 36 #include <cassert>
 37 #include <complex>
 38 #include <cxxblas/cxxblas.h>
 39 #include <flens/storage/storage.h>
 40 
 41 namespace flens { namespace lapack {
 42 
 43 // vector views
 44 template <typename T>
 45 using DenseVectorConstView = DenseVector<ConstArrayView<T> >;
 46 
 47 template <typename T>
 48 using DenseVectorView = DenseVector<ArrayView<T> >;
 49 
 50 
 51 // matrix views
 52 template <typename T>
 53 using GeMatrixConstView = GeMatrix<ConstFullStorageView<T, ColMajor> >;
 54 
 55 template <typename T>
 56 using GeMatrixView = GeMatrix<FullStorageView<T, ColMajor> >;
 57 
 58 
 59 enum Norm {
 60     OneNorm = 'O',
 61     InfinityNorm = 'I',
 62     FrobeniusNorm = 'F',
 63     MaximumNorm = 'M'
 64 };
 65 
 66 enum ProbabilityDistribution {
 67     Uniform01,
 68     Uniform_11,
 69     StandardNormal
 70 };
 71 
 72 enum Direction {
 73     Forward   = 'F',
 74     Backward  = 'B'
 75 };
 76 
 77 enum StoreVectors {
 78     ColumnWise = 'C',
 79     RowWise    = 'R'
 80 };
 81 
 82 enum MachineParameter {
 83     Eps                = 'E'// relative machine precision
 84     SafeMin            = 'S'// safe minimum, such that reciprocal does not
 85                               // overflow
 86     Base               = 'B'// base of the machine
 87     Precision          = 'P'// Eps*Base
 88     Mantissa           = 'N'// number of (base) digits in the mantissa
 89     Rounding           = 'R'// return 1 when rounding occurs in addition,
 90                               // 0 otherwise
 91     UnderflowExp       = 'M'// minimum exponent before (gradual) underflow
 92     UnderflowThreshold = 'U'// underflow threshold - Base**(UnderflowExp-1)
 93     OverflowExp        = 'L'// largest exponent before overflow
 94     OverflowThreshold  = 'O'  // overflow threshold - Base**OverflowExp*(1-Eps)
 95 };
 96 
 97 namespace BALANCE {
 98 
 99     enum Balance {
100         None        = 'N',
101         PermuteOnly = 'P',
102         ScaleOnly   = 'S',
103         Both        = 'B'
104     };
105 
106 }
107 
108 namespace SENSE {
109 
110     enum Sense {
111         None                  = 'N',
112         EigenvaluesOnly       = 'E',
113         InvariantSubspaceOnly = 'V',
114         Both                  = 'B'
115     };
116 
117 }
118 
119 } } // namespace lapack, flens
120 
121 #endif // FLENS_LAPACK_TYPEDEFS_H