C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
civecrmat.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: civecrmat.inl,v 1.24 2014/01/30 17:23:44 cxsc Exp $ */
00025 
00026 // Here are definitions for civector x rmatrix-Functions
00027 #ifndef _CXSC_CIVECRMAT_INL_INCLUDED
00028 #define _CXSC_CIVECRMAT_INL_INCLUDED
00029 
00030 namespace cxsc {
00031 
00032         INLINE civector::civector(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<civector,rmatrix,cinterval>(*this,sl); }
00039         INLINE civector::civector(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<civector,rmatrix_slice,cinterval>(*this,sl); }
00046         INLINE civector::civector(const rmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size)
00047         {
00048                 dat=new cinterval[size];
00049                 for (int i=0, j=v.start;i<v.size;i++,j+=v.offset)
00050                         dat[i]=v.dat[j];
00051         }
00052         INLINE civector _civector(const rmatrix &sl)
00053 #if(CXSC_INDEX_CHECK)
00054         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00055 #else
00056         throw()
00057 #endif
00058         { return civector(sl); }
00059         INLINE civector _civector(const rmatrix_slice &sl)
00060 #if(CXSC_INDEX_CHECK)
00061         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00062 #else
00063         throw()
00064 #endif
00065         { return civector(sl); }
00066 
00067         INLINE civector &civector::operator =(const rmatrix_subv &mv) throw() { return _vmvassign<civector,rmatrix_subv,cinterval>(*this,mv); }
00068         INLINE civector_slice &civector_slice::operator =(const rmatrix_subv &mv) throw() { return _vsvassign(*this,rvector(mv)); }
00069         INLINE civector &civector::operator =(const rmatrix &m)
00070 #if(CXSC_INDEX_CHECK)
00071         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00072 #else
00073         throw()
00074 #endif
00075         { return _vmassign<civector,rmatrix,cinterval>(*this,m); }
00076         INLINE civector &civector::operator =(const rmatrix_slice &m)
00077 #if(CXSC_INDEX_CHECK)
00078         throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00079 #else
00080         throw()
00081 #endif
00082         { return _vmassign<civector,rmatrix,cinterval>(*this,rmatrix(m)); }
00083         INLINE civector_slice &civector_slice::operator =(const rmatrix &m)
00084 #if(CXSC_INDEX_CHECK)
00085         throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00086 #else
00087         throw()
00088 #endif
00089         { return _vsvassign(*this,rvector(m)); }
00090         INLINE civector_slice & civector_slice::operator =(const rmatrix_slice &m)
00091 #if(CXSC_INDEX_CHECK)
00092         throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
00093 #else
00094         throw()
00095 #endif
00096         { return _vsvassign(*this,civector(rmatrix(m))); }
00097 
00098         INLINE civector operator *(const rmatrix &m,const civector &v)
00099 #if(CXSC_INDEX_CHECK)
00100         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00101 #else
00102         throw()
00103 #endif
00104         { return _mvcimult<rmatrix,civector,civector>(m,v); }
00105         INLINE civector operator *(const rmatrix_slice &ms,const civector &v)
00106 #if(CXSC_INDEX_CHECK)
00107         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00108 #else
00109         throw()
00110 #endif
00111         { return _msvcimult<rmatrix_slice,civector,civector>(ms,v); }
00112         INLINE civector operator *(const civector &v,const rmatrix &m)
00113 #if(CXSC_INDEX_CHECK)
00114         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00115 #else
00116         throw()
00117 #endif
00118         { return _vmcimult<civector,rmatrix,civector>(v,m); }
00119         INLINE civector operator *(const civector &v,const rmatrix_slice &ms)
00120 #if(CXSC_INDEX_CHECK)
00121         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00122 #else
00123         throw()
00124 #endif
00125         { return _vmscimult<civector,rmatrix_slice,civector>(v,ms); }
00126         INLINE civector &operator *=(civector &v,const rmatrix &m)
00127 #if(CXSC_INDEX_CHECK)
00128         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00129 #else
00130         throw()
00131 #endif
00132         { return _vmcimultassign<civector,rmatrix,cinterval>(v,m); }
00133         INLINE civector &operator *=(civector &v,const rmatrix_slice &ms)
00134 #if(CXSC_INDEX_CHECK)
00135         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00136 #else
00137         throw()
00138 #endif
00139         { return _vmscimultassign<civector,rmatrix_slice,cinterval>(v,ms); }
00140 
00141         INLINE civector operator *(const civector_slice &v,const rmatrix &m)
00142 #if(CXSC_INDEX_CHECK)
00143         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00144 #else
00145         throw()
00146 #endif
00147         { return _vmcimult<civector,rmatrix,civector>(civector(v),m); }
00148         INLINE civector_slice &civector_slice::operator *=(const rmatrix &m)
00149 #if(CXSC_INDEX_CHECK)
00150         throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
00151 #else
00152         throw()
00153 #endif
00154         { return _vsmcimultassign<civector_slice,rmatrix,cinterval>(*this,m); }
00155 
00156 } // namespace cxsc
00157 
00158 #endif
00159