Main Page | Class List | File List | Class Members | File Members | Related Pages

_drovector Class Reference

Smart-Temporary double-precision row vector class (DO NOT USE). More...

#include <_drovector.hpp>

List of all members.

Public Member Functions

 _drovector ()
 _drovector (const _drovector &)
 _drovector (const drovector &)
 _drovector (const long &)
 ~_drovector ()
CPPSL_double operator() (const long &) const
void destroy () const

Public Attributes

long L
 global vector size

long Ll
 local vector size

long Desc [9]
 vector description

double * Array
 1D array to store vector data


Friends

class dgematrix
class _dgematrix
class dcovector
class _dcovector
class drovector
std::ostream & operator<< (std::ostream &, const _drovector &)
const _drovectoroperator+ (const _drovector &)
_drovector operator- (const _drovector &)
_drovector operator+ (const drovector &, const drovector &)
_drovector operator+ (const drovector &, const _drovector &)
_drovector operator+ (const _drovector &, const drovector &)
_drovector operator+ (const _drovector &, const _drovector &)
_drovector operator- (const drovector &, const drovector &)
_drovector operator- (const drovector &, const _drovector &)
_drovector operator- (const _drovector &, const drovector &)
_drovector operator- (const _drovector &, const _drovector &)
_drovector operator * (const drovector &, const dgematrix &)
_drovector operator * (const drovector &, const _dgematrix &)
_drovector operator * (const _drovector &, const dgematrix &)
_drovector operator * (const _drovector &, const _dgematrix &)
_drovector operator * (const double &, const drovector &)
_drovector operator * (const double &, const _drovector &)
_drovector operator * (const drovector &, const double &)
_drovector operator * (const _drovector &, const double &)
_dgematrix operator * (const dcovector &, const _drovector &)
_dgematrix operator * (const _dcovector &, const _drovector &)
double operator * (const _drovector &, const dcovector &)
double operator * (const _drovector &, const _dcovector &)
_drovector operator/ (const drovector &, const double &)
_drovector operator/ (const _drovector &, const double &)
double operator% (const drovector &, const _drovector &)
double operator% (const _drovector &, const drovector &)
double operator% (const _drovector &, const _drovector &)


Detailed Description

Smart-Temporary double-precision row vector class (DO NOT USE).

Definition at line 3 of file _drovector.hpp.


Constructor & Destructor Documentation

_drovector::_drovector  )  [inline]
 

_drovector constructor

Definition at line 3 of file _drovector-constructor.hpp.

References Array, Desc, L, and Ll.

00004 {
00005   //////// initialize ////////
00006   L =0;
00007   Ll =0;
00008   Desc[0]=1; Desc[1]=icontxt; Desc[2]=0; Desc[3]=0; Desc[4]=mb; Desc[5]=nb;
00009   Desc[6]=0; Desc[7]=0; Desc[8]=1;
00010   Array =new double[0];
00011   
00012 #ifdef  CPPSL_DEBUG
00013   std::cerr << "# [NOTE] _drovector::_drovector() "
00014             << "A new 0x0 vector at " << Array << " has been made."
00015             << std::endl;
00016 #endif//CPPSL_DEBUG
00017 }

_drovector::_drovector const _drovector vec  )  [inline]
 

_drovector copy constructor

Definition at line 21 of file _drovector-constructor.hpp.

References Array, Desc, L, and Ll.

00022 {
00023   //////// initialize ////////
00024   L =vec.L;
00025   Ll =vec.Ll;
00026   for(int i=0; i<9; i++){ Desc[i] =vec.Desc[i]; }
00027   Array =vec.Array;
00028   
00029 #ifdef  CPPSL_DEBUG
00030   std::cerr << "# [NOTE] _drovector::_drovector(const _drovector&) "
00031             << "A new vector pointing at " << Array << " has been made."
00032             << std::endl;
00033 #endif//CPPSL_DEBUG
00034 }

_drovector::_drovector const drovector vec  )  [inline]
 

_drovector constructor to cast drovector

Definition at line 38 of file _drovector-constructor.hpp.

References drovector::Array, Array, drovector::Desc, Desc, drovector::L, L, drovector::Ll, and Ll.

00039 {
00040   //////// initialize ////////
00041   L =vec.L;
00042   Ll =vec.Ll;
00043   for(int i=0; i<9; i++){ Desc[i] =vec.Desc[i]; }
00044   Array =new double[Ll];
00045   
00046   //////// copy ////////
00047   dcopy_(Ll, vec.Array, 1, Array, 1);
00048   
00049 #ifdef  CPPSL_DEBUG
00050   std::cerr << "# [NOTE] _drovector::_drovector(const __drovector&) "
00051             << "A new vector at " << Array << " has been made." << std::endl;
00052 #endif//CPPSL_DEBUG
00053 }

_drovector::_drovector const long &  _l  )  [inline]
 

_drovector constructor with size specification

Definition at line 57 of file _drovector-constructor.hpp.

References Array, Desc, L, and Ll.

00058 {
00059 #ifdef  CPPSL_DEBUG
00060   if( _l<0 ){
00061     std::cerr << "[ERROR] _drovector::_drovector(const long&)" << std::endl
00062               << "Vector size must be positive integers. " << std::endl
00063               << "Your input was (" << _l << ")." << std::endl;
00064     exit(1);
00065   }
00066 #endif//CPPSL_DEBUG
00067   
00068   //////// initialize ////////
00069   L =_l;
00070   long nl(numroc_(L, nb, mycol, 0, npcol));
00071   if(myrow==0){ Ll=nl; } else{ Ll=0; }
00072   Desc[0]=1; Desc[1]=icontxt; Desc[2]=L; Desc[3]=1; Desc[4]=mb; Desc[5]=nb;
00073   Desc[6]=0; Desc[7]=0; Desc[8]=1;
00074   Array =new double[Ll];
00075   
00076 #ifdef  CPPSL_DEBUG
00077   std::cerr << "# [NOTE] _drovector::_drovector(const long&) "
00078             << "A new vector at " << Array << " has been made." << std::endl;
00079 #endif//CPPSL_DEBUG
00080 }

_drovector::~_drovector  )  [inline]
 

_drovector destructor

Definition at line 88 of file _drovector-constructor.hpp.

00089 {
00090 #ifdef  CPPSL_DEBUG
00091   std::cerr << "# [NOTE] _drovector::~_drovector() "
00092             << "A _drovector is going to be destructed." << std::endl;
00093 #endif//CPPSL_DEBUG
00094   //////// do nothing ////////
00095 }


Member Function Documentation

CPPSL_double _drovector::operator() const long &  i  )  const [inline]
 

operator() for const object

Definition at line 3 of file _drovector-io.hpp.

References Array, Desc, and L.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( i<0 || L<=i ){
00007     std::cerr << "[ERROR] _drovector::operator()(const long&)"
00008               << std::endl
00009               << "The required component is out of the vector size."
00010               << std::endl
00011               << "Your input was (" << i << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   return CPPSL_double( Array, 0, i, Desc );
00017 }

void _drovector::destroy  )  const [inline]
 

destroy all the vector data

Definition at line 3 of file _drovector-misc.hpp.

References Array.

Referenced by operator *(), operator%(), operator+(), drovector::operator+=(), operator-(), drovector::operator-=(), and operator<<().

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   std::cerr << "# [NOTE] _drovector::destroy() "
00007             << " An array at " << Array << " is going to be destroyed."
00008             << std::endl;
00009 #endif//CPPSL_DEBUG
00010   
00011   delete [] Array;
00012 }


Friends And Related Function Documentation

friend class dgematrix [friend]
 

Definition at line 77 of file _drovector.hpp.

friend class _dgematrix [friend]
 

Definition at line 78 of file _drovector.hpp.

friend class dcovector [friend]
 

Definition at line 81 of file _drovector.hpp.

friend class _dcovector [friend]
 

Definition at line 82 of file _drovector.hpp.

friend class drovector [friend]
 

Definition at line 83 of file _drovector.hpp.

std::ostream& operator<< std::ostream &  s,
const _drovector vec
[friend]
 

Definition at line 24 of file _drovector-io.hpp.

00025 {
00026   for(long i=0; i<vec.Ll; i++){ s << " " << vec(i); }
00027   s << std::endl;
00028   
00029   vec.destroy();
00030   return s;
00031 }

const _drovector& operator+ const _drovector vec  )  [friend]
 

+_drovector operator

Definition at line 3 of file _drovector-unary.hpp.

00004 {
00005   return vec;
00006 }

_drovector operator- const _drovector vec  )  [friend]
 

-_drovector operator

Definition at line 10 of file _drovector-unary.hpp.

00011 {
00012   for(long i=0; i<vec.Ll; i++){ vec.Array[i] =-vec.Array[i]; }
00013   
00014   return vec;
00015 }

_drovector operator+ const drovector vecA,
const drovector vecB
[friend]
 

drovector+drovector operator

Definition at line 64 of file drovector-drovector.hpp.

00065 {
00066 #ifdef  CPPSL_DEBUG
00067   if( vecA.L!=vecB.L ){
00068     std::cerr << "[ERROR] operator+(const drovector&, const drovector&)"
00069               << std::endl
00070               << "These two vectors can not make a sumation." << std::endl
00071               << "Your input was (" << vecA.L << ") + (" << vecB.L << ")."
00072               << std::endl;
00073     exit(1);
00074   }
00075 #endif//CPPSL_DEBUG
00076   
00077   _drovector newvec(vecA.L);
00078   for(long i=0; i<newvec.Ll; i++){
00079     newvec.Array[i] =vecA.Array[i]+vecB.Array[i];
00080   }
00081   
00082   return newvec;
00083 }

_drovector operator+ const drovector vecA,
const _drovector vecB
[friend]
 

drovector+_drovector operator

Definition at line 64 of file drovector-_drovector.hpp.

00065 {
00066 #ifdef  CPPSL_DEBUG
00067   if( vecA.L!=vecB.L ){
00068     std::cerr << "[ERROR] operator+(const drovector&, const _drovector&)"
00069               << std::endl
00070               << "These two vectors can not make a sumation." << std::endl
00071               << "Your input was (" << vecA.L << ") + (" << vecB.L << ")."
00072               << std::endl;
00073     exit(1);
00074   }
00075 #endif//CPPSL_DEBUG
00076   
00077   for(long i=0; i<vecA.Ll; i++){ vecB.Array[i] +=vecA.Array[i]; }
00078   
00079   return vecB;
00080 }

_drovector operator+ const _drovector vecA,
const drovector vecB
[friend]
 

_drovector+drovector operator

Definition at line 3 of file _drovector-drovector.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( vecA.L!=vecB.L ){
00007     std::cerr << "[ERROR] operator+(const _drovector&, const drovector&)"
00008               << std::endl
00009               << "These two vectors can not make a sumation." << std::endl
00010               << "Your input was (" << vecA.L << ") + (" << vecB.L << ")."
00011               << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   for(int i=0; i<vecA.Ll; i++){ vecA.Array[i] +=vecB.Array[i]; }
00017   
00018   return vecA;
00019 }

_drovector operator+ const _drovector vecA,
const _drovector vecB
[friend]
 

_drovector+_drovector operator

Definition at line 3 of file _drovector-_drovector.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( vecA.L!=vecB.L ){
00007     std::cerr << "[ERROR] operator+(const _drovector&, const _drovector&)"
00008               << std::endl
00009               << "These two vectors can not make a sumation." << std::endl
00010               << "Your input was (" << vecA.L << ") + (" << vecB.L << ")."
00011               << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   for(long i=0; i<vecA.Ll; i++){ vecA.Array[i] +=vecB.Array[i]; }
00017   
00018   vecB.destroy();
00019   return vecA;
00020 }

_drovector operator- const drovector vecA,
const drovector vecB
[friend]
 

drovector-drovector operator

Definition at line 87 of file drovector-drovector.hpp.

00088 {
00089 #ifdef  CPPSL_DEBUG
00090   if( vecA.L!=vecB.L ){
00091     std::cerr << "[ERROR] operator-(const drovector&, const drovector&)"
00092               << std::endl
00093               << "These two vectors can not make a subtraction." << std::endl
00094               << "Your input was (" << vecA.L << ") - (" << vecB.L << ")."
00095               << std::endl;
00096     exit(1);
00097   }
00098 #endif//CPPSL_DEBUG
00099   
00100   _drovector newvec(vecA.L);
00101   for(long i=0; i<newvec.Ll; i++){
00102     newvec.Array[i] =vecA.Array[i]-vecB.Array[i];
00103   }
00104   
00105   return newvec;
00106 }

_drovector operator- const drovector vecA,
const _drovector vecB
[friend]
 

drovector-_drovector operator

Definition at line 84 of file drovector-_drovector.hpp.

00085 {
00086 #ifdef  CPPSL_DEBUG
00087   if( vecA.L!=vecB.L ){
00088     std::cerr << "[ERROR] operator-(const drovector&, const _drovector&)"
00089               << std::endl
00090               << "These two vectors can not make a subtraction." << std::endl
00091               << "Your input was (" << vecA.L << ") - (" << vecB.L << ")."
00092               << std::endl;
00093     exit(1);
00094   }
00095 #endif//CPPSL_DEBUG
00096   
00097   for(long i=0; i<vecA.Ll; i++){
00098     vecB.Array[i] =vecA.Array[i]-vecB.Array[i];
00099   }
00100   
00101   return vecB;
00102 }

_drovector operator- const _drovector vecA,
const drovector vecB
[friend]
 

_drovector-drovector operator

Definition at line 23 of file _drovector-drovector.hpp.

00024 {
00025 #ifdef  CPPSL_DEBUG
00026   if( vecA.L!=vecB.L ){
00027     std::cerr << "[ERROR] operator-(const _drovector&, const drovector&)"
00028               << std::endl
00029               << "These two vectors can not make a subtraction." << std::endl
00030               << "Your input was (" << vecA.L << ") - (" << vecB.L << ")."
00031               << std::endl;
00032     exit(1);
00033   }
00034 #endif//CPPSL_DEBUG
00035   
00036   for(int i=0; i<vecA.Ll; i++){ vecA.Array[i] -=vecB.Array[i]; }
00037   
00038   return vecA;
00039 }

_drovector operator- const _drovector vecA,
const _drovector vecB
[friend]
 

_drovector-_drovector operator

Definition at line 24 of file _drovector-_drovector.hpp.

00025 {
00026 #ifdef  CPPSL_DEBUG
00027   if( vecA.L!=vecB.L ){
00028     std::cerr << "[ERROR] operator-(const _drovector&, const _drovector&)"
00029               << std::endl
00030               << "These two vectors can not make a subtraction." << std::endl
00031               << "Your input was (" << vecA.L << ") - (" << vecB.L << ")."
00032               << std::endl;
00033     exit(1);
00034   }
00035 #endif//CPPSL_DEBUG
00036   
00037   for(long i=0; i<vecA.Ll; i++){ vecA.Array[i] -=vecB.Array[i]; }
00038   
00039   vecB.destroy();
00040   return vecA;
00041 }

_drovector operator * const drovector vec,
const dgematrix mat
[friend]
 

drovector*dgematrix operator

Definition at line 3 of file drovector-dgematrix.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( vec.L!=mat.M ){
00007     std::cerr << "[ERROR] operator*(const drovector&, const dgematrix&)"
00008               << std::endl
00009               << "These vector and matrix can not make a product." << std::endl
00010               << "Your input was (" << vec.L << ") * ("
00011               << mat.M << "x" << mat.N << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _drovector newvec(mat.N);
00017   pdgemv_( 'T', mat.M, mat.N, 1.0, mat.Array, 1, 1, mat.Desc,
00018            vec.Array, 1, 1, vec.Desc, 1, 0.0,
00019            newvec.Array, 1, 1, newvec.Desc, 1 );
00020   
00021   return newvec;
00022 }

_drovector operator * const drovector vec,
const _dgematrix mat
[friend]
 

drovector*_dgematrix operator

Definition at line 3 of file drovector-_dgematrix.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( vec.L!=mat.M ){
00007     std::cerr << "[ERROR] operator*(const drovector&, const _dgematrix&)"
00008               << std::endl
00009               << "These vector and matrix can not make a product." << std::endl
00010               << "Your input was (" << vec.L << ") * ("
00011               << mat.M << "x" << mat.N << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _drovector newvec(mat.N);
00017   pdgemv_( 'T', mat.M, mat.N, 1.0, mat.Array, 1, 1, mat.Desc,
00018            vec.Array, 1, 1, vec.Desc, 1, 0.0,
00019            newvec.Array, 1, 1, newvec.Desc, 1 );
00020   
00021   mat.destroy();
00022   return newvec;
00023 }

_drovector operator * const _drovector vec,
const dgematrix mat
[friend]
 

_drovector*dgematrix operator

Definition at line 3 of file _drovector-dgematrix.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( vec.L!=mat.M ){
00007     std::cerr << "[ERROR] operator*(const _drovector&, const dgematrix&)"
00008               << std::endl
00009               << "These vector and matrix can not make a product." << std::endl
00010               << "Your input was (" << vec.L << ") * ("
00011               << mat.M << "x" << mat.N << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _drovector newvec(mat.N);
00017   pdgemv_( 'T', mat.M, mat.N, 1.0, mat.Array, 1, 1, mat.Desc,
00018            vec.Array, 1, 1, vec.Desc, 1, 0.0,
00019            newvec.Array, 1, 1, newvec.Desc, 1 );
00020   
00021   vec.destroy();
00022   return newvec;
00023 }

_drovector operator * const _drovector vec,
const _dgematrix mat
[friend]
 

_drovector*_dgematrix operator

Definition at line 3 of file _drovector-_dgematrix.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( vec.L!=mat.M ){
00007     std::cerr << "[ERROR] operator*(const _drovector&, const _dgematrix&)"
00008               << std::endl
00009               << "These vector and matrix can not make a product." << std::endl
00010               << "Your input was (" << vec.L << ") * ("
00011               << mat.M << "x" << mat.N << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _drovector newvec(mat.N);
00017   pdgemv_( 'T', mat.M, mat.N, 1.0, mat.Array, 1, 1, mat.Desc,
00018            vec.Array, 1, 1, vec.Desc, 1, 0.0,
00019            newvec.Array, 1, 1, newvec.Desc, 1 );
00020   
00021   vec.destroy();
00022   mat.destroy();
00023   return newvec;
00024 }

_drovector operator * const double &  d,
const drovector vec
[friend]
 

double*drovector operator

Definition at line 3 of file double-drovector.hpp.

00004 {
00005   _drovector newvec(vec.L);
00006   for(int i=0; i<vec.Ll; i++){ newvec.Array[i] =d*vec.Array[i]; }
00007   
00008   return newvec;
00009 
00010 }

_drovector operator * const double &  d,
const _drovector vec
[friend]
 

double*_drovector operator

Definition at line 3 of file double-_drovector.hpp.

00004 {
00005   dscal_(vec.Ll, d, vec.Array, 1);
00006   
00007   return vec;
00008 }

_drovector operator * const drovector vec,
const double &  d
[friend]
 

drovector*double operator

Definition at line 23 of file drovector-double.hpp.

00024 {
00025   _drovector newvec(vec.L);
00026   for(int i=0; i<vec.Ll; i++){ newvec.Array[i] =vec.Array[i]*d; }
00027   
00028   return newvec;
00029 }

_drovector operator * const _drovector vec,
const double &  d
[friend]
 

_drovector*double operator

Definition at line 3 of file _drovector-double.hpp.

00004 {
00005   dscal_(vec.Ll, d, vec.Array, 1);
00006   
00007   return vec;
00008 }

_dgematrix operator * const dcovector covec,
const _drovector rovec
[friend]
 

dcovector*_drovector operator

Definition at line 3 of file dcovector-_drovector.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(covec.L!=rovec.L){
00007     std::cerr << "[ERROR] operator*(const dcovector&, const _drovector&)"
00008               << std::endl
00009               << "These two vectors can not make a product." << std::endl
00010               << "Your input was (" << covec.L << ") * (" << rovec.L << ")."
00011               << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _dgematrix newmat(covec.L, covec.L);
00017   for(long i=0; i<newmat.M; i++){ for(long j=0; j<newmat.N; j++){
00018     newmat(i,j) =covec(i)*rovec(j);
00019   }}
00020   
00021   rovec.destroy();
00022   return newmat;
00023 }

_dgematrix operator * const _dcovector covec,
const _drovector rovec
[friend]
 

_dcovector*_drovector operator

Definition at line 3 of file _dcovector-_drovector.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(covec.L!=rovec.L){
00007     std::cerr << "[ERROR] operator*(const _dcovector&, const _drovector&)"
00008               << std::endl
00009               << "These two vectors can not make a product." << std::endl
00010               << "Your input was (" << covec.L << ") * (" << rovec.L << ")."
00011               << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _dgematrix newmat(covec.L, covec.L);
00017   for(long i=0; i<newmat.M; i++){ for(long j=0; j<newmat.N; j++){
00018     newmat(i,j) =covec(i)*rovec(j);
00019   }}
00020   
00021   covec.destroy();
00022   rovec.destroy();
00023   return newmat;
00024 }

double operator * const _drovector rovec,
const dcovector covec
[friend]
 

_drovector*dcovector operator

Definition at line 3 of file _drovector-dcovector.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(rovec.L!=covec.L){
00007     std::cerr << "[ERROR] operator*(const _drovector&, const dcovector&)"
00008               << std::endl
00009               << "These two vectors can not make a product." << std::endl
00010               << "Your input was (" << rovec.L << ") * (" << covec.L << ")."
00011               << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   double val;
00017   pddot_( rovec.L, val,
00018           rovec.Array, 1, 1, rovec.Desc, 1, covec.Array, 1, 1, covec.Desc, 1 );
00019   
00020   rovec.destroy();
00021   return val;
00022 }

double operator * const _drovector rovec,
const _dcovector covec
[friend]
 

_drovector*_dcovector operator

Definition at line 3 of file _drovector-_dcovector.hpp.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(rovec.L!=covec.L){
00007     std::cerr << "[ERROR] operator*(const _drovector&, const _dcovector&)"
00008               << std::endl
00009               << "These two vectors can not make a product." << std::endl
00010               << "Your input was (" << rovec.L << ") * (" << covec.L << ")."
00011               << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   double val;
00017   pddot_( rovec.L, val,
00018           rovec.Array, 1, 1, rovec.Desc, 1, covec.Array, 1, 1, covec.Desc, 1 );
00019   
00020   rovec.destroy();
00021   covec.destroy();
00022   return val;
00023 }

_drovector operator/ const drovector vec,
const double &  d
[friend]
 

drovector/double operator

Definition at line 33 of file drovector-double.hpp.

00034 {
00035   double inv_d(1./d);
00036   
00037   _drovector newvec(vec.L);
00038   for(int i=0; i<vec.Ll; i++){ newvec.Array[i] =vec.Array[i]*inv_d; }
00039   
00040   return newvec;
00041 }

_drovector operator/ const _drovector vec,
const double &  d
[friend]
 

_drovector/double operator

Definition at line 12 of file _drovector-double.hpp.

00013 {
00014   dscal_(vec.Ll, 1./d, vec.Array, 1);
00015   
00016   return vec;
00017 }

double operator% const drovector vecA,
const _drovector vecB
[friend]
 

drovector*_drovector^T operator (inner product)

Definition at line 106 of file drovector-_drovector.hpp.

00107 {
00108 #ifdef  CPPSL_DEBUG
00109   if( vecA.L!=vecB.L ){
00110     std::cerr << "[ERROR] operator%(const drovector&, const _drovector&)"
00111               << std::endl
00112               << "These two vectors can not make a dot product." << std::endl
00113               << "Your input was (" << vecA.L << ") % (" << vecB.L << ")."
00114               << std::endl;
00115     exit(1);
00116   }
00117 #endif//CPPSL_DEBUG
00118   
00119   double val;
00120   pddot_( vecA.L, val,
00121           vecA.Array, 1, 1, vecA.Desc, 1, vecB.Array, 1, 1, vecB.Desc, 1 );
00122   
00123   vecB.destroy();
00124   return val;
00125 }

double operator% const _drovector vecA,
const drovector vecB
[friend]
 

_drovector*drovector^T operator (inner product)

Definition at line 43 of file _drovector-drovector.hpp.

00044 {
00045 #ifdef  CPPSL_DEBUG
00046   if( vecA.L!=vecB.L ){
00047     std::cerr << "[ERROR] operator%(const _drovector&, const drovector&)"
00048               << std::endl
00049               << "These two vectors can not make a dot product." << std::endl
00050               << "Your input was (" << vecA.L << ") % (" << vecB.L << ")."
00051               << std::endl;
00052     exit(1);
00053   }
00054 #endif//CPPSL_DEBUG
00055   
00056   double val;
00057   pddot_( vecA.L, val,
00058           vecA.Array, 1, 1, vecA.Desc, 1, vecB.Array, 1, 1, vecB.Desc, 1 );
00059   
00060   vecA.destroy();
00061   return val;
00062 }

double operator% const _drovector vecA,
const _drovector vecB
[friend]
 

_drovector*_drovector^T operator (inner product)

Definition at line 45 of file _drovector-_drovector.hpp.

00046 {
00047 #ifdef  CPPSL_DEBUG
00048   if( vecA.L!=vecB.L ){
00049     std::cerr << "[ERROR] operator%(const _drovector&, const _drovector&)"
00050               << std::endl
00051               << "These two vectors can not make a dot product." << std::endl
00052               << "Your input was (" << vecA.L << ") % (" << vecB.L << ")."
00053               << std::endl;
00054     exit(1);
00055   }
00056 #endif//CPPSL_DEBUG
00057   
00058   double val;
00059   pddot_( vecA.L, val,
00060           vecA.Array, 1, 1, vecA.Desc, 1, vecB.Array, 1, 1, vecB.Desc, 1 );
00061   
00062   vecA.destroy();
00063   vecB.destroy();
00064   return val;
00065 }


Member Data Documentation

long _drovector::L [mutable]
 

global vector size

Definition at line 7 of file _drovector.hpp.

Referenced by _drovector(), operator *(), operator%(), operator()(), operator+(), drovector::operator+=(), operator-(), drovector::operator-=(), and drovector::shallow_copy().

long _drovector::Ll [mutable]
 

local vector size

Definition at line 8 of file _drovector.hpp.

Referenced by _drovector(), operator *(), operator+(), operator-(), operator/(), operator<<(), and drovector::shallow_copy().

long _drovector::Desc[9] [mutable]
 

vector description

Definition at line 9 of file _drovector.hpp.

Referenced by _drovector(), operator *(), operator%(), operator()(), and drovector::shallow_copy().

double* _drovector::Array [mutable]
 

1D array to store vector data

Definition at line 10 of file _drovector.hpp.

Referenced by _drovector(), destroy(), operator *(), operator%(), operator()(), operator+(), drovector::operator+=(), operator-(), drovector::operator-=(), operator/(), and drovector::shallow_copy().


The documentation for this class was generated from the following files:
Generated on Sat Jan 31 19:25:45 2004 for CPPScaLapack by doxygen 1.3.5