Statistics
| Revision:

root / branches / pthreads-737 / src / linad99 / d7arr1.cpp @ 765

History | View | Annotate | Download (965 Bytes)

1
/*
2
 * $Id: d7arr1.cpp 542 2012-07-10 21:04:06Z johnoel $
3
 *
4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
6
 */
7
/**
8
 * \file
9
 * Description not yet available.
10
 */
11
#include "fvar.hpp"
12

    
13
/**
14
 * Description not yet available.
15
 * \param
16
 */
17
d7_array operator/(const d7_array& m, CGNU_DOUBLE d)
18
   {
19
     d7_array tmp;
20
     tmp.allocate(m);
21
     for (int i=tmp.indexmin();i<=tmp.indexmax();i++)
22
     {
23
       tmp(i)=m(i)/d;
24
     }
25
     return tmp;
26
   }  
27

    
28
/**
29
 * Description not yet available.
30
 * \param
31
 */
32
   void d7_array::operator /= ( CGNU_DOUBLE d)
33
   {
34
     for (int i=indexmin();i<=indexmax();i++)
35
     {
36
       (*this)(i)/=d;
37
     }
38
   }  
39

    
40
/**
41
 * Description not yet available.
42
 * \param
43
 */
44
double sum(const d7_array& m)
45
  {
46
    RETURN_ARRAYS_INCREMENT();
47
    double tmp=0.;
48
    for (int i=m.indexmin();i<=m.indexmax();i++)
49
    {
50
      tmp+=sum(m.elem(i));
51
    }
52
    RETURN_ARRAYS_DECREMENT();
53
    return tmp;
54
  }