47 #include "ConstrainedOptPack_MatrixGenBanded.hpp"
48 #include "DenseLinAlgPack_AssertOp.hpp"
49 #include "DenseLinAlgPack_LinAlgOpPack.hpp"
50 #include "DenseLinAlgPack_BLAS_Cpp.hpp"
51 #include "MiWorkspacePack.h"
53 namespace ConstrainedOptPack {
61 ,
const release_resource_ptr_t& MB_release_resource_ptr
64 initialize(m,n,kl,ku,MB,MB_release_resource_ptr);
73 ,
const release_resource_ptr_t& MB_release_resource_ptr
80 throw std::invalid_argument(
81 "MatrixGenBanded::initialize(...): Error, "
82 "n must be 0 if m == 0" );
84 throw std::invalid_argument(
85 "MatrixGenBanded::initialize(...): Error, "
86 "kl must be 0 if m == 0" );
88 throw std::invalid_argument(
89 "MatrixGenBanded::initialize(...): Error, "
90 "ku must be 0 if m == 0" );
92 throw std::invalid_argument(
93 "MatrixGenBanded::initialize(...): Error, "
94 "MB must be NULL if m == 0" );
95 if( MB_release_resource_ptr.get() != NULL )
96 throw std::invalid_argument(
97 "MatrixGenBanded::initialize(...): Error, "
98 "MB_release_resource_ptr.get() must be NULL if m == 0" );
102 throw std::invalid_argument(
103 "MatrixGenBanded::initialize(...): Error, "
104 "kl + 1 can not be larger than m" );
106 throw std::invalid_argument(
107 "MatrixGenBanded::initialize(...): Error, "
108 "ku + 1 can not be larger than n" );
110 throw std::invalid_argument(
111 "MatrixGenBanded::initialize(...): Error, "
112 "MB must not be NULL if n > 0" );
122 MB_.bind(DMatrixSlice());
123 MB_release_resource_ptr_ = NULL;
149 return (ku_ + kl_ + 1) * n_ - ( (ku_+1) * (ku_+1) - (ku_+1) )/2 - ( (kl_+1) * (kl_+1) - (kl_+1) )/2;
154 return MatrixOp::output(out);
159 ,
const DVectorSlice& x, value_type b)
const
161 assert_initialized();
162 DenseLinAlgPack::Vp_MtV_assert_sizes( y->size(), n_, n_,
BLAS_Cpp::no_trans, x.size() );
163 BLAS_Cpp::gbmv(M_trans,m_,n_,kl_,ku_,a,MB_.col_ptr(1),MB_.max_rows(),x.raw_ptr(),x.stride()
164 ,b,y->raw_ptr(),y->stride());
169 ,
const SpVectorSlice& x, value_type b)
const
171 assert_initialized();
176 DVectorSlice* y, value_type a
179 ,
const DVectorSlice& x, value_type b)
const
181 assert_initialized();
186 DVectorSlice* y, value_type a
189 ,
const SpVectorSlice& x, value_type b)
const
191 assert_initialized();
197 void MatrixGenBanded::assert_initialized()
const
200 throw std::logic_error(
"MatrixGenBanded::assert_initialized(): Error, "
201 "not initialized!" );
void Vp_StPtMtV(DVectorSlice *vs_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, BLAS_Cpp::Transp M_rhs2_trans, const DVectorSlice &vs_rhs3, value_type beta) const
void Vp_StPtMtV(VectorMutable *v_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, const MatrixOp &M_rhs2, BLAS_Cpp::Transp M_rhs2_trans, const Vector &v_rhs3, value_type beta=1.0)
void initialize(size_type m=0, size_type n=0, size_type kl=0, size_type ku=0, DMatrixSlice *MB=NULL, const release_resource_ptr_t &MB_release_resource_ptr=NULL)
Initialize.
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta=1.0)
MatrixGenBanded(size_type m=0, size_type n=0, size_type kl=0, size_type ku=0, DMatrixSlice *MB=NULL, const release_resource_ptr_t &MB_release_resource_ptr=NULL)
Construct and Initialize.
void Vp_StMtV(DVectorSlice *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const DVectorSlice &vs_rhs2, value_type beta) const
std::ostream & output(std::ostream &out) const