Revision 753
trunk/src/df1b2separable/f1b2vc10.cpp (revision 753)  

1 
/* 

2 
* $Id$ 

3 
* 

4 
* Author: David Fournier 

5 
* Copyright (c) 20082012 Regents of the University of California 

6 
*/ 

7 
/** 

8 
* \file 

9 
* Description not yet available. 

10 
*/ 

11 
#include <df1b2fun.h> 

12  
13 
/** 

14 
* Description not yet available. 

15 
* \param 

16 
*/ 

17 
df1b2vector pow(const df1b2vector& _v,double x) 

18 
{ 

19 
ADUNCONST(df1b2vector,v); 

20 
//check_shape(x,M,"operator *"); 

21 
int mmin=v.indexmin(); 

22 
int mmax=v.indexmax(); 

23 
df1b2vector tmp; 

24 
tmp.noallocate(mmin,mmax); 

25 
for (int i=mmin;i<=mmax;i++) tmp(i)=pow(v(i),x); 

26 
return tmp; 

27 
} 

28  
29 
/** 

30 
* Description not yet available. 

31 
* \param 

32 
*/ 

33 
df1b2vector pow(const df1b2vector& _x,const df1b2vector& _v) 

34 
{ 

35 
ADUNCONST(df1b2vector,x); 

36 
ADUNCONST(df1b2vector,v); 

37 
//check_shape(x,M,"operator *"); 

38 
//check_shape(x,M,"operator *"); 

39 
int mmin=v.indexmin(); 

40 
int mmax=v.indexmax(); 

41 
df1b2vector tmp; 

42 
tmp.noallocate(mmin,mmax); 

43 
for (int i=mmin;i<=mmax;i++) tmp(i)=pow(x(i),v(i)); 

44 
return tmp; 

45 
} 

46  
47 
/** 

48 
* Description not yet available. 

49 
* \param 

50 
*/ 

51 
df1b2vector pow(const df1b2vector& _v,const df1b2variable & _x) 

52 
{ 

53 
ADUNCONST(df1b2vector,v); 

54 
ADUNCONST(df1b2variable,x); 

55 
int mmin=v.indexmin(); 

56 
int mmax=v.indexmax(); 

57 
df1b2vector tmp; 

58 
tmp.noallocate(mmin,mmax); 

59 
for (int i=mmin;i<=mmax;i++) 

60 
{ 

61 
tmp(i)=pow(v(i),x); 

62 
} 

63 
return tmp; 

64 
} 

65  
66 
/** 

67 
* Description not yet available. 

68 
* \param 

69 
*/ 

70 
df1b2vector pow(const df1b2variable & _v,const df1b2vector& _x) 

71 
{ 

72 
ADUNCONST(df1b2variable,v); 

73 
ADUNCONST(df1b2vector,x); 

74 
int mmin=x.indexmin(); 

75 
int mmax=x.indexmax(); 

76 
df1b2vector tmp; 

77 
tmp.noallocate(mmin,mmax); 

78 
for (int i=mmin;i<=mmax;i++) 

79 
{ 

80 
tmp(i)=pow(v,x(i)); 

81 
} 

82 
return tmp; 

83 
} 

84  
85 
/** 

86 
* Description not yet available. 

87 
* \param 

88 
*/ 

89 
df1b2vector pow(const double v,const df1b2vector& _x) 

90 
{ 

91 
ADUNCONST(df1b2vector,x); 

92 
int mmin=x.indexmin(); 

93 
int mmax=x.indexmax(); 

94 
df1b2vector tmp; 

95 
tmp.noallocate(mmin,mmax); 

96 
for (int i=mmin;i<=mmax;i++) 
Also available in: Unified diff