[gmx-users] Normal Mode Analysis
Berk Hess
gmx3 at hotmail.com
Tue May 26 13:31:46 CEST 2009
Hi,
I just saw that 4.0 uses a new mtx format which can also efficiently store sparse matrices.
Please try if my modified gmxdump for 4.0.5 works?
Store the data below in a file called fix and then do:
patch gmxdump.c fix
Berk
61a62,63
> #include "sparsematrix.h"
> #include "mtxio.h"
364a367,402
> static void list_mtx(char *fn)
> {
> int nrow,ncol,i,j,k;
> real *full=NULL,value;
> gmx_sparsematrix_t * sparse=NULL;
>
> gmx_mtxio_read(fn,&nrow,&ncol,&full,&sparse);
>
> if (full == NULL) {
> snew(full,nrow*ncol);
> for(i=0;i<nrow*ncol;i++) {
> full[i] = 0;
> }
>
> for(i=0;i<sparse->nrow;i++) {
> for(j=0;j<sparse->ndata[i];j++) {
> k = sparse->data[i][j].col;
> value = sparse->data[i][j].value;
> full[i*ncol+k] = value;
> full[k*ncol+i] = value;
> }
> }
> gmx_sparsematrix_destroy(sparse);
> }
>
> printf("%d %d\n",nrow,ncol);
> for(i=0; i<nrow; i++) {
> for(j=0; j<ncol; j++) {
> printf(" %g",full[i*ncol+j]);
> }
> printf("\n");
> }
>
> sfree(full);
> }
>
381a420
> { efMTX, "-mtx", "hessian", ffOPTRD },
409a449,450
> else if (ftp2bSet(efMTX,NFILE,fnm))
> list_mtx(ftp2fn(efMTX,NFILE,fnm));
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20090526/7b68a0ff/attachment.html>
More information about the gromacs.org_gmx-users
mailing list