! File: cxml_dss.f90
!
!  Copyright 2001 Compaq Computer Corporation
!
!  COMPAQ Registered in U.S. Patent and Trademark Office.
!
!  Confidential computer software.  Valid license from Compaq required for
!  possession, use or copying.  Consistent with FAR 12.211 and 12.212,
!  Commerical Computer Software, Computer Software Documentation, and
!  Technical Data for Commmerical Items are licensed to the U.S. Government
!  under vendor's standard commerical license.
!
!	Generated on: Mon Apr 02 15:59:26 2001
!
!


!DEC$ IF .NOT. DEFINED( __CXML_DSS_F90 )

!DEC$ DEFINE __CXML_DSS_F90 



!DEC$ IF .NOT. DEFINED( CXML_MAKE_MODULE )

      USE cxml_dss

!DEC$ ELSE

      MODULE cxml_dss_private
        TYPE CXML_DSS_HANDLE; INTEGER(KIND=4) dummy; END TYPE
      END MODULE cxml_dss_private

      MODULE cxml_dss

        USE cxml_dss_private

	INTEGER, PARAMETER :: CXML_DSS_DEFAULTS = 0

!
! Message level option definitions
!

	INTEGER(KIND=4), PARAMETER :: CXML_DSS_MSG_LVL_SUCCESS = -2147483647
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_MSG_LVL_DEBUG   = -2147483646
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_MSG_LVL_INFO    = -2147483645
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_MSG_LVL_WARNING = -2147483644
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_MSG_LVL_ERROR   = -2147483643
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_MSG_LVL_FATAL   = -2147483642

!
! Termination level option definitions
!

	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TERM_LVL_SUCCESS = 1073741832
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TERM_LVL_DEBUG   = 1073741840
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TERM_LVL_INFO    = 1073741848
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TERM_LVL_WARNING = 1073741856
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TERM_LVL_ERROR   = 1073741864
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TERM_LVL_FATAL   = 1073741872

!
! Structure option definitions
!

	INTEGER(KIND=4), PARAMETER :: CXML_DSS_SYMMETRIC           = 536870976
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_SYMMETRIC_STRUCTURE = 536871040
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_NON_SYMMETRIC       = 536871104

!
! Reordering option definitions
!

	INTEGER(KIND=4), PARAMETER :: CXML_DSS_AUTO_ORDER    = 268435520
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_MY_ORDER      = 268435584
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_OPTION1_ORDER = 268435648

!
! Factorization option definitions
!

	INTEGER(KIND=4), PARAMETER :: CXML_DSS_POSITIVE_DEFINITE           = 134217792
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_INDEFINITE                  = 134217856
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_HERMITIAN_POSITIVE_DEFINITE = 134217920
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_HERMITIAN_INDEFINITE        = 134217984

!
! Return status values
!

	INTEGER(KIND=4), PARAMETER :: CXML_DSS_SUCCESS         = 0
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_ZERO_PIVOT      = -1
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_OUT_OF_MEMORY   = -2
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_FAILURE         = -3
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_ROW_ERR         = -4
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_COL_ERR         = -5
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TOO_FEW_VALUES  = -6
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TOO_MANY_VALUES = -7
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_NOT_SQUARE      = -8
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_STATE_ERR       = -9
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_INVALID_OPTION  = -10
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_OPTION_CONFLICT = -11
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_MSG_LVL_ERR     = -12
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_TERM_LVL_ERR    = -13
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_STRUCTURE_ERR   = -14
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_REORDER_ERR     = -15
	INTEGER(KIND=4), PARAMETER :: CXML_DSS_VALUES_ERR      = -16

!
! Function prototypes for DSS routines
!

	INTERFACE
	  FUNCTION dss_create( handle, opt )
	    USE cxml_dss_private
	    TYPE(CXML_DSS_HANDLE), INTENT(OUT)   :: handle
	    INTEGER(KIND=4),       INTENT(IN)    :: opt
	    INTEGER(KIND=4)                      :: dss_create
	  END FUNCTION dss_create
	END INTERFACE

	INTERFACE
	  FUNCTION dss_define_structure( handle, opt, rowIndex, nRows, rCols, columns, nNonZeros )
	    USE cxml_dss_private
	    TYPE(CXML_DSS_HANDLE), INTENT(INOUT) :: handle
	    INTEGER(KIND=4),       INTENT(IN)    :: opt
	    INTEGER(KIND=4),       INTENT(IN)    :: nRows
	    INTEGER(KIND=4),       INTENT(IN)    :: rCols
	    INTEGER(KIND=4),       INTENT(IN)    :: nNonZeros
	    INTEGER(KIND=4),       INTENT(IN)    :: rowIndex( * ) ! * = min(nRows, nCols)+1
	    INTEGER(KIND=4),       INTENT(IN)    :: columns( * ) ! * = nNonZeros
	    INTEGER(KIND=4)                      :: dss_define_structure
	  END FUNCTION dss_define_structure
	END INTERFACE

	INTERFACE
	  FUNCTION dss_reorder( handle, opt, perm )
	    USE cxml_dss_private
	    TYPE(CXML_DSS_HANDLE), INTENT(INOUT) :: handle
	    INTEGER(KIND=4),       INTENT(IN)    :: opt
	    INTEGER(KIND=4),       INTENT(IN)    :: perm( * )
	    INTEGER(KIND=4)                      :: dss_reorder
	  END FUNCTION dss_reorder
	END INTERFACE

	INTERFACE
	  FUNCTION dss_factor_real( handle, opt, rValues )
	    USE cxml_dss_private
	    TYPE(CXML_DSS_HANDLE), INTENT(INOUT) :: handle
	    INTEGER(KIND=4),       INTENT(IN)    :: opt
	    REAL(KIND=8),          INTENT(IN)    :: rValues( * )
	    INTEGER(KIND=4)                      :: dss_factor_real
	  END FUNCTION dss_factor_real
	END INTERFACE

	INTERFACE
	  FUNCTION dss_factor_complex( handle, opt, rValues )
	    USE cxml_dss_private
	    TYPE(CXML_DSS_HANDLE), INTENT(INOUT) :: handle
	    INTEGER(KIND=4),       INTENT(IN)    :: opt
	    COMPLEX(KIND=8),       INTENT(IN)    :: rValues( * )
	    INTEGER(KIND=4)                      :: dss_factor_complex
	  END FUNCTION dss_factor_complex
	END INTERFACE

	INTERFACE
	  FUNCTION dss_solve_real( handle, opt, rRhsValues, nRhs, rSolValues )
	    USE cxml_dss_private
	    TYPE(CXML_DSS_HANDLE), INTENT(INOUT) :: handle
	    INTEGER(KIND=4),       INTENT(IN)    :: opt
	    INTEGER(KIND=4),       INTENT(IN)    :: nRhs
	    REAL(KIND=8),          INTENT(IN)    :: rRhsValues( * )
	    REAL(KIND=8),          INTENT(OUT)   :: rSolValues( * )
	    INTEGER(KIND=4)                      :: dss_solve_real
	  END FUNCTION dss_solve_real
	END INTERFACE

	INTERFACE
	  FUNCTION dss_solve_complex( handle, opt, rRhsValues, nRhs, rSolValues )
	    USE cxml_dss_private
	    TYPE(CXML_DSS_HANDLE), INTENT(INOUT) :: handle
	    INTEGER(KIND=4),       INTENT(IN)    :: opt
	    INTEGER(KIND=4),       INTENT(IN)    :: nRhs
	    COMPLEX(KIND=8),       INTENT(IN)    :: rRhsValues( * )
	    COMPLEX(KIND=8),       INTENT(OUT)   :: rSolValues( * )
	    INTEGER(KIND=4)                      :: dss_solve_complex
	  END FUNCTION dss_solve_complex
	END INTERFACE

	INTERFACE
	  FUNCTION dss_delete( handle, opt )
	    USE cxml_dss_private
	    TYPE(CXML_DSS_HANDLE), INTENT(IN)    :: handle
	    INTEGER(KIND=4),       INTENT(IN)    :: opt
	    INTEGER(KIND=4)                      :: dss_delete
	  END FUNCTION dss_delete
	END INTERFACE

      END MODULE cxml_dss


!DEC$ ENDIF


!DEC$ ENDIF

