Statistics
| Revision:

root / branches / pthreads-737 / contrib / ecolib / pow_vectorized_RE.cpp @ 765

History | View | Annotate | Download (849 Bytes)

1
#include <admodel.h>
2
#include <df1b2fun.h>
3
#include <adrndeff.h> 
4
df1b2vector pow(const dvector& x,  const df1b2variable& a)
5
{
6
    RETURN_ARRAYS_INCREMENT();        
7
        df1b2vector y(x.indexmin(), x.indexmax());
8
        
9
        for(int i=x.indexmin(); i<=x.indexmax(); i++)
10
        {
11
                y(i)=pow(x(i),a);
12
        }        
13

    
14
        RETURN_ARRAYS_DECREMENT();        
15
    return(y);
16
}
17
df1b2vector pow(const dvector& x,  const df1b2vector& a)
18
{
19
    RETURN_ARRAYS_INCREMENT();        
20
        df1b2vector y(x.indexmin(), x.indexmax());
21
        
22
        for(int i=x.indexmin(); i<=x.indexmax(); i++)
23
        {
24
                y(i)=pow(x(i),a(i));
25
        }        
26

    
27
        RETURN_ARRAYS_DECREMENT();        
28
    return(y);
29
}
30
dvar_vector pow(const dvector& x,const dvar_vector& a)
31
{
32
    RETURN_ARRAYS_INCREMENT();        
33
        dvar_vector y(x.indexmin(), x.indexmax());
34

    
35
        for(int i=x.indexmin(); i<=x.indexmax(); i++)
36
        {
37
                y(i)=pow(x(i),a(i));
38
        }        
39

    
40
        RETURN_ARRAYS_DECREMENT();        
41
    return(y);
42
}
43
        
44