C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
ivecrmat.inl
00001 /*
00002 **  CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4)
00003 **
00004 **  Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
00005 **                          Universitaet Karlsruhe, Germany
00006 **            (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie
00007 **                          Universitaet Wuppertal, Germany   
00008 **
00009 **  This library is free software; you can redistribute it and/or
00010 **  modify it under the terms of the GNU Library General Public
00011 **  License as published by the Free Software Foundation; either
00012 **  version 2 of the License, or (at your option) any later version.
00013 **
00014 **  This library is distributed in the hope that it will be useful,
00015 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 **  Library General Public License for more details.
00018 **
00019 **  You should have received a copy of the GNU Library General Public
00020 **  License along with this library; if not, write to the Free
00021 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 /* CVS $Id: ivecrmat.inl,v 1.26 2014/01/30 17:23:45 cxsc Exp $ */
00025 
00026 // Here are definitions for ivector x rmatrix-Functions
00027 #ifndef _CXSC_IVECRMAT_INL_INCLUDED
00028 #define _CXSC_IVECRMAT_INL_INCLUDED
00029 
00030 namespace cxsc {
00031 
00032         INLINE ivector::ivector(const rmatrix &sl)
00033 #if(CXSC_INDEX_CHECK)
00034         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00035 #else
00036         throw()
00037 #endif
00038         { _vmconstr<ivector,rmatrix,interval>(*this,sl); }
00039         INLINE ivector::ivector(const rmatrix_slice &sl)
00040 #if(CXSC_INDEX_CHECK)
00041         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00042 #else
00043         throw()
00044 #endif
00045         { _vmsconstr<ivector,rmatrix_slice,interval>(*this,sl); }
00046         INLINE ivector::ivector(const rmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size)
00047         {
00048                 dat=new interval[size];
00049                 for (int i=0, j=v.start;i<v.size;i++,j+=v.offset)
00050                         dat[i]=v.dat[j];
00051         }
00057         INLINE ivector _ivector(const rmatrix &sl)
00058 #if(CXSC_INDEX_CHECK)
00059         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00060 #else
00061         throw()
00062 #endif
00063         { return ivector(sl); }
00069         INLINE ivector _ivector(const rmatrix_slice &sl)
00070 #if(CXSC_INDEX_CHECK)
00071         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00072 #else
00073         throw()
00074 #endif
00075         { return ivector(sl); }
00076 
00077 
00078         INLINE void SetInf(ivector &iv,const rmatrix_subv &rv)
00079 #if(CXSC_INDEX_CHECK)
00080         throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM)
00081 #else
00082         throw()
00083 #endif
00084         { _vmvsetinf(iv,rv); }
00085         INLINE void SetSup(ivector &iv,const rmatrix_subv &rv)
00086 #if(CXSC_INDEX_CHECK)
00087         throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM)
00088 #else
00089         throw()
00090 #endif
00091         { _vmvsetsup(iv,rv); }
00092         INLINE void SetInf(ivector_slice &iv,const rmatrix_subv &rv)
00093 #if(CXSC_INDEX_CHECK)
00094         throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM)
00095 #else
00096         throw()
00097 #endif
00098         { _vsvsetinf(iv,rvector(rv)); }
00099         INLINE void SetSup(ivector_slice &iv,const rmatrix_subv &rv)
00100 #if(CXSC_INDEX_CHECK)
00101         throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM)
00102 #else
00103         throw()
00104 #endif
00105         { _vsvsetsup(iv,rvector(rv)); }
00106 
00107         INLINE void UncheckedSetInf(ivector &iv,const rmatrix_subv &rv)
00108 #if(CXSC_INDEX_CHECK)
00109         throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM)
00110 #else
00111         throw()
00112 #endif
00113         { _vmvusetinf(iv,rv); }
00114         INLINE void UncheckedSetSup(ivector &iv,const rmatrix_subv &rv)
00115 #if(CXSC_INDEX_CHECK)
00116         throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM)
00117 #else
00118         throw()
00119 #endif
00120         { _vmvusetsup(iv,rv); }
00121         INLINE void UncheckedSetInf(ivector_slice &iv,const rmatrix_subv &rv)
00122 #if(CXSC_INDEX_CHECK)
00123         throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM)
00124 #else
00125         throw()
00126 #endif
00127         { _vsvusetinf(iv,rvector(rv)); }
00128         INLINE void UncheckedSetSup(ivector_slice &iv,const rmatrix_subv &rv)
00129 #if(CXSC_INDEX_CHECK)
00130         throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM)
00131 #else
00132         throw()
00133 #endif
00134         { _vsvusetsup(iv,rvector(rv)); }
00135 
00136         INLINE ivector &ivector::operator =(const rmatrix_subv &mv) throw() { return _vmvassign<ivector,rmatrix_subv,interval>(*this,mv); }
00137         INLINE ivector_slice &ivector_slice::operator =(const rmatrix_subv &mv) throw() { return _vsvassign(*this,rvector(mv)); }
00138         INLINE ivector &ivector::operator =(const rmatrix &m)
00139 #if(CXSC_INDEX_CHECK)
00140         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00141 #else
00142         throw()
00143 #endif
00144         { return _vmassign<ivector,rmatrix,interval>(*this,m); }
00145         INLINE ivector &ivector::operator =(const rmatrix_slice &m)
00146 #if(CXSC_INDEX_CHECK)
00147         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00148 #else
00149         throw()
00150 #endif
00151         { return _vmassign<ivector,rmatrix,interval>(*this,rmatrix(m)); }
00152         INLINE ivector_slice &ivector_slice::operator =(const rmatrix &m)
00153 #if(CXSC_INDEX_CHECK)
00154         throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00155 #else
00156         throw()
00157 #endif
00158         { return _vsvassign(*this,rvector(m)); }
00159         INLINE ivector_slice & ivector_slice::operator =(const rmatrix_slice &m)
00160 #if(CXSC_INDEX_CHECK)
00161         throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00162 #else
00163         throw()
00164 #endif
00165         { return _vsvassign(*this,ivector(rmatrix(m))); }
00166 
00167         INLINE ivector operator *(const rmatrix &m,const ivector &v)
00168 #if(CXSC_INDEX_CHECK)
00169         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00170 #else
00171         throw()
00172 #endif
00173         { return _mvimult<rmatrix,ivector,ivector>(m,v); }
00174         INLINE ivector operator *(const rmatrix_slice &ms,const ivector &v)
00175 #if(CXSC_INDEX_CHECK)
00176         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00177 #else
00178         throw()
00179 #endif
00180         { return _msvimult<rmatrix_slice,ivector,ivector>(ms,v); }
00181         INLINE ivector operator *(const ivector &v,const rmatrix &m)
00182 #if(CXSC_INDEX_CHECK)
00183         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00184 #else
00185         throw()
00186 #endif
00187         { return _vmimult<ivector,rmatrix,ivector>(v,m); }
00188         INLINE ivector operator *(const ivector &v,const rmatrix_slice &ms)
00189 #if(CXSC_INDEX_CHECK)
00190         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00191 #else
00192         throw()
00193 #endif
00194         { return _vmsimult<ivector,rmatrix_slice,ivector>(v,ms); }
00195         INLINE ivector &operator *=(ivector &v,const rmatrix &m)
00196 #if(CXSC_INDEX_CHECK)
00197         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00198 #else
00199         throw()
00200 #endif
00201         { return _vmimultassign<ivector,rmatrix,interval>(v,m); }
00202         INLINE ivector &operator *=(ivector &v,const rmatrix_slice &ms)
00203 #if(CXSC_INDEX_CHECK)
00204         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00205 #else
00206         throw()
00207 #endif
00208         { return _vmsimultassign<ivector,rmatrix_slice,interval>(v,ms); }
00209 
00210         INLINE ivector operator *(const ivector_slice &v,const rmatrix &m)
00211 #if(CXSC_INDEX_CHECK)
00212         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00213 #else
00214         throw()
00215 #endif
00216         { return _vmimult<ivector,rmatrix,ivector>(ivector(v),m); }
00217         INLINE ivector_slice &ivector_slice::operator *=(const rmatrix &m)
00218 #if(CXSC_INDEX_CHECK)
00219         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00220 #else
00221         throw()
00222 #endif
00223         { return _vsmimultassign<ivector_slice,rmatrix,interval>(*this,m); }
00224 
00225 } // namespace cxsc
00226 
00227 #endif
00228