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
ivect10.cpp
Go to the documentation of this file.
1
5
#include "
fvar.hpp
"
6
12
int
Max
(
const
ivector
& ivec)
13
{
14
return
max
(ivec);
15
}
21
int
max
(
const
ivector
& ivec)
22
{
23
int
min
= ivec.
indexmin
();
24
int
max
= ivec.
indexmax
();
25
int
maximum = ivec.
elem
(min);
26
for
(
int
i = min + 1; i <=
max
; ++i)
27
{
28
if
(maximum < ivec.
elem
(i)) maximum = ivec.
elem
(i);
29
}
30
return
maximum;
31
}
37
int
min
(
const
ivector
& ivec)
38
{
39
int
min
= ivec.
indexmin
();
40
int
max
= ivec.
indexmax
();
41
int
minimum = ivec.
elem
(min);
42
for
(
int
i = min + 1; i <=
max
; ++i)
43
{
44
if
(minimum > ivec.
elem
(i)) minimum = ivec.
elem
(i);
45
}
46
return
minimum;
47
}
ivector::elem
int & elem(int i)
Definition:
ivector.h:90
Max
int Max(const ivector &t1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition:
ivect10.cpp:12
ivector
Array of integers(int) with indexes from index_min to indexmax.
Definition:
ivector.h:50
min
#define min(a, b)
Definition:
cbivnorm.cpp:188
fvar.hpp
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
ivector::indexmin
int indexmin() const
Definition:
ivector.h:99
ivector::indexmax
int indexmax() const
Definition:
ivector.h:104
max
#define max(a, b)
Definition:
cbivnorm.cpp:189
Generated on Wed Sep 7 2022 00:01:29 for ADMB Documentation by
1.8.5