- added backwards calculation of hkl from four circle angles. This
required inclusion of a matrix package. - modified counter error handling to send a Stop when the _BAD_BUSY error is received. - added an environment interface to the general controller stuff in choco.* Also added setting a parameter directly at the controller object. - Added a driver for the ETH High Temperature Furnace to be used at SANS.
This commit is contained in:
78
matrix/matdump.c
Normal file
78
matrix/matdump.c
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
*-----------------------------------------------------------------------------
|
||||
* 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;
|
||||
{
|
||||
return(mat_fdumpf(A, "%f ", stdout));
|
||||
}
|
||||
|
||||
/*
|
||||
*-----------------------------------------------------------------------------
|
||||
* funct: mat_dumpf
|
||||
* desct: dump a matrix with format string to standard output
|
||||
* given: A = matrice to dumped
|
||||
* retrn: nothing
|
||||
* comen: matrix a dumped to standard output
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
MATRIX mat_dumpf( A, s )
|
||||
MATRIX A;
|
||||
char *s;
|
||||
{
|
||||
return (mat_fdumpf(A, s, stdout));
|
||||
}
|
||||
|
||||
MATRIX mat_fdump( A, fp )
|
||||
MATRIX A;
|
||||
FILE *fp;
|
||||
{
|
||||
return (mat_fdumpf(A, "%f ", fp));
|
||||
}
|
||||
|
||||
MATRIX mat_fdumpf( A, s, fp )
|
||||
MATRIX A;
|
||||
char *s;
|
||||
FILE *fp;
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i=0; i<MatRow(A); i++)
|
||||
{
|
||||
for (j=0; j<MatCol(A); j++)
|
||||
{
|
||||
fprintf( fp, s, A[i][j] );
|
||||
}
|
||||
fprintf( fp, "\n" );
|
||||
}
|
||||
|
||||
return (A);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user