1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the class library */ 4 /* SoPlex --- the Sequential object-oriented simPlex. */ 5 /* */ 6 /* Copyright (c) 1996-2023 Zuse Institute Berlin (ZIB) */ 7 /* */ 8 /* Licensed under the Apache License, Version 2.0 (the "License"); */ 9 /* you may not use this file except in compliance with the License. */ 10 /* You may obtain a copy of the License at */ 11 /* */ 12 /* http://www.apache.org/licenses/LICENSE-2.0 */ 13 /* */ 14 /* Unless required by applicable law or agreed to in writing, software */ 15 /* distributed under the License is distributed on an "AS IS" BASIS, */ 16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 17 /* See the License for the specific language governing permissions and */ 18 /* limitations under the License. */ 19 /* */ 20 /* You should have received a copy of the Apache-2.0 license */ 21 /* along with SoPlex; see the file LICENSE. If not email to soplex@zib.de. */ 22 /* */ 23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 25 namespace soplex 26 { 27 28 template <class R> 29 UpdateVector<R>& UpdateVector<R>::operator=(const UpdateVector<R>& rhs) 30 { 31 if(this != &rhs) 32 { 33 theval = rhs.theval; 34 thedelta = rhs.thedelta; 35 VectorBase<R>::operator=(rhs); 36 37 assert(UpdateVector<R>::isConsistent()); 38 } 39 40 return *this; 41 } 42 43 template <class R> 44 UpdateVector<R>::UpdateVector(const UpdateVector<R>& base) 45 : VectorBase<R>(base) 46 , theval(base.theval) 47 , thedelta(base.thedelta) 48 { 49 assert(UpdateVector<R>::isConsistent()); 50 } 51 52 template <class R> 53 bool UpdateVector<R>::isConsistent() const 54 { 55 #ifdef ENABLE_CONSISTENCY_CHECKS 56 57 if(this->dim() != thedelta.dim()) 58 return SPX_MSG_INCONSISTENT("UpdateVector"); 59 60 return VectorBase<R>::isConsistent() && thedelta.isConsistent(); 61 #else 62 return true; 63 #endif 64 } 65 } // namespace soplex 66