ADMB Documentation
-a65f1c97
Main Page
Function Reference
Classes
Source Code
Related Pages
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
linad99
lvec1.cpp
Go to the documentation of this file.
1
/*
2
* $Id$
3
*
4
* Author: David Fournier
5
* Copyright (c) 2008-2012 Regents of the University of California
6
*/
11
#include "
fvar.hpp
"
12
#include "
admb_messages.h
"
13
14
#ifdef __TURBOC__
15
#pragma hdrstop
16
#include <iostream.h>
17
#endif
18
19
#ifdef __ZTC__
20
#include <iostream.hpp>
21
#endif
22
23
#include <stdlib.h>
24
25
#ifndef OPT_LIB
26
30
AD_LONG_INT
&
lvector::operator[]
(
int
i)
31
{
32
if
(i>
indexmax
())
33
{
34
ADMB_ARRAY_BOUNDS_ERROR
(
"array bound exceeded -- index too high"
,
35
"AD_LONG_INT& lvector::operator() (int i)"
,
indexmin
(),
indexmax
(), i);
36
}
37
38
if
(i<
indexmin
())
39
{
40
ADMB_ARRAY_BOUNDS_ERROR
(
"array bound exceeded -- index too low"
,
41
"AD_LONG_INT& lvector::operator() (int i)"
,
indexmin
(),
indexmax
(), i);
42
}
43
return
(*(
v
+i));
44
}
45
50
AD_LONG_INT
&
lvector::operator()
(
int
i)
51
{
52
if
(i>
indexmax
())
53
{
54
ADMB_ARRAY_BOUNDS_ERROR
(
"array bound exceeded -- index too high"
,
55
"AD_LONG_INT& lvector::operator() (int i)"
,
indexmin
(),
indexmax
(), i);
56
}
57
if
(i<
indexmin
())
58
{
59
ADMB_ARRAY_BOUNDS_ERROR
(
"array bound exceeded -- index too low"
,
60
"AD_LONG_INT& lvector::operator() (int i)"
,
indexmin
(),
indexmax
(), i);
61
}
62
return
(*(
v
+i));
63
}
64
#endif
lvector::v
AD_LONG_INT * v
Definition:
fvar.hpp:658
lvector::indexmin
int indexmin() const
Definition:
fvar.hpp:676
admb_messages.h
lvector::indexmax
int indexmax() const
Definition:
fvar.hpp:681
fvar.hpp
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
lvector::operator[]
AD_LONG_INT & operator[](int i)
Definition:
fvar.hpp:742
ADMB_ARRAY_BOUNDS_ERROR
#define ADMB_ARRAY_BOUNDS_ERROR(message, function, lower_bounds, upper_bounds, index)
Definition:
admb_messages.h:47
lvector::operator()
AD_LONG_INT & operator()(int i)
Definition:
fvar.hpp:746
AD_LONG_INT
#define AD_LONG_INT
Definition:
fvar.hpp:81
Generated on Wed Sep 7 2022 00:01:29 for ADMB Documentation by
1.8.5