~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/cca/ga_cca_classic/GlobalArray.cxx

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "gacca.h"
2
 
 
3
 
#define GA_DATA_TYPE     C_DBL
4
 
 
5
 
static int sTmpVar = 0;
6
 
 
7
 
 
8
 
/**
9
 
 * Constructors and Destructor of GlobalArray          
10
 
 */
11
 
 
12
 
 
13
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], char *arrayname,
14
 
                         int chunk[]) {
15
 
  mHandle = NGA_Create(type, ndim, dims, arrayname, chunk);
16
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
17
 
}
18
 
 
19
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], char *arrayname,
20
 
                         int block[], int maps[]) {
21
 
  mHandle = NGA_Create_irreg(type, ndim, dims, arrayname, block, maps);
22
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
23
 
}
24
 
 
25
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], int width[], 
26
 
                             char *arrayname, int chunk[], char ghosts) {
27
 
  mHandle = NGA_Create_ghosts(type, ndim, dims, width, arrayname, chunk);
28
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
29
 
}
30
 
 
31
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], int width[], 
32
 
                             char *arrayname, int block[], int maps[], 
33
 
                             char ghosts) {
34
 
  mHandle = NGA_Create_ghosts_irreg(type, ndim, dims, width, arrayname, block, 
35
 
                                    maps);
36
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
37
 
}
38
 
 
39
 
GA::GlobalArray::GlobalArray(const GA::GlobalArray &g_a, char *arrayname) {
40
 
  mHandle = GA_Duplicate(g_a.mHandle, arrayname);
41
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
42
 
}
43
 
 
44
 
GA::GlobalArray::GlobalArray(const GA::GlobalArray &g_a) {
45
 
  char temp_name[20];
46
 
  
47
 
  sprintf(temp_name, "tmpGA%d", sTmpVar++);
48
 
  mHandle = GA_Duplicate(g_a.mHandle, temp_name);
49
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
50
 
  GA_Copy(g_a.mHandle, mHandle);
51
 
}
52
 
 
53
 
GA::GlobalArray::GlobalArray() {
54
 
  char temp_name[20];
55
 
  int n_dim;
56
 
  int *dimensions;
57
 
  
58
 
  sprintf(temp_name, "tmpGA%d", sTmpVar++);
59
 
  n_dim = DEF_NDIM;
60
 
  dimensions = new int [n_dim];    
61
 
  for(int i=0; i<n_dim; i++) dimensions[i] = DEF_DIMS;
62
 
  mHandle = NGA_Create(GA_DATA_TYPE, n_dim, dimensions, temp_name, NULL);
63
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
64
 
  //free(dimensions);
65
 
  delete[] dimensions;
66
 
}
67
 
 
68
 
GA::GlobalArray::~GlobalArray() {
69
 
 
70
 
}
71
 
 
72
 
 
73
 
/*********************************************************************
74
 
 *          Member functions of GA::GlobalArray                          *
75
 
 *********************************************************************/
76
 
 
77
 
void 
78
 
GA::GlobalArray::acc(int lo[], int hi[], void *buf, int ld[], void *alpha) const {
79
 
  NGA_Acc(mHandle, lo, hi, buf, ld, alpha);
80
 
}
81
 
 
82
 
void 
83
 
GA::GlobalArray::access(int lo[], int hi[], void *ptr, int ld[]) const {
84
 
  NGA_Access(mHandle, lo, hi, ptr, ld);
85
 
}
86
 
 
87
 
void 
88
 
GA::GlobalArray::accessGhosts(int dims[], void *ptr, int ld[]) const {
89
 
  NGA_Access_ghosts(mHandle, dims, ptr, ld);
90
 
}
91
 
 
92
 
void 
93
 
GA::GlobalArray::accessGhostElement(void *ptr, int subscript[], int ld[]) const {
94
 
  NGA_Access_ghost_element(mHandle, ptr, subscript, ld);
95
 
}
96
 
 
97
 
void 
98
 
GA::GlobalArray::add(void *alpha, const GA::GlobalArray * g_a, 
99
 
                     void *beta,  const GA::GlobalArray * g_b) const {
100
 
  GA_Add(alpha, g_a->mHandle, beta, g_b->mHandle, mHandle);
101
 
102
 
 
103
 
void  
104
 
GA::GlobalArray::addPatch (void *alpha, 
105
 
                           const GA::GlobalArray * g_a, int alo[], int ahi[],
106
 
                           void *beta,  
107
 
                           const GA::GlobalArray * g_b, int blo[], int bhi[],
108
 
                           int clo[], int chi[]) const {
109
 
  NGA_Add_patch(alpha, g_a->mHandle, alo, ahi, beta, 
110
 
                g_b->mHandle, blo, bhi, mHandle, clo, chi);
111
 
}
112
 
 
113
 
void  
114
 
GA::GlobalArray::checkHandle(char* string) const {
115
 
  GA_Check_handle(mHandle, string);
116
 
}
117
 
 
118
 
int 
119
 
GA::GlobalArray::compareDistr(const GA::GlobalArray *g_a) const {
120
 
  return GA_Compare_distr(mHandle, g_a->mHandle);
121
 
}
122
 
 
123
 
void 
124
 
GA::GlobalArray::copy(const GA::GlobalArray *g_a) const {
125
 
  GA_Copy(g_a->mHandle, mHandle);
126
 
}
127
 
 
128
 
void 
129
 
GA::GlobalArray::copyPatch(char trans, const GA::GlobalArray* ga, int alo[], 
130
 
                           int ahi[], int blo[], int bhi[]) const {
131
 
  NGA_Copy_patch(trans, ga->mHandle, alo, ahi, mHandle, blo, bhi);
132
 
}
133
 
 
134
 
double 
135
 
GA::GlobalArray::ddot(const GA::GlobalArray * g_a) const {
136
 
  return GA_Ddot(mHandle, g_a->mHandle);
137
 
}
138
 
 
139
 
double 
140
 
GA::GlobalArray::ddotPatch(char ta, int alo[], int ahi[],
141
 
                           const GA::GlobalArray * g_a, char tb, 
142
 
                           int blo[], int bhi[]) const {
143
 
  return NGA_Ddot_patch(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
144
 
}
145
 
 
146
 
void 
147
 
GA::GlobalArray::destroy() const {
148
 
  GA_Destroy(mHandle);
149
 
}
150
 
 
151
 
void 
152
 
GA::GlobalArray::dgemm(char ta, char tb, int m, int n, int k, double alpha,  
153
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
154
 
                       double beta) const {
155
 
  GA_Dgemm(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
156
 
           beta, mHandle);
157
 
}
158
 
 
159
 
void 
160
 
GA::GlobalArray::diag(const GA::GlobalArray *g_s, GA::GlobalArray *g_v, 
161
 
                      void *eval) const {
162
 
  GA_Diag(mHandle, g_s->mHandle, g_v->mHandle, eval);
163
 
}
164
 
 
165
 
void 
166
 
GA::GlobalArray::diagReuse(int control, const GA::GlobalArray *g_s, 
167
 
                           GA::GlobalArray *g_v, void *eval) const {
168
 
  GA_Diag_reuse(control, mHandle, g_s->mHandle, g_v->mHandle, eval);
169
 
}
170
 
 
171
 
void 
172
 
GA::GlobalArray::diagStd(GlobalArray *g_v, void *eval) const {
173
 
  GA_Diag_std(mHandle, g_v->mHandle, eval);
174
 
}
175
 
 
176
 
void 
177
 
GA::GlobalArray::diagSeq(const GA::GlobalArray * g_s, 
178
 
                         const GA::GlobalArray * g_v, void *eval) const {
179
 
  GA_Diag_seq(mHandle, g_s->mHandle, g_v->mHandle, eval);
180
 
}
181
 
 
182
 
void 
183
 
GA::GlobalArray::diagStdSeq(const GA::GlobalArray * g_v, void *eval) const {
184
 
  GA_Diag_std_seq(mHandle, g_v->mHandle, eval);
185
 
}
186
 
 
187
 
void 
188
 
GA::GlobalArray::distribution(int me, int* lo, int* hi) const {
189
 
  NGA_Distribution(mHandle, me, lo, hi);
190
 
}
191
 
 
192
 
float 
193
 
GA::GlobalArray::fdot(const GA::GlobalArray * g_a) const {
194
 
  return GA_Fdot(mHandle, g_a->mHandle);
195
 
}
196
 
 
197
 
float 
198
 
GA::GlobalArray::fdotPatch(char t_a, int alo[], int ahi[], 
199
 
                           const GA::GlobalArray * g_b, char t_b, int blo[], 
200
 
                           int bhi[]) const {
201
 
  return NGA_Fdot_patch(mHandle, t_a, alo, ahi,
202
 
                        g_b->mHandle, t_b, blo, bhi);
203
 
}
204
 
 
205
 
void 
206
 
GA::GlobalArray::fill(void *value) const {
207
 
  GA_Fill(mHandle, value);
208
 
}
209
 
 
210
 
void 
211
 
GA::GlobalArray::fillPatch (int lo[], int hi[], void *val) const {
212
 
  NGA_Fill_patch(mHandle, lo, hi, val);
213
 
}
214
 
 
215
 
void 
216
 
GA::GlobalArray::gather(void *v, int * subsarray[], int n) const {
217
 
  NGA_Gather(mHandle, v, subsarray, n);
218
 
}
219
 
 
220
 
void 
221
 
GA::GlobalArray::get(int lo[], int hi[], void *buf, int ld[])  const {
222
 
  NGA_Get(mHandle, lo, hi, buf, ld);
223
 
}
224
 
 
225
 
int 
226
 
GA::GlobalArray::hasGhosts()  const {
227
 
  return GA_Has_ghosts(mHandle);
228
 
}
229
 
 
230
 
Integer 
231
 
GA::GlobalArray::idot(const GA::GlobalArray * g_a)  const {
232
 
  return GA_Idot(mHandle, g_a->mHandle);
233
 
}
234
 
 
235
 
long 
236
 
GA::GlobalArray::idotPatch(char ta, int alo[], int ahi[],
237
 
                           const GA::GlobalArray * g_a, char tb, 
238
 
                           int blo[], int bhi[])  const {
239
 
  return NGA_Idot_patch(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
240
 
}
241
 
 
242
 
void 
243
 
GA::GlobalArray::inquire(int *type, int *ndim, int dims[])  const {
244
 
  NGA_Inquire(mHandle, type, ndim, dims);
245
 
}
246
 
 
247
 
char* 
248
 
GA::GlobalArray::inquireName()  const {
249
 
  return GA_Inquire_name(mHandle);
250
 
}
251
 
 
252
 
long 
253
 
GA::GlobalArray::ldot(const GA::GlobalArray * g_a)  const {
254
 
  return GA_Ldot(mHandle, g_a->mHandle);
255
 
}
256
 
 
257
 
int 
258
 
GA::GlobalArray::lltSolve(const GA::GlobalArray * g_a)  const {
259
 
  return GA_Llt_solve(g_a->mHandle, mHandle);
260
 
}
261
 
 
262
 
int 
263
 
GA::GlobalArray::locate(int subscript[])  const {
264
 
  return NGA_Locate(mHandle, subscript);
265
 
266
 
 
267
 
int 
268
 
GA::GlobalArray::locateRegion(int lo[], int hi[], int map[], int procs[])  const {
269
 
  return NGA_Locate_region(mHandle, lo, hi, map, procs);
270
 
}
271
 
 
272
 
void 
273
 
GA::GlobalArray::luSolve(char trans, const GA::GlobalArray * g_a)  const {
274
 
  GA_Lu_solve(trans, g_a->mHandle, mHandle);
275
 
}
276
 
 
277
 
void 
278
 
GA::GlobalArray::matmulPatch(char transa, char transb, void* alpha, 
279
 
                             void *beta, const GA::GlobalArray *g_a, 
280
 
                             int ailo, int aihi, int ajlo, int ajhi,
281
 
                             const GA::GlobalArray *g_b, 
282
 
                             int bilo, int bihi, int bjlo, int bjhi,
283
 
                             int cilo, int cihi, int cjlo, int cjhi)  const {
284
 
  GA_Matmul_patch(transa, transb, alpha, beta, 
285
 
                  g_a->mHandle, ailo, aihi, ajlo, ajhi, 
286
 
                  g_b->mHandle, bilo, bihi, bjlo, bjhi, 
287
 
                  mHandle, cilo, cihi, cjlo, cjhi);
288
 
}
289
 
 
290
 
void 
291
 
GA::GlobalArray::matmulPatch(char transa, char transb, void* alpha, void *beta,
292
 
                             const GA::GlobalArray *g_a, int *alo, int *ahi,
293
 
                             const GA::GlobalArray *g_b, int *blo, int *bhi,
294
 
                             int *clo, int *chi)  const {
295
 
  NGA_Matmul_patch(transa, transb, alpha, beta, g_a->mHandle, alo, ahi, 
296
 
                  g_b->mHandle, blo, bhi, mHandle, clo, chi);
297
 
}
298
 
 
299
 
void 
300
 
GA::GlobalArray::nblock(int numblock[])  const {
301
 
  GA_Nblock(mHandle, numblock);
302
 
}
303
 
 
304
 
int 
305
 
GA::GlobalArray::ndim()  const {
306
 
  return GA_Ndim(mHandle);
307
 
}
308
 
 
309
 
void 
310
 
GA::GlobalArray::periodicAcc(int lo[], int hi[], void* buf, int ld[], 
311
 
                             void* alpha)  const {
312
 
  NGA_Periodic_acc(mHandle, lo, hi, buf, ld, alpha);
313
 
}
314
 
 
315
 
void 
316
 
GA::GlobalArray::periodicGet(int lo[], int hi[], void* buf, int ld[])  const {
317
 
  NGA_Periodic_get(mHandle, lo, hi, buf, ld);
318
 
}
319
 
 
320
 
void 
321
 
GA::GlobalArray::periodicPut(int lo[], int hi[], void* buf, int ld[])  const {
322
 
  NGA_Periodic_put(mHandle, lo, hi, buf, ld);
323
 
}
324
 
 
325
 
void 
326
 
GA::GlobalArray::print() const {
327
 
  GA_Print(mHandle);
328
 
}
329
 
 
330
 
void 
331
 
GA::GlobalArray::printDistribution() const {
332
 
  GA_Print_distribution(mHandle);
333
 
}
334
 
 
335
 
void 
336
 
GA::GlobalArray::printFile(FILE *file)  const {
337
 
  GA_Print_file(file, mHandle);
338
 
}
339
 
 
340
 
void 
341
 
GA::GlobalArray::printPatch(int* lo, int* hi, int pretty)  const {
342
 
  NGA_Print_patch(mHandle, lo, hi, pretty);   
343
 
}
344
 
 
345
 
void 
346
 
GA::GlobalArray::procTopology(int proc, int coord[])  const {
347
 
  NGA_Proc_topology(mHandle, proc, coord);
348
 
}
349
 
 
350
 
void 
351
 
GA::GlobalArray::put(int lo[], int hi[], void *buf, int ld[])  const {
352
 
  NGA_Put(mHandle, lo, hi, buf, ld);
353
 
}
354
 
 
355
 
long 
356
 
GA::GlobalArray::readInc(int subscript[], long inc)  const {
357
 
  return NGA_Read_inc(mHandle, subscript, inc);
358
 
}
359
 
 
360
 
void 
361
 
GA::GlobalArray::release(int lo[], int hi[])  const {
362
 
  NGA_Release(mHandle, lo, hi);
363
 
}
364
 
 
365
 
void 
366
 
GA::GlobalArray::releaseUpdate(int lo[], int hi[])  const {
367
 
  NGA_Release_update(mHandle, lo, hi);
368
 
}
369
 
 
370
 
void 
371
 
GA::GlobalArray::scale(void *value)  const { 
372
 
  GA_Scale(mHandle, value); 
373
 
}
374
 
 
375
 
void 
376
 
GA::GlobalArray::scalePatch (int lo[], int hi[], void *val)  const {
377
 
  NGA_Scale_patch(mHandle, lo, hi, val);
378
 
}
379
 
 
380
 
void 
381
 
GA::GlobalArray::scatter(void *v, int *subsarray[], int n)  const {
382
 
  NGA_Scatter(mHandle, v, subsarray, n);
383
 
}
384
 
 
385
 
int 
386
 
GA::GlobalArray::solve(const GA::GlobalArray * g_a)  const {
387
 
  return GA_Solve(g_a->mHandle, mHandle);
388
 
}
389
 
 
390
 
int 
391
 
GA::GlobalArray::spdInvert()  const {
392
 
  return GA_Spd_invert(mHandle);
393
 
}
394
 
 
395
 
void 
396
 
GA::GlobalArray::selectElem(char *op, void* val, int index[])  const {
397
 
  NGA_Select_elem(mHandle, op, val, index);
398
 
}
399
 
 
400
 
void 
401
 
GA::GlobalArray::sgemm(char ta, char tb, int m, int n, int k, float alpha,  
402
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
403
 
                       float beta)  const {
404
 
  GA_Sgemm(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
405
 
           beta, mHandle);
406
 
}
407
 
 
408
 
void 
409
 
GA::GlobalArray::symmetrize()  const { 
410
 
  GA_Symmetrize(mHandle); 
411
 
}
412
 
 
413
 
void 
414
 
GA::GlobalArray::transpose(const GA::GlobalArray * g_a)  const {
415
 
  GA_Transpose(mHandle, g_a->mHandle);
416
 
}
417
 
 
418
 
void 
419
 
GA::GlobalArray::updateGhosts()  const {
420
 
  GA_Update_ghosts(mHandle);
421
 
}
422
 
 
423
 
int 
424
 
GA::GlobalArray::updateGhostDir(int dimension, int idir, int cflag)  const {
425
 
  return NGA_Update_ghost_dir(mHandle, dimension, idir, cflag);
426
 
}
427
 
 
428
 
DoubleComplex 
429
 
GA::GlobalArray::zdot(const GA::GlobalArray * g_a)  const {
430
 
  return GA_Zdot(mHandle, g_a->mHandle);
431
 
}
432
 
 
433
 
DoubleComplex 
434
 
GA::GlobalArray::zdotPatch(char ta, int alo[], int ahi[],
435
 
                           const GA::GlobalArray * g_a, char tb, 
436
 
                           int blo[], int bhi[])  const {
437
 
  return NGA_Zdot_patch(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
438
 
}
439
 
 
440
 
void 
441
 
GA::GlobalArray::zero()  const { 
442
 
  GA_Zero(mHandle); 
443
 
}
444
 
 
445
 
void 
446
 
GA::GlobalArray::zeroPatch (int lo[], int hi[])  const {
447
 
  NGA_Zero_patch(mHandle, lo, hi);
448
 
}
449
 
 
450
 
void 
451
 
GA::GlobalArray::zgemm(char ta, char tb, int m, int n, int k, 
452
 
                       DoubleComplex alpha,  
453
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
454
 
                       DoubleComplex beta)  const {
455
 
  GA_Zgemm(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
456
 
           beta, mHandle);
457
 
}
458
 
 
459
 
/* recent additions */
460
 
 
461
 
void 
462
 
GA::GlobalArray::absValue()  const {
463
 
  GA_Abs_value(mHandle);
464
 
}
465
 
 
466
 
void 
467
 
GA::GlobalArray::addConstant(void* alpha)  const {
468
 
  GA_Add_constant(mHandle, alpha);
469
 
}
470
 
 
471
 
void 
472
 
GA::GlobalArray::recip()  const {
473
 
  GA_Recip(mHandle);
474
 
}
475
 
 
476
 
void 
477
 
GA::GlobalArray::elemMultiply(const GA::GlobalArray * g_a, 
478
 
                              const GA::GlobalArray * g_b)  const {
479
 
  GA_Elem_multiply(g_a->mHandle, g_b->mHandle, mHandle);
480
 
}
481
 
 
482
 
void 
483
 
GA::GlobalArray::elemDivide(const GA::GlobalArray * g_a, 
484
 
                            const GA::GlobalArray * g_b)  const {
485
 
  GA_Elem_divide(g_a->mHandle, g_b->mHandle, mHandle);
486
 
}
487
 
 
488
 
 
489
 
void 
490
 
GA::GlobalArray::elemMaximum(const GA::GlobalArray * g_a, 
491
 
                             const GA::GlobalArray * g_b)  const {
492
 
  GA_Elem_maximum(g_a->mHandle, g_b->mHandle, mHandle);
493
 
}
494
 
 
495
 
 
496
 
void 
497
 
GA::GlobalArray::elemMinimum(const GA::GlobalArray * g_a, 
498
 
                             const GA::GlobalArray * g_b)  const {
499
 
  GA_Elem_minimum(g_a->mHandle, g_b->mHandle, mHandle);
500
 
}
501
 
 
502
 
void 
503
 
GA::GlobalArray::absValuePatch(int *lo, int *hi)  const {
504
 
  GA_Abs_value_patch(mHandle, lo, hi);
505
 
}
506
 
 
507
 
void 
508
 
GA::GlobalArray::addConstantPatch(int *lo,int *hi, void *alpha)  const {
509
 
  GA_Add_constant_patch(mHandle, lo, hi, alpha);
510
 
}
511
 
 
512
 
void 
513
 
GA::GlobalArray::recipPatch(int *lo, int *hi)  const {
514
 
  GA_Recip_patch(mHandle, lo, hi);
515
 
}
516
 
 
517
 
void 
518
 
GA::GlobalArray::stepMax(const GA::GlobalArray * g_a, double *step)  const {// CHECK all Step Max functions
519
 
  GA_Step_max(mHandle, g_a->mHandle, step);
520
 
}
521
 
 
522
 
void 
523
 
GA::GlobalArray::stepMaxPatch(int *alo, int *ahi, 
524
 
                              const GA::GlobalArray * g_b, int *blo, int *bhi, 
525
 
                              double *step)  const {
526
 
  GA_Step_max_patch(mHandle, alo, ahi, g_b->mHandle, blo, bhi, step);
527
 
}
528
 
 
529
 
void 
530
 
GA::GlobalArray::elemMultiplyPatch(const GA::GlobalArray * g_a,
531
 
                                   int *alo,int *ahi,
532
 
                                   const GA::GlobalArray * g_b,
533
 
                                   int *blo,int *bhi,
534
 
                                   int *clo,int *chi)  const {
535
 
  GA_Elem_multiply_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
536
 
                         mHandle, clo, chi);
537
 
}
538
 
 
539
 
void
540
 
GA::GlobalArray::elemDividePatch(const GA::GlobalArray * g_a,int *alo,int *ahi,
541
 
                                 const GA::GlobalArray * g_b,int *blo,int *bhi,
542
 
                                 int *clo,int *chi)  const {
543
 
  GA_Elem_divide_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
544
 
                       mHandle, clo, chi);
545
 
}
546
 
 
547
 
void 
548
 
GA::GlobalArray::elemMaximumPatch(const GA::GlobalArray * g_a,
549
 
                                  int *alo,int *ahi,
550
 
                                  const GA::GlobalArray * g_b,
551
 
                                  int *blo,int *bhi,
552
 
                                  int *clo,int *chi)  const {
553
 
  GA_Elem_maximum_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
554
 
                        mHandle, clo, chi);
555
 
}
556
 
 
557
 
void 
558
 
GA::GlobalArray::elemMinimumPatch(const GA::GlobalArray * g_a,
559
 
                                  int *alo,int *ahi,
560
 
                                  const GA::GlobalArray * g_b,
561
 
                                  int *blo,int *bhi,
562
 
                                  int *clo,int *chi)  const {
563
 
  GA_Elem_minimum_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
564
 
                        mHandle, clo, chi);
565
 
}
566
 
 
567
 
 
568
 
 
569
 
/*Added by Limin for matrix operations*/
570
 
 
571
 
void 
572
 
GA::GlobalArray::shiftDiagonal(void *c)  const {
573
 
  GA_Shift_diagonal(mHandle, c);
574
 
}
575
 
 
576
 
void 
577
 
GA::GlobalArray::setDiagonal(const GA::GlobalArray * g_v)  const {
578
 
  GA_Set_diagonal(mHandle, g_v->mHandle);
579
 
}
580
 
 
581
 
void 
582
 
GA::GlobalArray::zeroDiagonal()  const {
583
 
  GA_Zero_diagonal(mHandle);
584
 
}
585
 
 
586
 
void 
587
 
GA::GlobalArray::addDiagonal(const GA::GlobalArray * g_v)  const {
588
 
  GA_Add_diagonal(mHandle, g_v->mHandle);
589
 
}
590
 
 
591
 
void 
592
 
GA::GlobalArray::getDiagonal(const GA::GlobalArray * g_a)  const {
593
 
  GA_Get_diag(g_a->mHandle, mHandle);
594
 
}
595
 
 
596
 
void 
597
 
GA::GlobalArray::scaleRows(const GA::GlobalArray * g_v)  const {
598
 
  GA_Scale_rows(mHandle, g_v->mHandle);
599
 
}
600
 
 
601
 
void 
602
 
GA::GlobalArray::scaleCols(const GA::GlobalArray * g_v)  const {
603
 
  GA_Scale_cols(mHandle, g_v->mHandle);
604
 
}
605
 
 
606
 
void 
607
 
GA::GlobalArray::norm1(double *nm)  const {
608
 
 GA_Norm1(mHandle, nm);
609
 
}
610
 
 
611
 
void 
612
 
GA::GlobalArray::normInfinity(double *nm)  const {
613
 
 GA_Norm_infinity(mHandle, nm);
614
 
}
615
 
 
616
 
void 
617
 
GA::GlobalArray::median(const GA::GlobalArray * g_a, 
618
 
                        const GA::GlobalArray * g_b, 
619
 
                        const GA::GlobalArray * g_c)  const {
620
 
  GA_Median(g_a->mHandle, g_b->mHandle, g_c->mHandle, mHandle);
621
 
}
622
 
 
623
 
void 
624
 
GA::GlobalArray::medianPatch(const GA::GlobalArray * g_a, int *alo, int *ahi, 
625
 
                             const GA::GlobalArray * g_b, int *blo, int *bhi, 
626
 
                             const GA::GlobalArray * g_c, int *clo, int *chi, 
627
 
                             int *mlo, int *mhi)  const {
628
 
  GA_Median_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
629
 
                  g_c->mHandle, clo, chi, mHandle, mlo, mhi);
630
 
}
631
 
 
632
 
 
633
 
 
634