ADMB Documentation  11.1.2274
 All Classes Files Functions Variables Typedefs Friends Defines
imat9.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: imat9.cpp 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <fvar.hpp>
00012 
00017 int max(const imatrix & M)
00018 {
00019   int mmin=M.indexmin();
00020   int mmax=M.indexmax();
00021   int n1=max(M(mmin));
00022   for (int i=mmin+1;i<=mmax;i++)
00023   {
00024     int n=max(M(i));
00025     if (n1<n) n1=n;
00026   }
00027   return n1;
00028 }
00029 
00034 int min(const imatrix & M)
00035 {
00036   int mmin=M.indexmin();
00037   int mmax=M.indexmax();
00038   int n1=min(M(mmin));
00039   for (int i=mmin+1;i<=mmax;i++)
00040   {
00041     int n=min(M(i));
00042     if (n1>n) n1=n;
00043   }
00044   return n1;
00045 }