C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
livecrmat.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: livecrmat.inl,v 1.25 2014/01/30 17:23:47 cxsc Exp $ */
00025 
00026 // Here are definitions for l_ivector x rmatrix-Functions
00027 #ifndef _CXSC_LIVECRMAT_INL_INCLUDED
00028 #define _CXSC_LIVECRMAT_INL_INCLUDED
00029 
00030 namespace cxsc {
00031 
00032         INLINE l_ivector::l_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<l_ivector,rmatrix,l_interval>(*this,sl); }
00039         INLINE l_ivector::l_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<l_ivector,rmatrix_slice,l_interval>(*this,sl); }
00046         INLINE l_ivector::l_ivector(const rmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size)
00047         {
00048                 dat=new l_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 l_ivector _l_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 l_ivector(sl); }
00069         INLINE l_ivector _l_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 l_ivector(sl); }
00076 
00077         INLINE void accumulate(idotprecision &dp, const rmatrix_subv & rv1, const l_ivector &rv2)
00078 #if(CXSC_INDEX_CHECK)
00079         throw(OP_WITH_WRONG_DIM)
00080 #else
00081         throw()
00082 #endif
00083         { _vmvaccu<idotprecision,l_ivector,rmatrix_subv>(dp,rv2,rv1); }
00084         INLINE void accumulate(idotprecision &dp, const l_ivector & rv1, const rmatrix_subv &rv2)
00085 #if(CXSC_INDEX_CHECK)
00086         throw(OP_WITH_WRONG_DIM)
00087 #else
00088         throw()
00089 #endif
00090         { _vmvaccu<idotprecision,l_ivector,rmatrix_subv>(dp,rv1,rv2); }
00091         
00092         INLINE void accumulate(idotprecision &dp, const rmatrix_subv & rv1, const l_ivector_slice &rv2)
00093 #if(CXSC_INDEX_CHECK)
00094         throw(OP_WITH_WRONG_DIM)
00095 #else
00096         throw()
00097 #endif
00098         { _vmvaccu<idotprecision,l_ivector,rmatrix_subv>(dp,l_ivector(rv2),rv1); }
00099         INLINE void accumulate(idotprecision &dp, const l_ivector_slice & rv1, const rmatrix_subv &rv2)
00100 #if(CXSC_INDEX_CHECK)
00101         throw(OP_WITH_WRONG_DIM)
00102 #else
00103         throw()
00104 #endif
00105         { _vmvaccu<idotprecision,l_ivector,rmatrix_subv>(dp,l_ivector(rv1),rv2); }
00106 
00107         INLINE l_ivector &l_ivector::operator =(const rmatrix_subv &mv) throw() { return _vmvassign<l_ivector,rmatrix_subv,l_interval>(*this,mv); }
00108         INLINE l_ivector_slice &l_ivector_slice::operator =(const rmatrix_subv &mv) throw() { return _vsvassign(*this,rvector(mv)); }
00109         INLINE l_ivector &l_ivector::operator =(const rmatrix &m)
00110 #if(CXSC_INDEX_CHECK)
00111         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00112 #else
00113         throw()
00114 #endif
00115         { return _vmassign<l_ivector,rmatrix,l_interval>(*this,m); }
00116         INLINE l_ivector &l_ivector::operator =(const rmatrix_slice &m)
00117 #if(CXSC_INDEX_CHECK)
00118         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00119 #else
00120         throw()
00121 #endif
00122         { return _vmassign<l_ivector,rmatrix,l_interval>(*this,rmatrix(m)); }
00123         INLINE l_ivector_slice &l_ivector_slice::operator =(const rmatrix &m)
00124 #if(CXSC_INDEX_CHECK)
00125         throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00126 #else
00127         throw()
00128 #endif
00129         { return _vsvassign(*this,rvector(m)); }
00130         INLINE l_ivector_slice & l_ivector_slice::operator =(const rmatrix_slice &m)
00131 #if(CXSC_INDEX_CHECK)
00132         throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00133 #else
00134         throw()
00135 #endif
00136         { return _vsvassign(*this,l_ivector(rmatrix(m))); }
00137 
00138         INLINE l_ivector operator *(const rmatrix &m,const l_ivector &v)
00139 #if(CXSC_INDEX_CHECK)
00140         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00141 #else
00142         throw()
00143 #endif
00144         { return _mvlimult<rmatrix,l_ivector,l_ivector>(m,v); }
00145         INLINE l_ivector operator *(const rmatrix_slice &ms,const l_ivector &v)
00146 #if(CXSC_INDEX_CHECK)
00147         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00148 #else
00149         throw()
00150 #endif
00151         { return _msvlimult<rmatrix_slice,l_ivector,l_ivector>(ms,v); }
00152         INLINE l_ivector operator *(const l_ivector &v,const rmatrix &m)
00153 #if(CXSC_INDEX_CHECK)
00154         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00155 #else
00156         throw()
00157 #endif
00158         { return _vmlimult<l_ivector,rmatrix,l_ivector>(v,m); }
00159         INLINE l_ivector operator *(const l_ivector &v,const rmatrix_slice &ms)
00160 #if(CXSC_INDEX_CHECK)
00161         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00162 #else
00163         throw()
00164 #endif
00165         { return _vmslimult<l_ivector,rmatrix_slice,l_ivector>(v,ms); }
00166         INLINE l_ivector &operator *=(l_ivector &v,const rmatrix &m)
00167 #if(CXSC_INDEX_CHECK)
00168         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00169 #else
00170         throw()
00171 #endif
00172         { return _vmlimultassign<l_ivector,rmatrix,l_interval>(v,m); }
00173         INLINE l_ivector &operator *=(l_ivector &v,const rmatrix_slice &ms)
00174 #if(CXSC_INDEX_CHECK)
00175         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00176 #else
00177         throw()
00178 #endif
00179         { return _vmslimultassign<l_ivector,rmatrix_slice,l_interval>(v,ms); }
00180 
00181         INLINE l_ivector operator *(const l_ivector_slice &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 _vmlimult<l_ivector,rmatrix,l_ivector>(l_ivector(v),m); }
00188         INLINE l_ivector_slice &l_ivector_slice::operator *=(const rmatrix &m)
00189 #if(CXSC_INDEX_CHECK)
00190         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00191 #else
00192         throw()
00193 #endif
00194         { return _vsmlimultassign<l_ivector_slice,rmatrix,l_interval>(*this,m); }
00195 
00196 } // namespace cxsc
00197 
00198 #endif
00199