Revision 1975 trunk/src/linad99/fvar.hpp
fvar.hpp (revision 1975)  

161  161 
~smart_counter(); 
162  162 
}; 
163  163  
164 
/** 

165 
Holds the data for the prevariable class. 

166 
\ingroup BAD 

167 
*/ 

168 
class double_and_int 

169 
{ 

170 
public: 

171 
///< value of the variable 

172 
double x; 

173 
/** Return the value of the variable. 

174 
\return double reference containing the value of the variable. 

175 
*/ 

176 
inline double &xvalue(void) 

177 
{ 

178 
return x; 

179 
} 

180 
}; 

164 
#include <double_and_int.h> 

181  165  
182  
183  166 
// "forward" class definitions 
184  167 
class banded_symmetric_dvar_matrix; 
185  168 
class banded_symmetric_dmatrix; 
...  ...  
1409  1392  
1410  1393 
void gradfree(dlink *); 
1411  1394  
1412 
class prevariable_position;


1395 
#include <prevariable.h>


1413  1396  
1414 
/** 

1415 
Base class for dvariable. 

1416 
Principle role is to avoid calling a descructor when a pevariable or dvariable 

1417 
object is passed on the stack. 

1418 
(There is no destructor, ~prevariable().) 

1419 
\ingroup BAD 

1420 
*/ 

1421 
class prevariable 

1422 
{ 

1423 
protected: 

1424 
#ifndef __SUN__ 

1425 
prevariable(void) 

1426 
{ 

1427 
} 

1428 
#endif 

1429 
#ifndef __NDPX__ 

1430 
prevariable(double_and_int * u) 

1431 
{ 

1432 
v = u; 

1433 
} 

1434 
#endif 

1435  
1436 
public: 

1437 
double_and_int * v; ///< pointer to the data 

1438 
friend class dvar_vector_iterator; 

1439 
friend class dvar_vector; 

1440 
friend class dvar_matrix; 

1441 
friend class dvar3_array; 

1442 
//shclass sc; 

1443 
friend class indvar_offset_list; 

1444 
friend class gradient_structure; 

1445 
friend double_and_int *gradnew(); 

1446 
friend void make_indvar_list(int, dvariable *); 

1447  
1448 
friend class banded_symmetric_dvar_matrix; 

1449 
friend class banded_lower_triangular_dvar_matrix; 

1450 
friend double &value(const prevariable & v1); 

1451  
1452 
friend double *address(const prevariable & v1); 

1453  
1454 
//void gradfree(dlink * v) 

1455  
1456 
friend prevariable & operator*(const prevariable& v1, const prevariable& v2); 

1457  
1458 
friend prevariable & operator*(double v1, const prevariable & v2); 

1459  
1460 
friend prevariable & operator*(const prevariable & v1, double v2); 

1461  
1462 
friend prevariable & operator/(const prevariable& t1, const prevariable& t2); 

1463  
1464 
friend prevariable & operator/(double t1, const prevariable & t2); 

1465  
1466 
friend prevariable & operator/(const prevariable & t1, double t2); 

1467  
1468 
friend prevariable & sin(const prevariable & t1); 

1469  
1470 
friend prevariable & fabs(const prevariable & t1); 

1471 
friend prevariable & sigmoid(const prevariable & t1); 

1472  
1473 
//"smoothed absolute value function 

1474 
friend prevariable & sfabs(const prevariable & t1); 

1475  
1476 
friend prevariable & sqrt(const prevariable & t1); 
Also available in: Unified diff