XC Open source finite element analysis program
utility.h
1 /*
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis Claudio Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 */
29 /*
30  * File: utility.h
31  * ================
32  * This file contains the interface to the utility routines implemented in
33  * utility.c.
34  *
35  * Originally written by: David R. Mackay
36  *
37  * Modified by:
38  * Jun Peng (junpeng@stanford.edu)
39  * Prof. Kincho H. Law
40  * Stanford University
41  * --------------------
42  */
43 
44 #ifndef UTILITY_H
45 #define UTILITY_H
46 
47 /*
48  * Function: clear_real
49  * =====================
50  * Arguments: array => array of real's to be cleared to 0's
51  * n => length of "array"
52  * Return Values: none
53  * Notes:
54  * Used in ... main.c
55  */
56 void clear_real(double *array, int n);
57 
58 
59 /*
60  * Function: dot_real
61  * ===================
62  *
63  * Notes: Program to dot a vector with a vector.
64  * Used in ... newsub.c, nmat.c
65  */
66 double dot_real( double *vect_1, double *vect_2, int n );
67 
68 
69 /*
70  * Function: i_greater
71  * ====================
72  *
73  * Used in ... nest.c
74  */
75 int i_greater( int *p1, int *p2 );
76 
77 
78 /*
79  * Function: zeroi
80  * ================
81  *
82  * Used in ... grcm.c, nest.c, newadj.c, newordr.c, nnsim.c
83  */
84 void zeroi( int n, int *v );
85 
86 
87 /*
88  * Function: minoni
89  * =================
90  *
91  * Used in ... newordr.c
92  */
93 void minoni( int n, int *v );
94 
95 
96 /*
97  * Function: saxpy
98  * ================
99  *
100  * Notes: v1 = v1 + alpha*v2
101  * Used in ... nmat.c
102  */
103 void saxpy( double *v1, double *v2, double alpha, int n );
104 
105 
106 /*
107  * Function: copyi
108  * ================
109  *
110  * Used in ... newadj.c
111  */
112 void copyi( int n, int *from, int *to );
113 
114 
115 /*
116  * Function: rcomp
117  * ================
118  *
119  * Used in ... main.c
120  */
121 int rcomp( double *p1, double *p2 );
122 
123 
124 
125 /* UNUSED FUNCTIONS */
126 /*
127  * Function: move_real
128  * ====================
129  * Arguments: from => source array of real's
130  * to => destination array of real's
131  * n => length of array "to"
132  * Return Values: none
133  * Notes:
134  */
135 void move_real(double *from, double *to, int n);
136 
137 int icomp( int *p1, int *p2 );
138 int fcomp( float *p1, float *p2 );
139 
140 
141 #endif
142