*/
Stuck? Need help? Ask questions on our forums.
*/

View \MATDUMP.C

LPC-PARCOR-CEPSTRUM Generator for C Programmers version 0.5b

Submitted By: Unknown
Rating: (Not rated) (Rate It)


/*
*-----------------------------------------------------------------------------
*       file:  matdump.c
*       desc:  matrix mathematics - object dump
*       by:    ko shu pui, patrick
*       date:  24 nov 91 v0.1
*       revi:  14 may 92 v0.2
*       ref:
*       [1] Mary L.Boas, "Mathematical Methods in the Physical Sciene,"
*       John Wiley & Sons, 2nd Ed., 1983. Chap 3.
*
*       [2] Kendall E.Atkinson, "An Introduction to Numberical Analysis,"
*       John Wiley & Sons, 1978.
*
*-----------------------------------------------------------------------------
*/

#include <stdio.h>
#include "matrix.h"

/*
*-----------------------------------------------------------------------------
*       funct: mat_dump
*       desct: dump a matrix
*       given: A = matrice to dumped
*       retrn: nothing
*       comen: matrix a dumped to standard output
*-----------------------------------------------------------------------------
*/

MATRIX mat_dump( A )
MATRIX A;
{
        int     i, j;

        for (i=0; i<MatRow(A); i++)
                {
                for (j=0; j<MatCol(A); j++)
                        {
                        fprintf( stdout, "%f ", A[i][j] );
                        }
                fprintf( stdout, "\n" );
                }

        return (A);
}

MATRIX mat_fdump( A, fp )
MATRIX A;
FILE *fp;
{
        int     i, j;

        if (fp==NULL)
                return ((MATRIX)mat_error( MAT_FNOTOPEN ));

        for (i=0; i<MatRow(A); i++)
                {
                for (j=0; j<MatCol(A); j++)
                        {
                        fprintf( fp, "%f ", A[i][j]);
                        }
                fprintf( fp, "\n" );
                }

        return (A);
}

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.