|
DenseLinAlgPack: Concreate C++ Classes for Dense Blas-Compatible Linear Algebra Version of the Day
|
00001 // @HEADER 00002 // *********************************************************************** 00003 // 00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization 00005 // Copyright (2003) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 // @HEADER 00028 00029 #ifndef LIN_ALG_PACK_ASSERT_OP_H 00030 #define LIN_ALG_PACK_ASSERT_OP_H 00031 00032 #include "DenseLinAlgPack_Types.hpp" 00033 00034 namespace DenseLinAlgPack { 00035 00036 #ifdef LINALGPACK_CHECK_RHS_SIZES 00037 00038 00039 /* * @name Assertion functions for linear algebra operations. 00040 * 00041 * These functions check the sizes of the linear algebra 00042 * expressions and throw a std::length_error if 00043 * the sizes do not match. These functions 00044 * only perform there operations if #LINALGPACK_CHECK_RHS_SIZES# 00045 * is defined. 00046 */ 00047 // @{ 00048 00049 /* * @name Level 1 BLAS 00050 */ 00051 // @{ 00052 00054 void Vp_V_assert_sizes(size_type v_lhs_size, size_type v_rhs_size); 00055 00057 void VopV_assert_sizes(size_type v_rhs1_size, size_type v_rhs2_size); 00058 00060 void Mp_M_assert_sizes(size_type m_lhs_rows, size_type m_lhs_cols, BLAS_Cpp::Transp trans_lhs 00061 , size_type m_rhs_rows, size_type m_rhs_cols, BLAS_Cpp::Transp trans_rhs); 00062 00064 void MopM_assert_sizes(size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1 00065 , size_type m_rhs2_rows, size_type m_rhs2_cols, BLAS_Cpp::Transp trans_rhs2); 00066 00067 // end Level 1 BLAS 00068 // @} 00069 00070 /* * @name Level 2 BLAS 00071 */ 00072 // @{ 00073 00075 void MtV_assert_sizes(size_type m_rhs1_rows, size_type m_rhs1_cols 00076 , BLAS_Cpp::Transp trans_rhs1, size_type v_rhs2_size); 00077 00079 void Vp_MtV_assert_sizes(size_type v_lhs_size, size_type m_rhs1_rows 00080 , size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1, size_type v_rhs2_size); 00081 00082 // end Level 2 BLAS 00083 // @} 00084 00085 /* * @name Level 3 BLAS 00086 */ 00087 // @{ 00088 00090 void MtM_assert_sizes( 00091 size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1 00092 , size_type m_rhs2_rows, size_type m_rhs2_cols, BLAS_Cpp::Transp trans_rhs2); 00093 00095 void Mp_MtM_assert_sizes( 00096 size_type m_lhs_rows, size_type m_lhs_cols, BLAS_Cpp::Transp trans_lhs 00097 , size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1 00098 , size_type m_rhs2_rows, size_type m_rhs2_cols, BLAS_Cpp::Transp trans_rhs2); 00099 00100 // end Level 3 BLAS 00101 // @} 00102 00103 00104 // @} 00105 00106 #else 00107 00108 // inline definitions that do nothing 00109 00110 inline 00111 void Vp_V_assert_sizes(size_type v_lhs_size, size_type v_rhs_size) 00112 {} 00113 00114 inline 00115 void VopV_assert_sizes(size_type v_rhs1_size, size_type v_rhs2_size) 00116 {} 00117 00118 inline 00119 void Mp_M_assert_sizes(size_type m_lhs_rows, size_type m_lhs_cols, BLAS_Cpp::Transp trans_lhs 00120 , size_type m_rhs_rows, size_type m_rhs_cols, BLAS_Cpp::Transp trans_rhs) 00121 {} 00122 00123 inline 00124 void MopM_assert_sizes(size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1 00125 , size_type m_rhs2_rows, size_type m_rhs2_cols, BLAS_Cpp::Transp trans_rhs2) 00126 {} 00127 00128 inline 00129 void MtV_assert_sizes(size_type m_rhs1_rows, size_type m_rhs1_cols 00130 , BLAS_Cpp::Transp trans_rhs1, size_type v_rhs2_size) 00131 {} 00132 00133 inline 00134 void Vp_MtV_assert_sizes(size_type v_lhs_size, size_type m_rhs1_rows 00135 , size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1, size_type v_rhs2_size) 00136 {} 00137 00138 inline 00139 void MtM_assert_sizes( 00140 size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1 00141 , size_type m_rhs2_rows, size_type m_rhs2_cols, BLAS_Cpp::Transp trans_rhs2) 00142 {} 00143 00144 inline 00145 void Mp_MtM_assert_sizes( 00146 size_type m_lhs_rows, size_type m_lhs_cols, BLAS_Cpp::Transp trans_lhs 00147 , size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1 00148 , size_type m_rhs2_rows, size_type m_rhs2_cols, BLAS_Cpp::Transp trans_rhs2) 00149 {} 00150 00151 #endif 00152 00153 } // end namespace DenseLinAlgPack 00154 00155 #endif // LIN_ALG_PACK_ASSERT_OP_H
1.7.4