00001 //============================================================================= 00002 /*! return a transposed row vector */ 00003 inline drovector t(const _dcovector& covec) 00004 {VERBOSE_REPORT; 00005 _drovector rovec; 00006 rovec.l =covec.l; 00007 rovec.cap =covec.cap; 00008 delete [] rovec.array; 00009 rovec.array =covec.array; 00010 00011 covec.nullify(); 00012 return rovec; 00013 } 00014 00015 //============================================================================= 00016 /*! return its Euclidean norm */ 00017 inline double nrm2(const _dcovector& vec) 00018 {VERBOSE_REPORT; 00019 double val( dnrm2_(vec.l, vec.array, 1) ); 00020 vec.destroy(); 00021 return val; 00022 } 00023 00024 //============================================================================= 00025 /*! return the index of element having the largest absolute value 00026 in 0-based numbering system */ 00027 inline long idamax(const _dcovector& vec) 00028 {VERBOSE_REPORT; 00029 long i( idamax_(vec.l, vec.array, 1) -1 ); 00030 vec.destroy(); 00031 return i; 00032 } 00033 00034 //============================================================================= 00035 /*! return its largest absolute value */ 00036 inline double damax(const _dcovector& vec) 00037 {VERBOSE_REPORT; 00038 double val( vec.array[idamax_(vec.l, vec.array, 1)-1] ); 00039 vec.destroy(); 00040 return val; 00041 }