root / trunk / src / linad99 / dvect20.cpp @ 1942
History  View  Annotate  Download (648 Bytes)
1 
/*


2 
* $Id: dvect20.cpp 1942 20140428 22:22:45Z johnoel $

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 "fvar.hpp" 
12  
13 
/**

14 
* Divide elements of a vector by a constant

15 
* \param x constant to divide vector by.

16 
*/

17 
dvector& dvector::operator/=(const double x) 
18 
{ 
19 
for (int i=indexmin(); i<=indexmax(); i++) 
20 
{ 
21 
elem(i)/=x; 
22 
} 
23 
return(*this); 
24 
} 
25  
26 
/**

27 
* Multiply elements of a vector by a constant.

28 
* \param x constant for multiplication.

29 
*/

30 
dvector& dvector::operator*=(const double x) 
31 
{ 
32 
for (int i=indexmin(); i<=indexmax(); i++) 
33 
{ 
34 
elem(i)*=x; 
35 
} 
36 
return(*this); 
37 
} 