/* @(#)covsrt.c 17.1.1.1 (ES0-DMD) 01/25/02 17:26:58 */ /*=========================================================================== Copyright (C) 1995 European Southern Observatory (ESO) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, MA 02139, USA. Corresponding concerning ESO-MIDAS should be addressed as follows: Internet e-mail: midas@eso.org Postal address: European Southern Observatory Data Management Division Karl-Schwarzschild-Strasse 2 D 85748 Garching bei Muenchen GERMANY ===========================================================================*/ /* @(#)covsrt.c 17.1.1.1 (ESO) 01/25/02 17:26:58 */ void covsrt(covar,ma,lista,mfit) double **covar; int ma,lista[],mfit; { int i,j; double swap; for (j=1;j lista[i]) covar[lista[j]][lista[i]]=covar[i][j]; else covar[lista[i]][lista[j]]=covar[i][j]; } swap=covar[1][1]; for (j=1;j<=ma;j++) { covar[1][j]=covar[j][j]; covar[j][j]=0.0; } covar[lista[1]][lista[1]]=swap; for (j=2;j<=mfit;j++) covar[lista[j]][lista[j]]=covar[1][j]; for (j=2;j<=ma;j++) for (i=1;i<=j-1;i++) covar[i][j]=covar[j][i]; }