SortedList_dh.h

00001 /*@HEADER
00002 // ***********************************************************************
00003 //
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2009) 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 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 //@HEADER
00028 */
00029 
00030 #ifndef SORTEDLIST_DH_H
00031 #define SORTEDLIST_DH_H
00032 
00033 /* for private use by mpi factorization algorithms */
00034 
00035 #include "euclid_common.h"
00036 #ifdef __cplusplus
00037 extern "C"
00038 {
00039 #endif
00040 
00041   typedef struct _srecord
00042   {
00043     int col;
00044     int level;
00045     double val;
00046     int next;
00047   } SRecord;
00048 
00049 
00050   extern void SortedList_dhCreate (SortedList_dh * sList);
00051   extern void SortedList_dhDestroy (SortedList_dh sList);
00052   extern void SortedList_dhInit (SortedList_dh sList, SubdomainGraph_dh sg);
00053   extern void SortedList_dhEnforceConstraint (SortedList_dh sList,
00054                           SubdomainGraph_dh sg);
00055 
00056   extern void SortedList_dhReset (SortedList_dh sList, int row);
00057 
00058   extern int SortedList_dhReadCount (SortedList_dh sList);
00059   /* returns number of records inserted since last reset */
00060 
00061   extern void SortedList_dhResetGetSmallest (SortedList_dh sList);
00062   /* resets index used for SortedList_dhGetSmallestLowerTri().
00063    */
00064 
00065   extern SRecord *SortedList_dhGetSmallest (SortedList_dh sList);
00066   /* returns record with smallest column value that hasn't been
00067      retrieved via this method since last call to SortedList_dhReset()
00068      or SortedList_dhResetGetSmallest().
00069      If all records have been retrieved, returns NULL.
00070    */
00071 
00072   extern SRecord *SortedList_dhGetSmallestLowerTri (SortedList_dh sList);
00073   /* returns record with smallest column value that hasn't been
00074      retrieved via this method since last call to reset.  
00075      Only returns records where SRecord sr.col < row (per Init).
00076      If all records have been retrieved, returns NULL.
00077    */
00078 
00079   extern void SortedList_dhInsert (SortedList_dh sList, SRecord * sr);
00080   /* unilateral insert (does not check to see if item is already
00081      in list); does not permute sr->col; used in numeric
00082      factorization routines.
00083    */
00084 
00085   extern void SortedList_dhInsertOrUpdateVal (SortedList_dh sList,
00086                           SRecord * sr);
00087   /* unilateral insert: does not check to see if already
00088      inserted; does not permute sr->col; used in numeric 
00089      factorization routines.
00090    */
00091 
00092   extern bool SortedList_dhPermuteAndInsert (SortedList_dh sList,
00093                          SRecord * sr, double thresh);
00094   /* permutes sr->col, and inserts record in sorted list.
00095      Note: the contents of the passed variable "sr" may be changed.
00096      Note: this performs sparsification 
00097    */
00098 
00099 
00100   extern void SortedList_dhInsertOrUpdate (SortedList_dh sList, SRecord * sr);
00101   /* if a record with identical sr->col was inserted, updates sr->level
00102      to smallest of the two values; otherwise, inserts the record.
00103      Unlike SortedList_dhPermuteAndInsert, does not permute sr->col.
00104      Note: the contents of the passed variable "sr" may be changed.
00105      Warning: do not call SortedList_dhGetSmallestLowerTri() again
00106      until reset is called.
00107    */
00108 
00109   extern SRecord *SortedList_dhFind (SortedList_dh sList, SRecord * sr);
00110   /* returns NULL if no record is found containing sr->col 
00111    */
00112 
00113   extern void SortedList_dhUpdateVal (SortedList_dh sList, SRecord * sr);
00114 #ifdef __cplusplus
00115 }
00116 #endif
00117 #endif
 All Classes Files Functions Variables Enumerations Friends
Generated on Wed Apr 13 10:05:23 2011 for IFPACK by  doxygen 1.6.3