![]() |
Object-oriented Scientific Computing Library: Version 0.910
|
00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006-2012, Andrew W. Steiner 00005 00006 This file is part of O2scl. 00007 00008 O2scl is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 O2scl is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with O2scl. If not, see <http://www.gnu.org/licenses/>. 00020 00021 ------------------------------------------------------------------- 00022 */ 00023 #ifndef O2SCL_CBLAS_H 00024 #define O2SCL_CBLAS_H 00025 00026 #include <cmath> 00027 #include <o2scl/permutation.h> 00028 00029 /** \brief Namespace for O2scl CBLAS function templates with operator[] 00030 00031 <b>Level-1 BLAS functions</b> 00032 00033 Some functionality which would otherwise appear here is 00034 already given in \ref vector.h. 00035 - The equivalent of <tt>dcopy()</tt> is given in \ref vector_copy() 00036 except that the ordering is reversed (in \ref vector_copy() the 00037 source preceeds the destination in the function argument list). 00038 - The equivalent of <tt>dswap()</tt> is given in \ref vector_swap(). 00039 - The equivalent of <tt>idamax()</tt> is given in 00040 \ref vector_max_index(). 00041 00042 <b>Level-2 BLAS functions</b> 00043 00044 Currently only \ref dgemv(), \ref dtrmv(), and \ref dtrsv() are 00045 implemented. 00046 00047 <b>Level-3 BLAS functions</b> 00048 00049 Currently only \ref dgemm() is implemented. 00050 00051 <b>Helper BLAS functions</b> 00052 00053 There are several basic BLAS functions which are helpful 00054 to operate on only a part of a vector or matrix to 00055 ensure that the linear algebra routines are flexible 00056 with the types that they can handle. 00057 00058 The subvector functions operate only one set of adjacent 00059 vector elements. For a vector defined by 00060 with 00061 \f[ 00062 {\vec x} = 00063 \left( 00064 \begin{array}{c} 00065 x_0 \\ 00066 x_1 \\ 00067 . \\ 00068 . \\ 00069 x_{\mathrm{ie}} \\ 00070 x_{\mathrm{ie}+1} \\ 00071 . \\ 00072 . \\ 00073 x_{\mathrm{N}-1} \\ 00074 x_{\mathrm{N}} \\ 00075 x_{\mathrm{N}+1} \\ 00076 . \\ 00077 . 00078 \end{array} 00079 \right) 00080 \f] 00081 the functions with suffix <tt>subvec</tt> operate only on 00082 elements from \f$ x_{\mathrm{ie}} \f$ to \f$ x_{\mathrm{N}-1} \f$ 00083 (inclusive). 00084 00085 The subcolumn functions operate only on a part of a column of 00086 a matrix. For a matrix defined by 00087 \f[ 00088 m = \left( 00089 \begin{array}{ccccccc} 00090 m_{0,0} & m_{0,1} & . & . & m_{0,\mathrm{ic}} & . & . \\ 00091 m_{1,0} & m_{1,1} & . & . & m_{1,\mathrm{ic}} & . & . \\ 00092 . & . & . & . & . & . & . \\ 00093 . & . & . & . & m_{\mathrm{ir},\mathrm{ic}} & . & . \\ 00094 . & . & . & . & m_{\mathrm{ir}+1,\mathrm{ic}} & . & . \\ 00095 . & . & . & . & . & . & . \\ 00096 . & . & . & . & . & . & . \\ 00097 . & . & . & . & m_{\mathrm{N}-1,\mathrm{ic}} & . & . \\ 00098 . & . & . & . & m_{\mathrm{N},\mathrm{ic}} & . & . \\ 00099 . & . & . & . & m_{\mathrm{N}+1,\mathrm{ic}} & . & . \\ 00100 . & . & . & . & . & . & . \\ 00101 \end{array} 00102 \right) 00103 \f] 00104 the functions with suffix <tt>subcol</tt> operate only 00105 on elements in the column from \f$ m_{\mathrm{ir},\mathrm{ic}} \f$ 00106 to \f$ m_{\mathrm{N}-1,\mathrm{ic}} \f$ inclusive. 00107 00108 The subrow functions operate only on a part of a row of 00109 a matrix. For a matrix defined by 00110 \f[ 00111 m = \left( 00112 \begin{array}{ccccccccccc} 00113 m_{0,0} & m_{0,1} & . & . & . & . & . & . & . & . & . \\ 00114 m_{1,0} & m_{1,1} & . & . & . & . & . & . & . & . & . \\ 00115 . & . & . & . & . & . & . & . & . & . & . \\ 00116 . & . & . & . & . & . & . & . & . & . & . \\ 00117 m_{\mathrm{ir},0} & . & . & 00118 m_{\mathrm{ir},\mathrm{ic}} & 00119 m_{\mathrm{ir},\mathrm{ic}+1} & 00120 . & . & 00121 m_{\mathrm{ir},\mathrm{N}-1} & 00122 m_{\mathrm{ir},\mathrm{N}} & 00123 m_{\mathrm{ir},\mathrm{N}+1} & 00124 . \\ 00125 . & . & . & . & . & . & . & . & . & . & . \\ 00126 \end{array} 00127 \right) 00128 \f] 00129 the functions with suffix <tt>subrow</tt> operate only 00130 on elements in the column from \f$ m_{\mathrm{ir},\mathrm{ic}} \f$ 00131 to \f$ m_{\mathrm{ir},\mathrm{N}-1} \f$ inclusive. 00132 00133 This namespace is documented inside <tt>src/linalg/cblas.h</tt>. 00134 */ 00135 namespace o2scl_cblas { 00136 00137 #define O2SCL_IX(V,i) V[i] 00138 #define O2SCL_IX2(M,i,j) M[i][j] 00139 #include <o2scl/cblas_base.h> 00140 #undef O2SCL_IX 00141 #undef O2SCL_IX2 00142 00143 } 00144 00145 /** 00146 \brief Namespace for O2scl CBLAS function templates with operator() 00147 00148 This namespace contains an identical copy of all the functions given 00149 in the \ref o2scl_cblas namespace, but perform array indexing 00150 with \c operator() rather than \c operator[]. See \ref o2scl_cblas 00151 for the function listing and documentation. 00152 */ 00153 namespace o2scl_cblas_paren { 00154 00155 #define O2SCL_IX(V,i) V(i) 00156 #define O2SCL_IX2(M,i,j) M(i,j) 00157 #include <o2scl/cblas_base.h> 00158 #undef O2SCL_IX 00159 #undef O2SCL_IX2 00160 00161 } 00162 00163 #endif
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).