ADMB Documentation  11.1.1894
 All Classes Files Functions Variables Typedefs Friends Defines
fvar_m11.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: fvar_m11.cpp 1717 2014-03-03 21:00:03Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include "fvar.hpp"
00012 
00017 dvar_matrix& dvar_matrix::operator+=(const dvar_matrix& m1)
00018  {
00019    if (rowmin() != m1.rowmin() || rowmax() != m1.rowmax() )
00020    {
00021      cerr << " Incompatible array bounds in "
00022      "dvar_matrix& operator += (const dvar_vector&)\n";
00023      ad_exit(21);
00024    }
00025 
00026    for (int i=rowmin();i<=rowmax();i++)
00027    {
00028      elem(i) += m1.elem(i);
00029    }
00030    return(*this);
00031  }
00032 
00037 dvar_matrix& dvar_matrix::operator+=(const dmatrix& m1)
00038  {
00039    if (rowmin() != m1.rowmin() || rowmax() != m1.rowmax() )
00040    {
00041      cerr << " Incompatible array bounds in "
00042      "dvar_matrix& operator+=(const dvar_vector&)\n";
00043      ad_exit(21);
00044    }
00045 
00046    for (int i=rowmin();i<=rowmax();i++)
00047    {
00048      elem(i) += m1.elem(i);
00049    }
00050    return(*this);
00051  }
00052 
00057 dvar_matrix& dvar_matrix::operator-=(const dvar_matrix& m1)
00058  {
00059    if (rowmin() != m1.rowmin() || rowmax() != m1.rowmax() )
00060    {
00061      cerr << " Incompatible array bounds in "
00062      "dvar_matrix& operator -= (const dvar_vector&)\n";
00063      ad_exit(21);
00064    }
00065 
00066    for (int i=rowmin();i<=rowmax();i++)
00067    {
00068      elem(i) -= m1.elem(i);
00069    }
00070    return(*this);
00071  }
00072 
00077 dvar_matrix& dvar_matrix::operator-=(const dmatrix& m1)
00078  {
00079    if (rowmin() != m1.rowmin() || rowmax() != m1.rowmax() )
00080    {
00081      cerr << " Incompatible array bounds in "
00082      "dvar_matrix& operator-=(const dvar_vector&)\n";
00083      ad_exit(21);
00084    }
00085 
00086    for (int i=rowmin();i<=rowmax();i++)
00087    {
00088      elem(i) -= m1.elem(i);
00089    }
00090    return(*this);
00091  }