- 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:
42
matrix/matsub.c
Normal file
42
matrix/matsub.c
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
*-----------------------------------------------------------------------------
|
||||
* file: matsub.c
|
||||
* desc: matrix substraction
|
||||
* by: ko shu pui, patrick
|
||||
* date: 24 nov 91 v0.1
|
||||
* revi:
|
||||
* ref:
|
||||
* [1] Mary L.Boas, "Mathematical Methods in the Physical Sciene,"
|
||||
* John Wiley & Sons, 2nd Ed., 1983. Chap 3.
|
||||
*
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "matrix.h"
|
||||
|
||||
/*
|
||||
*-----------------------------------------------------------------------------
|
||||
* funct: mat_sub
|
||||
* desct: subtraction of two matrice
|
||||
* given: A, B = compatible matrice to be added
|
||||
* retrn: NULL if malloc() fails
|
||||
* else allocated matrix of A - B
|
||||
* comen:
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
MATRIX mat_sub( A, B )
|
||||
MATRIX A, B;
|
||||
{
|
||||
int i, j;
|
||||
MATRIX C;
|
||||
|
||||
if ((C = mat_creat( MatRow(A), MatCol(A), UNDEFINED )) == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (i=0; i<MatRow(A); i++)
|
||||
for (j=0; j<MatCol(A); j++)
|
||||
{
|
||||
C[i][j] = A[i][j] - B[i][j];
|
||||
}
|
||||
return (C);
|
||||
}
|
Reference in New Issue
Block a user