void LinearConstraint::setA(Matrix& A) { if( dimMatch(A) ) A_ = A; else OptppmathError("Check matrix dimensions. Error in the setA method. "); }
//************************************************************************ // update the local data //------------------------------------------------------------------------ void Appl_Data_NPSOL::update(int mode, int dim, ColumnVector &x, real fv) { if (buffer_len == 0) return; if (dimension != -1 && dimension != dim) { OptppmathError("Dimensions are inconsistent."); } else dimension = dim; if (x_buffer != NULL) delete x_buffer; x_buffer = new ColumnVector(dimension); (*x_buffer) = x; grad_status = constr_status = cjac_status = false; if(mode & NLPFunction) { fvalue_buffer = fv; fvalue_status = true;} }
//************************************************************************ // update the local data //------------------------------------------------------------------------ void Appl_Data_NPSOL::update(int mode, int dim,ColumnVector &x,double fx,int nc, ColumnVector &c) { if (buffer_len == 0) return; if ((dimension != -1 && dimension != dim) || (ncnln != -1 && nc != ncnln)) { OptppmathError("Dimensions are inconsistent."); } else { dimension = dim; ncnln = nc; } update(dim, x, nc, c); update(mode, dim, x, fx); if(mode & NLPFunction) { fvalue_buffer = fx; fvalue_status = true; } }
//************************************************************************ // update the local data //------------------------------------------------------------------------ void Appl_Data_NPSOL::update(int dim,ColumnVector &x,int nc,ColumnVector &c) { if (buffer_len == 0) return; if ((dimension != -1 && dimension != dim) || (ncnln != -1 && nc != ncnln)) { OptppmathError("Dimensions are inconsistent."); } else { dimension = dim; ncnln = nc; } if (x_buffer != NULL) delete x_buffer; x_buffer = new ColumnVector(dimension); (*x_buffer) = x; fvalue_status = grad_status = cjac_status = false; if (constr_buffer != NULL) delete constr_buffer; constr_buffer = new ColumnVector(ncnln); (*constr_buffer) = c; constr_status = true; }
//************************************************************************ // update the local data //------------------------------------------------------------------------ void Appl_Data_NPSOL::update(int mode, int dim,ColumnVector &x,int nc, ColumnVector &c, Matrix &cj) { if (buffer_len == 0) return; if ((dimension != -1 && dimension != dim) || (ncnln != -1 && nc != ncnln)) { OptppmathError("Dimensions are inconsistent."); } else { dimension = dim; ncnln = nc; } update(dim, x, nc, c); if( mode & NLPCJacobian){ if (cjac_buffer != NULL) delete cjac_buffer; cjac_buffer = new Matrix(dimension,ncnln); (*cjac_buffer) = cj; cjac_status = true; } }
//************************************************************************ // update the local data //------------------------------------------------------------------------ void Appl_Data_NPSOL::update(int mode, int dim,SerialDenseVector<int,double> &x,SerialDenseVector<int,double> &g) { if (buffer_len == 0) return; if (dimension != -1 && dimension != dim) { OptppmathError("Dimensions are inconsistent."); } else dimension = dim; if (x_buffer != NULL) delete x_buffer; x_buffer = new SerialDenseVector<int,double>(dimension); (*x_buffer) = x; fvalue_status = constr_status = cjac_status = false; if(mode & NLPGradient){ if (grad_buffer != NULL) delete grad_buffer; grad_buffer = new SerialDenseVector<int,double>(dimension); (*grad_buffer) = g; grad_status = true; } }