Diana  0.8.3
MA48.hpp
00001 /* -----------------------------------------------------------------------------
00002  *  Diana process modelling, simulation and analysis software
00003  *  Copyright (c) 2005, Michael Krasnyk
00004  *  All rights reserved.
00005 
00006  *  This file is a part of Diana process modelling, simulation and analysis software
00007 
00008  *  Diana is free software; you can redistribute it and/or modify it
00009  *  under the terms of the GNU General Public License as published
00010  *  by the Free Software Foundation (see accompanying file LICENSE)
00011  * -----------------------------------------------------------------------------
00012  *  $Id: MA48.hpp 8160 2009-03-16 18:36:30Z miha $
00013  * -----------------------------------------------------------------------------
00014  *  Description:
00015  */
00016 
00017 #ifndef MA48__HPP
00018 #define MA48__HPP
00019 
00020 #include "Fortran.hpp"
00021 
00022 typedef enum _MA48Cntl{
00023   MA48Cntl_SparseSwitch = 0,
00024   MA48Cntl_PivotingThreshold,
00025   MA48Cntl_DroppingThreshold,
00026   MA48Cntl_ZeroThreshold,
00027   MA48Cntl_ConvergenceMonitor,
00028   MA48Cntl_Size,
00029 }MA48Cntl;
00030 
00031 typedef enum _MA48Icntl{
00032   MA48Icntl_ErrorUnit = 0,
00033   MA48Icntl_WarningUnit,
00034   MA48Icntl_OutputLevel,
00035   MA48Icntl_MaxPivotColumns,
00036   MA48Icntl_BLASLevel,
00037   MA48Icntl_MinSizeBTF,
00038   MA48Icntl_StructRankDefMatrix,
00039   MA48Icntl_RestrPivotSequence,
00040   MA48Icntl_NumRefinementIter,
00041   MA48Icntl_Size,
00042 }MA48Icntl;
00043 
00044 typedef enum _MA48Info{
00045   MA48Info_Status = 0,
00046   MA48Info_SpaceAllocMonitor,
00047   MA48Info_MinLA,
00048   MA48Info_DecompMinLA,
00049   MA48Info_MatrixRank,
00050   MA48Info_NumDroppedEntries,
00051   MA48Info_LargestNonTriangBlockOrder,
00052   MA48Info_NonTriangBlockOrderSum,
00053   MA48Info_NumEntries,
00054   MA48Info_MatrixStructuralRank,
00055   MA48Info_NumMultEntries,
00056   MA48Info_NumOutOfRangeEntries,
00057   MA48Info_Size,
00058 }MA48Info;
00059 
00060 typedef enum _MA48Error{
00061   MA48Error_LargestScaledResidual1 = 0,
00062   MA48Error_LargestScaledResidual2,
00063   MA48Error_Relative,
00064   MA48Error_Size,
00065 }MA48Error;
00066 
00067 typedef enum _MA48ADStatus{
00068   MA48Status_Success =  0,
00069 
00070   MA48Status_MorNless1 = -1,
00071   MA48Status_NEless1   = -2,
00072   MA48Status_LAtoSmall = -3,
00073   MA48Status_StructRankDeficient = -4,
00074   MA48Status_FaultyPermutation = -5,
00075   MA48Status_IncorrectJob = -6,
00076   MA48Status_UnsuitablePivotSequence = -7,
00077   MA48Status_IterRefinConvergError = -8,
00078   MA48Status_CalcMatrixNormsError = -9,
00079 
00080   MA48Status_MultyEntries = 1,
00081   MA48Status_MatrixRankDeficient = 2,
00082   MA48Status_NoPivotSequenceFromDiag = 4,
00083 }MA48ADStatus;
00084 
00085 // TODO: configuration of names (non-gcc mangling)
00086 #define MA48AD (ma48ad_)
00087 #define MA48BD (ma48bd_)
00088 #define MA48CD (ma48cd_)
00089 #define MA48ID (ma48id_)
00090 
00091 extern "C" {
00092   void MA48AD(const fortrani& m, const fortrani& n, const fortrani& ne, const fortrani& job,
00093               const fortrani& la, fortrand* a, fortrani* irn, fortrani* jcn, 
00094               fortrani* keep, const fortrand cntl[MA48Cntl_Size], const fortrani icntl[MA48Icntl_Size], 
00095               fortrani* iw, fortrani info[MA48Info_Size], fortrand& rinfo );
00096   
00097   void MA48BD(const fortrani& m, const fortrani& n, const fortrani& ne, const fortrani& job,
00098               const fortrani& la, fortrand* a, fortrani* irn, fortrani* jcn, 
00099               fortrani* keep, const fortrand cntl[MA48Cntl_Size], const fortrani icntl[MA48Icntl_Size],
00100               fortrand* w, fortrani* iw, fortrani info[MA48Info_Size], fortrand& rinfo);
00101   
00102   void MA48CD(const fortrani& m, const fortrani& n, const fortrani& trans, const fortrani& job,
00103               const fortrani& la, const fortrand* a, const fortrani* irn, const fortrani* keep, 
00104               const fortrand cntl[MA48Cntl_Size], const fortrani icntl[MA48Icntl_Size], 
00105               fortrand* rhs, fortrand* x, fortrand error[MA48Error_Size], fortrand* w, fortrani* iw, 
00106               fortrani info[MA48Info_Size]);
00107   
00108   void MA48ID(fortrand cntl[MA48Cntl_Size], fortrani icntl[MA48Icntl_Size]);
00109 };
00110 
00111 #endif // MA48__HPP