00001 /*---------------------------------------------------------------------------- 00002 Sparse QR solver for linear systems of equations or least squares problems 00003 Copyright (C) 1996, Thomas H. Robey 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 00019 Inquiries can be directed to trobey@arc.unm.edu or 00020 00021 Thomas H. Robey 00022 925 Madison NE 00023 Albuquerque, NM 87110 00024 USA 00025 ----------------------------------------------------------------------------*/ 00026 00027 #ifndef fill_hh 00028 #define fill_hh 00029 00030 #include <cstddef> 00031 00032 namespace sparseqr { 00033 00038 class Fill { 00039 public: 00040 int CalcFill(Smatrix *,Smatrix *); 00041 Fill(Smatrix *,int); 00042 ~Fill(); 00043 void IndexSort(QR *,int *,int); 00044 void Init(QR *,int); 00045 void Merge(QR *qr); 00046 void PivotFill(QR *qr) { 00047 for (int i=0;i<nlist2;i++) 00048 pairfill[sortindex2[i]]=CalcFill(qr->srow[row1[sortindex2[i]]], 00049 qr->srow[row2[sortindex2[i]]]); 00050 }; 00051 void Update(int,int); 00052 int friend QR::sparseqr(); 00053 private: 00054 int nlist1,nlist2; 00055 int *sortindex1,*sortindex2,*row1,*row2,*pairfill,*rindex; 00056 }; 00057 00058 } 00059 00060 #endif // fill_hh