00001 /* 00002 * $Id$ 00003 * 00004 * Author: David Fournier 00005 * Copyright (c) 2008-2012 Regents of the University of California 00006 */ 00012 #include "fvar.hpp" 00013 00018 lmatrix& lmatrix::operator=(const lmatrix& m1) 00019 { 00020 if (rowmin() != m1.rowmin() || rowmax() != m1.rowmax() || 00021 colmin() != m1.colmin() || colmax() != m1.colmax() ) 00022 { 00023 cerr << " Incompatible array bounds in " 00024 "imatrix& operator = (const imatrix&)\n"; 00025 ad_exit(21); 00026 } 00027 00028 if (m != m1.m) // check for condition that both matrices 00029 { // point to the same object 00030 for (int i=rowmin();i<=rowmax();i++) 00031 { 00032 *(m+i) = m1[i]; 00033 } 00034 } 00035 return(*this); 00036 } 00037 00042 lmatrix& lmatrix::operator=(const imatrix& m1) 00043 { 00044 if (rowmin() != m1.rowmin() || rowmax() != m1.rowmax() || 00045 colmin() != m1.colmin() || colmax() != m1.colmax() ) 00046 { 00047 cerr << " Incompatible array bounds in " 00048 "imatrix& operator=(const imatrix&)\n"; 00049 ad_exit(21); 00050 } 00051 00052 for (int i=rowmin();i<=rowmax();i++) 00053 { 00054 *(m+i) = m1[i]; 00055 } 00056 return(*this); 00057 } 00058
Generated on Tue Mar 8 2016 19:51:34 for ADMB Documentation by 1.8.0 |