/[escript]/trunk/finley/src/Util.h
ViewVC logotype

Contents of /trunk/finley/src/Util.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1388 - (show annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 9 months ago) by trankine
File MIME type: text/plain
File size: 2941 byte(s)
And get the *(&(*&(* name right
1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 /**************************************************************/
17
18 /* Some utility routines: */
19
20 /**************************************************************/
21
22 #ifndef INC_FINLEY_UTIL
23 #define INC_FINLEY_UTIL
24
25 #include "Finley.h"
26
27 /**************************************************************/
28
29 void Finley_Util_Gather_double(dim_t len,index_t* index,dim_t numData,double* in,double * out);
30 void Finley_Util_Gather_int(dim_t len,index_t* index,dim_t numData,index_t* in,index_t * out);
31 void Finley_Util_AddScatter(dim_t len,index_t* index,dim_t numData,double* in,double * out, index_t bound);
32 void Finley_Util_SmallMatMult(dim_t A1,dim_t A2, double* A, dim_t B2, double*B, double* C);
33 void Finley_Util_SmallMatSetMult(dim_t len,dim_t A1,dim_t A2, double* A, dim_t B2, double*B, double* C);
34 void Finley_Util_InvertSmallMat(dim_t len,dim_t dim,double* A,double *invA, double* det);
35 void Finley_Util_DetOfSmallMat(dim_t len,dim_t dim,double* A,double* det);
36 void Finley_NormalVector(dim_t len, dim_t dim, dim_t dim1, double* A,double* Normal);
37 void Finley_LengthOfNormalVector(dim_t len, dim_t dim, dim_t dim1, double* A,double* length);
38 void Finley_Util_InvertMap(dim_t, index_t*,dim_t, index_t*);
39 index_t Finley_Util_getMaxInt(dim_t dim,dim_t N,index_t* values);
40 index_t Finley_Util_getMinInt(dim_t dim,dim_t N,index_t* values);
41 index_t Finley_Util_getFlaggedMaxInt(dim_t dim,dim_t N,index_t* values,index_t ignore);
42 index_t Finley_Util_getFlaggedMinInt(dim_t dim,dim_t N,index_t* values,index_t ignore);
43 dim_t Finley_Util_packMask(dim_t N,bool_t* mask,index_t* index);
44 bool_t Finley_Util_isAny(dim_t N,index_t* array,index_t value);
45 index_t Finley_Util_cumsum(dim_t,index_t*);
46 bool_t Finley_Util_anyNonZeroDouble(dim_t N,double* values);
47
48 #ifdef PASO_MPI
49 void Finley_printDoubleArray( FILE *fid, dim_t n, double *array, char *name );
50 void Finley_printIntArray( FILE *fid, dim_t n, int *array, char *name );
51 void Finley_printMaskArray( FILE *fid, dim_t n, int *array, char *name );
52 #endif
53
54
55
56 /* Finley_Util_orderValueAndIndex is used to sort items by a value */
57 /* index points to the location of the original item array. */
58 /* it can be used to reorder the array */
59 struct Finley_Util_ValueAndIndex {
60 index_t index;
61 index_t value;
62 };
63 typedef struct Finley_Util_ValueAndIndex Finley_Util_ValueAndIndex;
64
65 void Finley_Util_sortValueAndIndex(dim_t n,Finley_Util_ValueAndIndex* array);
66 int Finley_Util_ValueAndIndex_compar(const void *, const void *);
67
68 #endif /* #ifndef INC_FINLEY_UTIL */
69

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26