ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dmat9.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 #ifndef OPT_LIB
13  #include <cassert>
14 #endif
15 
20 mat_shape::mat_shape(int rl,int ru,int cl,int cu)
21 {
22 #ifndef OPT_LIB
23  assert(ru >= rl);
24  assert(cu >= cl);
25 #endif
26  row_min=rl;
27  row_max=ru;
28  col_min=cl;
29  col_max=cu;
30  nrows=(unsigned int)(ru-rl+1);
31  ncols=(unsigned int)(cu-cl+1);
32  ncopies=0;
33 }
34 
40 {
41  col_max = col_max - col_min + min;
42  col_min = min;
43 }
49 {
50  m = m + rowmin() - min;
51  index_max += min - index_min;
52  index_min = min;
53 }
59 {
61  row_min=min;
62 }
63 
69  {
70  for (int i=rowmin(); i<=rowmax(); i++)
71  {
72  this->elem(i).shift(min);
73  }
74  //shape->colshift(min);
75  }
int index_min
Definition: fvar.hpp:2822
int row_max
Definition: fvar.hpp:2007
unsigned int nrows
Definition: fvar.hpp:2004
void colshift(int min)
Changes the range of valid indices for the rows.
Definition: dmat9.cpp:39
unsigned int ncols
Definition: fvar.hpp:2005
void rowshift(int min)
Description not yet available.
Definition: dmat9.cpp:58
int index_max
Definition: fvar.hpp:2823
unsigned int ncopies
Definition: fvar.hpp:2003
mat_shape()
Definition: fvar.hpp:2011
int rowmax() const
Definition: fvar.hpp:2929
int row_min
Definition: fvar.hpp:2006
#define min(a, b)
Definition: cbivnorm.cpp:188
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvector * m
Definition: fvar.hpp:2824
dvector & shift(int min)
Shift valid range of subscripts.
Definition: dvector.cpp:52
dvector & elem(int i)
Definition: fvar.hpp:3011
void rowshift(int min)
Changes the range of valid indices for the rows.
Definition: dmat9.cpp:48
void colshift(int min)
Description not yet available.
Definition: dmat9.cpp:68
int col_min
Definition: fvar.hpp:2008
int rowmin() const
Definition: fvar.hpp:2925
int col_max
Definition: fvar.hpp:2009