C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
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: civecimat.inl,v 1.24 2014/01/30 17:23:44 cxsc Exp $ */ 00025 00026 // Here are definitions for civector x imatrix-Functions 00027 #ifndef _CXSC_CIVECIMAT_INL_INCLUDED 00028 #define _CXSC_CIVECIMAT_INL_INCLUDED 00029 00030 namespace cxsc { 00031 00032 INLINE civector::civector(const imatrix &sl) 00033 #if(CXSC_INDEX_CHECK) 00034 throw(ERROR_IMATRIX_TYPE_CAST_OF_THICK_OBJ) 00035 #else 00036 throw() 00037 #endif 00038 { _vmconstr<civector,imatrix,cinterval>(*this,sl); } 00039 INLINE civector::civector(const imatrix_slice &sl) 00040 #if(CXSC_INDEX_CHECK) 00041 throw(ERROR_IMATRIX_TYPE_CAST_OF_THICK_OBJ) 00042 #else 00043 throw() 00044 #endif 00045 { _vmsconstr<civector,imatrix_slice,cinterval>(*this,sl); } 00046 INLINE civector::civector(const imatrix_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 imatrix &sl) 00053 #if(CXSC_INDEX_CHECK) 00054 throw(ERROR_IMATRIX_TYPE_CAST_OF_THICK_OBJ) 00055 #else 00056 throw() 00057 #endif 00058 { return civector(sl); } 00059 INLINE civector _civector(const imatrix_slice &sl) 00060 #if(CXSC_INDEX_CHECK) 00061 throw(ERROR_IMATRIX_TYPE_CAST_OF_THICK_OBJ) 00062 #else 00063 throw() 00064 #endif 00065 { return civector(sl); } 00066 00067 00068 INLINE void SetIm(civector &iv,const imatrix_subv &rv) 00069 #if(CXSC_INDEX_CHECK) 00070 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00071 #else 00072 throw() 00073 #endif 00074 { _vmvsetim(iv,rv); } 00075 INLINE void SetRe(civector &iv,const imatrix_subv &rv) 00076 #if(CXSC_INDEX_CHECK) 00077 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00078 #else 00079 throw() 00080 #endif 00081 { _vmvsetre(iv,rv); } 00082 INLINE void SetIm(civector_slice &iv,const imatrix_subv &rv) 00083 #if(CXSC_INDEX_CHECK) 00084 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00085 #else 00086 throw() 00087 #endif 00088 { _vsvsetim(iv,ivector(rv)); } 00089 INLINE void SetRe(civector_slice &iv,const imatrix_subv &rv) 00090 #if(CXSC_INDEX_CHECK) 00091 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00092 #else 00093 throw() 00094 #endif 00095 { _vsvsetre(iv,ivector(rv)); } 00096 00097 INLINE civector &civector::operator =(const imatrix_subv &mv) throw() { return _vmvassign<civector,imatrix_subv,cinterval>(*this,mv); } 00098 INLINE civector_slice &civector_slice::operator =(const imatrix_subv &mv) throw() { return _vsvassign(*this,ivector(mv)); } 00099 INLINE civector &civector::operator =(const imatrix &m) 00100 #if(CXSC_INDEX_CHECK) 00101 throw(ERROR_IMATRIX_TYPE_CAST_OF_THICK_OBJ) 00102 #else 00103 throw() 00104 #endif 00105 { return _vmassign<civector,imatrix,cinterval>(*this,m); } 00106 INLINE civector &civector::operator =(const imatrix_slice &m) 00107 #if(CXSC_INDEX_CHECK) 00108 throw(ERROR_IMATRIX_TYPE_CAST_OF_THICK_OBJ) 00109 #else 00110 throw() 00111 #endif 00112 { return _vmassign<civector,imatrix,cinterval>(*this,imatrix(m)); } 00113 INLINE civector_slice &civector_slice::operator =(const imatrix &m) 00114 #if(CXSC_INDEX_CHECK) 00115 throw(ERROR__OP_WITH_WRONG_DIM<ivector>,ERROR_IMATRIX_TYPE_CAST_OF_THICK_OBJ) 00116 #else 00117 throw() 00118 #endif 00119 { return _vsvassign(*this,ivector(m)); } 00120 INLINE civector_slice & civector_slice::operator =(const imatrix_slice &m) 00121 #if(CXSC_INDEX_CHECK) 00122 throw(ERROR__OP_WITH_WRONG_DIM<ivector>,ERROR_IMATRIX_TYPE_CAST_OF_THICK_OBJ) 00123 #else 00124 throw() 00125 #endif 00126 { return _vsvassign(*this,civector(imatrix(m))); } 00127 00128 INLINE civector operator *(const imatrix &m,const civector &v) 00129 #if(CXSC_INDEX_CHECK) 00130 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00131 #else 00132 throw() 00133 #endif 00134 { return _mvcimult<imatrix,civector,civector>(m,v); } 00135 INLINE civector operator *(const imatrix_slice &ms,const civector &v) 00136 #if(CXSC_INDEX_CHECK) 00137 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00138 #else 00139 throw() 00140 #endif 00141 { return _msvcimult<imatrix_slice,civector,civector>(ms,v); } 00142 INLINE civector operator *(const civector &v,const imatrix &m) 00143 #if(CXSC_INDEX_CHECK) 00144 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00145 #else 00146 throw() 00147 #endif 00148 { return _vmcimult<civector,imatrix,civector>(v,m); } 00149 INLINE civector operator *(const civector &v,const imatrix_slice &ms) 00150 #if(CXSC_INDEX_CHECK) 00151 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00152 #else 00153 throw() 00154 #endif 00155 { return _vmscimult<civector,imatrix_slice,civector>(v,ms); } 00156 INLINE civector &operator *=(civector &v,const imatrix &m) 00157 #if(CXSC_INDEX_CHECK) 00158 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00159 #else 00160 throw() 00161 #endif 00162 { return _vmcimultassign<civector,imatrix,cinterval>(v,m); } 00163 INLINE civector &operator *=(civector &v,const imatrix_slice &ms) 00164 #if(CXSC_INDEX_CHECK) 00165 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00166 #else 00167 throw() 00168 #endif 00169 { return _vmscimultassign<civector,imatrix_slice,cinterval>(v,ms); } 00170 00171 INLINE civector operator *(const civector_slice &v,const imatrix &m) 00172 #if(CXSC_INDEX_CHECK) 00173 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00174 #else 00175 throw() 00176 #endif 00177 { return _vmcimult<civector,imatrix,civector>(civector(v),m); } 00178 INLINE civector_slice &civector_slice::operator *=(const imatrix &m) 00179 #if(CXSC_INDEX_CHECK) 00180 throw(ERROR_IMATRIX_OP_WITH_WRONG_DIM) 00181 #else 00182 throw() 00183 #endif 00184 { return _vsmcimultassign<civector_slice,imatrix,cinterval>(*this,m); } 00185 00186 INLINE civector operator *(const cvector &v,const imatrix &m) 00187 #if(CXSC_INDEX_CHECK) 00188 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00189 #else 00190 throw() 00191 #endif 00192 { return _vmcimult<cvector,imatrix,civector>(v,m); } 00193 INLINE civector operator *(const cvector &v,const imatrix_slice &ms) 00194 #if(CXSC_INDEX_CHECK) 00195 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00196 #else 00197 throw() 00198 #endif 00199 { return _vmscimult<cvector,imatrix_slice,civector>(v,ms); } 00200 INLINE civector operator *(const cvector_slice &v,const imatrix &m) 00201 #if(CXSC_INDEX_CHECK) 00202 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00203 #else 00204 throw() 00205 #endif 00206 { return _vmcimult<civector,imatrix,civector>(civector(v),m); } 00207 INLINE civector operator *(const imatrix &m,const cvector &v) 00208 #if(CXSC_INDEX_CHECK) 00209 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00210 #else 00211 throw() 00212 #endif 00213 { return _mvcimult<imatrix,cvector,civector>(m,v); } 00214 INLINE civector operator *(const imatrix_slice &ms,const cvector &v) 00215 #if(CXSC_INDEX_CHECK) 00216 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00217 #else 00218 throw() 00219 #endif 00220 { return _msvcimult<imatrix_slice,cvector,civector>(ms,v); } 00221 00222 } // namespace cxsc 00223 00224 #endif 00225