Revision 1107 trunk/src/df1b2separable/f1b2vc4.cpp
f1b2vc4.cpp (revision 1107)  

2  2 
* $Id$ 
3  3 
* 
4  4 
* Author: David Fournier 
5 
* Copyright (c) 20082012 Regents of the University of California


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

6  6 
*/ 
7  7 
/** 
8  8 
* \file 
...  ...  
21  21 
int rmin=M.indexmin(); 
22  22 
int rmax=M.indexmax(); 
23  23 
df1b2matrix tmp(rmin,rmax); 
24 
for (int i=rmin;i<=rmax;i++)


24 
for (int i=rmin;i<=rmax;i++) 

25  25 
{ 
26  26 
int cmin=M(i).indexmin(); 
27  27 
int cmax=M(i).indexmax(); 
28  28 
tmp(i).allocate(cmin,cmax); 
29 
for (int j=cmin;j<=cmax;j++)


29 
for (int j=cmin;j<=cmax;j++) 

30  30 
tmp(i,j)=M(i,j)+x; 
31  31 
} 
32  32 
return tmp; 
...  ...  
40  40 
{ 
41  41 
int rmin=indexmin(); 
42  42 
int rmax=indexmax(); 
43 
for (int i=rmin;i<=rmax;i++)


43 
for (int i=rmin;i<=rmax;i++) 

44  44 
{ 
45  45 
(*this)(i)/=x; 
46  46 
} 
...  ...  
55  55 
{ 
56  56 
int rmin=indexmin(); 
57  57 
int rmax=indexmax(); 
58 
for (int i=rmin;i<=rmax;i++)


58 
for (int i=rmin;i<=rmax;i++) 

59  59 
{ 
60  60 
(*this)(i)*=x; 
61  61 
} 
...  ...  
71  71 
ADUNCONST(df1b2variable,x) 
72  72 
int rmin=indexmin(); 
73  73 
int rmax=indexmax(); 
74 
for (int i=rmin;i<=rmax;i++)


74 
for (int i=rmin;i<=rmax;i++) 

75  75 
{ 
76  76 
(*this)(i)/=x; 
77  77 
} 
...  ...  
87  87 
ADUNCONST(df1b2variable,x) 
88  88 
int rmin=indexmin(); 
89  89 
int rmax=indexmax(); 
90 
for (int i=rmin;i<=rmax;i++)


90 
for (int i=rmin;i<=rmax;i++) 

91  91 
{ 
92  92 
(*this)(i)*=x; 
93  93 
} 
...  ...  
105  105 
int rmax=M.indexmax(); 
106  106 
if (rmin != M.indexmin()  rmax != M.indexmax()) 
107  107 
{ 
108 
cerr << "Unequal shapes in"


108 
cerr << "Unequal shapes in" 

109  109 
" df1b2matrix& df1b2matrix::operator += (const df1b2matrix& _M)" 
110  110 
<< endl; 
111  111 
ad_exit(1); 
112  112 
} 
113 
for (int i=rmin;i<=rmax;i++)


113 
for (int i=rmin;i<=rmax;i++) 

114  114 
{ 
115  115 
int cmin=(*this)(i).indexmin(); 
116  116 
int cmax=(*this)(i).indexmax(); 
117 
for (int j=cmin;j<=cmax;j++)


117 
for (int j=cmin;j<=cmax;j++) 

118  118 
(*this)(i,j)+=M(i,j); 
119  119 
} 
120  120 
return (*this); 
...  ...  
136  136 
<< endl; 
137  137 
ad_exit(1); 
138  138 
} 
139 
for (int i=rmin;i<=rmax;i++)


139 
for (int i=rmin;i<=rmax;i++) 

140  140 
{ 
141  141 
int cmin=(*this)(i).indexmin(); 
142  142 
int cmax=(*this)(i).indexmax(); 
143 
for (int j=cmin;j<=cmax;j++)


143 
for (int j=cmin;j<=cmax;j++) 

144  144 
(*this)(i,j)=M(i,j); 
145  145 
} 
146  146 
return (*this); 
...  ...  
156  156 
int rmin=M.indexmin(); 
157  157 
int rmax=M.indexmax(); 
Also available in: Unified diff