Revision 1858 trunk/src/linad99/lmat1.cpp
lmat1.cpp (revision 1858)  

13  13 
#ifdef __TURBOC__ 
14  14 
#pragma hdrstop 
15  15 
#endif 
16  
16  17 
#if !defined(OPT_LIB) 
17  18 
/** 
18  19 
* Description not yet available. 
19  20 
* \param 
20  21 
*/ 
21 
lvector& lmatrix::operator() (int i) 

22 
{ 

23 
#ifdef SAFE_ARRAYS 

24 
if (i < rowmin()) 

25 
{ 

26 
ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded  row index too low", 

27 
"lvector& lmatrix::operator() (int i)", rowmin(), rowmax(), i); 

28 
} 

29 
if (i > rowsize() + rowmin()  1) 

30 
{ 

31 
ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded  row index too high", 

32 
"lvector& lmatrix::operator() (int i)", rowmin(), rowmax(), i); 

33 
} 

34 
#endif 

35 
return m[i]; 

36 
} 

22 
lvector& lmatrix::operator()(int i) 

23 
{ 

24 
if (i < rowmin()) 

25 
{ 

26 
ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded  row index too low", 

27 
"lvector& lmatrix::operator() (int i)", rowmin(), rowmax(), i); 

28 
} 

29 
if (i > rowsize() + rowmin()  1) 

30 
{ 

31 
ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded  row index too high", 

32 
"lvector& lmatrix::operator() (int i)", rowmin(), rowmax(), i); 

33 
} 

34 
return m[i]; 

35 
} 

37  36  
38  37 
/** 
39  38 
* Description not yet available. 
40  39 
* \param 
41  40 
*/ 
42  41 
const lvector& lmatrix::operator()(int i) const 
43 
{ 

44 
#ifdef SAFE_ARRAYS 

45 
if (i<rowmin()) 

46 
{ 

47 
cerr << "matrix bound exceeded  row index too low in " 

48 
"lmatrix::operator[]" << "value was" << i; 

49 
ad_exit(21); 

50 
} 

51 
if (i>rowsize()+rowmin()1) 

52 
{ 

53 
cerr << "matrix bound exceeded  row index too high in " 

54 
"lmatrix::operator[]" << "value was" << i; 

55 
ad_exit(22); 

56 
} 

57 
#endif 

58 
return m[i]; 

59 
} 

42 
{ 

43 
if (i < rowmin()) 

44 
{ 

45 
cerr << "matrix bound exceeded  row index too low in " 

46 
"lmatrix::operator[]" << "value was" << i; 

47 
ad_exit(21); 

48 
} 

49 
if (i > rowsize() + rowmin()  1) 

50 
{ 

51 
cerr << "matrix bound exceeded  row index too high in " 

52 
"lmatrix::operator[]" << "value was" << i; 

53 
ad_exit(22); 

54 
} 

55 
return m[i]; 

56 
} 

60  57 
#endif 
Also available in: Unified diff