/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:31:21 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "smatpr.h" #include /* PARAMETER translations */ #define MACT1D 9 #define MECONT 50 #define MEFMAT 62 #define MEMLIN 13 #define MEMUNI 15 #define MERET 51 #define METDIG 22 #define MSTOR 4 /* end of PARAMETER translations */ void /*FUNCTION*/ smatpr( float *a, long idima, long m, long n, char *text, long lwidth, long lunit, long numdig) { #define A(I_,J_) (*(a+(I_)*(idima)+(J_))) char ttext[1][3]; long int k, mact[9]; static long mact1[MACT1D]={METDIG,0,MEFMAT,0,0,0,0,0,MERET}; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const Mact = &mact[0] - 1; long *const Mact1 = &mact1[0] - 1; /* end of OFFSET VECTORS */ /* Copyright (c) 1996 California Institute of Technology, Pasadena, CA. * ALL RIGHTS RESERVED. * Based on Government Sponsored Research NAS7-03001. *>> 2000-12-01 SMATPR Krogh Removed unused parameter METXTF. *>> 1994-11-11 SMATPR Krogh Declared all vars. *>> 1994-10-20 SMATPR Krogh Added M77CON code. *>> 1992-05-03 SMATPR Krogh Convert to use MESSFT for Fortran text. *>> 1992-04-08 SMATPR Krogh Replaced dummy K with MACT in ?MESS calls. *>> 1991-11-22 SMATPR F. Krogh Initial code * *++I DEFAULT MSTOR=2, MACT1D=7, TAIL=", LUNIT" *++ DEFAULT MSTOR=4, MACT1D=9, TAIL=", LUNIT, NUMDIG" *++ REPLACE ", LUNIT, NUMDIG" = TAIL *--S replaces "?": ?MATPR, ?MESS * * All versions require MESS and MESSFT which is in MESS. * * ***** Formal Arguments *********************************** * * A Matrix to be output, A = A(I,J), I = 1, M; J = 1, N * IDIMA Declared row dimension of A * N Number of columns in the matrix. * M Number of rows in the matrix. * TEXT a variable length character type that gives a message to print. * LWIDTH Line width in characters. If this or any of the following * parameter are < 0, then current defaults set in MESS are used. * LUNIT Logical unit number. (0 prints to the standard output.) * NUMDIG Number of significant digits to print (not used in integer). * * ******************** Parameter for interfacing to MESS ************* * */ /*++ Substitute for MACT1D, MSTOR below */ /*--S Next line special: I */ /*++ Code for {I} is inactive * integer MEIMAT * parameter (MEIMAT = 58) * data MACT1 / MEIMAT, 0, 0, 0, 0 ,0, MERET / *++ Code for ~{I} is active */ Mact1[2] = max( 0, numdig ); /*++ End */ Mact1[MSTOR] = idima; Mact1[MSTOR + 1] = max( m, 0 ); Mact1[MSTOR + 2] = max( n, 0 ); k = 1; if (lwidth > 20) { Mact[1] = -MEMLIN; Mact[3] = MEMLIN; Mact[4] = lwidth; k = 5; } if (lunit >= 0) { Mact[k] = -MEMUNI; Mact[k + 2] = MEMUNI; Mact[k + 3] = lunit; k += 4; } Mact[k] = MECONT; messft( mact, text ); /*++ Code for {I} is inactive * call MESS(MACT1, TTEXT, A) *++ Code for ~{I} is active */ smess( mact1, (char*)ttext,3, mact, a ); /*++ End */ if (Mact[1] < 0) { /* Restore MESS parameters to original state */ Mact[1] = -Mact[1]; Mact[3] = MERET; if (Mact[5] < 0) { Mact[3] = MEMUNI; Mact[4] = Mact[6]; Mact[5] = MERET; } mess( mact, (char*)ttext,3, mact ); } return; #undef A } /* end of function */