chiark / gitweb /
Fix some errors.
[storin] / matrix.h
CommitLineData
e6e0e332
MW
1/* -*-c-*-
2 *
3 * $Id: matrix.h,v 1.1 2000/05/21 11:28:30 mdw Exp $
4 *
5 * Matrix arithmetic mod %$2^{24}$%
6 *
7 * (c) 2000 Mark Wooding
8 */
9
10/*----- Licensing notice --------------------------------------------------*
11 *
12 * Copyright (c) 2000 Mark Wooding
13 * All rights reserved.
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions are
17 * met:
18 *
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 *
22 * 2, Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * 3. The name of the authors may not be used to endorse or promote
27 * products derived from this software without specific prior written
28 * permission.
29 *
30 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
31 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
33 * NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
34 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
35 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
38 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
39 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 * POSSIBILITY OF SUCH DAMAGE.
41 *
42 * Instead of accepting the above terms, you may redistribute and/or modify
43 * this software under the terms of either the GNU General Public License,
44 * or the GNU Library General Public License, published by the Free
45 * Software Foundation; either version 2 of the License, or (at your
46 * option) any later version.
47 */
48
49/*----- Revision history --------------------------------------------------*
50 *
51 * $Log: matrix.h,v $
52 * Revision 1.1 2000/05/21 11:28:30 mdw
53 * Initial check-in.
54 *
55 */
56
57#ifndef MATRIX_H
58#define MATRIX_H
59
60#ifdef __cplusplus
61 extern "C" {
62#endif
63
64/*----- Header files ------------------------------------------------------*/
65
66#ifndef BITS_H
67# include "bits.h"
68#endif
69
70/*----- Functions provided ------------------------------------------------*/
71
72/* --- @matmul@ --- *
73 *
74 * Arguments: @uint24 *d@ = pointer to destination matrix
75 * @uint24 *a, *b@ = pointer to operand matrices
76 * @unsigned x, y, z@ = dimensions of the operand matrices
77 *
78 * Returns: ---
79 *
80 * Use: Performs matrix multiplication mod %$2^{24}$%. The matrix
81 * @d@ may not overlap either operand matrix.
82 */
83
84extern void matmul(uint24 */*d*/, const uint24 */*a*/, const uint24 */*b*/,
85 unsigned /*x*/, unsigned /*y*/, unsigned /*z*/);
86
87/* --- @matinv@ --- *
88 *
89 * Arguments: @uint24 *d@ = pointer to destination matrix
90 * @uint24 *a@ = pointer to operand matrix
91 * @unsigned x, y@ = dimensions of operand matrix
92 *
93 * Returns: Zero if the matrix was successfully inverted, %$-1$% if the
94 * matrix is singular.
95 *
96 * Use: Computes the mod %$2^{24}$% inverse of a square matrix.
97 */
98
99extern int matinv(uint24 */*d*/, uint24 */*a*/,
100 unsigned /*x*/, unsigned /*y*/);
101
102/*----- That's all, folks -------------------------------------------------*/
103
104#ifdef __cplusplus
105 }
106#endif
107
108#endif