Rev 42313 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
c-----------------------------------------------------------------------cc R : A Computer Langage for Statistical Data Analysisc Copyright (C) 1996, 1997 Robert Gentleman and Ross Ihakac Copyright (C) 2001 The R Development Core Teamcc This program is free software; you can redistribute it and/or modifyc it under the terms of the GNU General Public License as published byc the Free Software Foundation; either version 2 of the License, orc (at your option) any later version.cc This program is distributed in the hope that it will be useful,c but WITHOUT ANY WARRANTY; without even the implied warranty ofc MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See thec GNU General Public License for more details.cc You should have received a copy of the GNU General Public Licensec along with this program; if not, a copy is available atc http://www.r-project.org/Licenses/cc-----------------------------------------------------------------------cc chol performs the choleski decomposition of a symmetricc positive-definite matrix. this is just a wrapper for thec linpack routine dpofa.cc on entrycc a double precision(lda,n)c the upper triangle of the matrix to be factorizedc is contained in the upper triangle of a.cc lda integerc the leading dimension of a.cc n integerc the number or rows and columns of the matrixc to be factorized.cc on returncc v double precision(n,n)c the square-root (choleski) factor.cc info integerc the error indicator from dpofa. this will bec zero unless the matrix being factorized isc not positive definite.cc this version dated aug 25, 1996.c ross ihaka, university of auckland.csubroutine chol(a, lda, n, v, info)c implicit noneinteger n, lda, infodouble precision a(lda, n), v(n,n)integer i, jcdo 20 i = 1,ndo 10 j = 1,nif(i .gt. j) thenv(i,j) = 0.0d0elsev(i,j) = a(i,j)end if10 continue20 continuecall dpofa(v, n, n, info)returnend