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

_dcovector Class Reference

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

#include <_dcovector.hpp>

List of all members.

Public Member Functions

 _dcovector ()
 _dcovector (const _dcovector &)
 _dcovector (const dcovector &)
 _dcovector (const long &)
 ~_dcovector ()
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 drovector
class _drovector
std::ostream & operator<< (std::ostream &, const dcovector &)
const _dcovectoroperator+ (const _dcovector &)
_dcovector operator- (const _dcovector &)
_dcovector operator+ (const dcovector &, const dcovector &)
_dcovector operator+ (const dcovector &, const _dcovector &)
_dcovector operator+ (const _dcovector &, const dcovector &)
_dcovector operator+ (const _dcovector &, const _dcovector &)
_dcovector operator- (const dcovector &, const dcovector &)
_dcovector operator- (const dcovector &, const _dcovector &)
_dcovector operator- (const _dcovector &, const dcovector &)
_dcovector operator- (const _dcovector &, const _dcovector &)
_dcovector operator * (const dgematrix &, const dcovector &)
_dcovector operator * (const dgematrix &, const _dcovector &)
_dcovector operator * (const _dgematrix &, const dcovector &)
_dcovector operator * (const _dgematrix &, const _dcovector &)
_dcovector operator * (const dcovector &, const double &)
_dcovector operator * (const _dcovector &, const double &)
_dcovector operator * (const double &, const dcovector &)
_dcovector operator * (const double &, const _dcovector &)
_dgematrix operator * (const _dcovector &, const drovector &)
_dgematrix operator * (const _dcovector &, const _drovector &)
double operator * (const drovector &, const _dcovector &)
double operator * (const _drovector &, const _dcovector &)
_dcovector operator/ (const dcovector &, const double &)
_dcovector operator/ (const _dcovector &, const double &)
double operator% (const dcovector &, const _dcovector &)
double operator% (const _dcovector &, const dcovector &)
double operator% (const _dcovector &, const _dcovector &)


Detailed Description

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

Definition at line 3 of file _dcovector.hpp.


Constructor & Destructor Documentation

_dcovector::_dcovector  )  [inline]
 

_dcovector constructor

Definition at line 3 of file _dcovector-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]=max(1,Ll);
00010   Array =new double[0];
00011   
00012 #ifdef  CPPSL_DEBUG
00013   std::cerr << "# [NOTE] _dcovector::_dcovector() "
00014             << "A new 0x0 vector at " << Array
00015             << " has been made." << std::endl;
00016 #endif//CPPSL_DEBUG
00017 }

_dcovector::_dcovector const _dcovector vec  )  [inline]
 

_dcovector copy constructor

Definition at line 21 of file _dcovector-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] _dcovector::_dcovector(const _dcovector&) "
00031             << "A new vector pointing at " << Array << " has been made."
00032             << std::endl;
00033 #endif//CPPSL_DEBUG
00034 }

_dcovector::_dcovector const dcovector vec  )  [inline]
 

_dcovector constructor to cast dcovector

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

References dcovector::Array, Array, dcovector::Desc, Desc, dcovector::L, L, dcovector::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] _dcovector::_dcovector(const dcovector&) "
00051             << "A new vector has been made at "<< Array << "."
00052             << std::endl;
00053 #endif//CPPSL_DEBUG
00054 }

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

_dcovector constructor with size specification

Definition at line 58 of file _dcovector-constructor.hpp.

References Array, Desc, L, and Ll.

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

_dcovector::~_dcovector  )  [inline]
 

_dcovector destructor

Definition at line 89 of file _dcovector-constructor.hpp.

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


Member Function Documentation

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

operator() for const object

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

References Array, Desc, and L.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( i<0 || L<=i ){
00007     std::cerr << "[ERROR] dcovector::operator()(const long&) const"
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, i, 0, Desc );
00017 
00018 }

void _dcovector::destroy  )  const [inline]
 

destroy all the vector data

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

References Array.

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

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   std::cerr << "# [NOTE] _dcovector::destroy() const"
00007             << " An array at " << Array
00008             << " is going to be destroyed." << 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 _dcovector.hpp.

friend class _dgematrix [friend]
 

Definition at line 78 of file _dcovector.hpp.

friend class dcovector [friend]
 

Definition at line 81 of file _dcovector.hpp.

friend class drovector [friend]
 

Definition at line 82 of file _dcovector.hpp.

friend class _drovector [friend]
 

Definition at line 83 of file _dcovector.hpp.

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

Definition at line 66 of file dcovector-io.hpp.

00067 {
00068   for(long i=0; i<vec.L; i++){
00069     s << " " << vec(i) << std::endl;
00070   }
00071   
00072   return s;
00073 }

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

+dcovector operator

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

00004 {
00005   return vec;
00006 }

_dcovector operator- const _dcovector vec  )  [friend]
 

-dcovector operator

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

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

_dcovector operator+ const dcovector vecA,
const dcovector vecB
[friend]
 

dcovector+dcovector operator

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

00065 {
00066 #ifdef  CPPSL_DEBUG
00067   if(vecA.L!=vecB.L){
00068     std::cerr
00069       << "[ERROR] operator+(const dcovector&, const dcovector&)" << 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   
00076 #endif//CPPSL_DEBUG
00077 
00078   _dcovector newvec(vecA.L);
00079   for(int i=0; i<newvec.Ll; i++){
00080     newvec.Array[i] =vecA.Array[i]+vecB.Array[i];
00081   }
00082   
00083   return newvec;
00084 }

_dcovector operator+ const dcovector vecA,
const _dcovector vecB
[friend]
 

dcovector+_dcovector operator

Definition at line 64 of file dcovector-_dcovector.hpp.

00065 {
00066 #ifdef  CPPSL_DEBUG
00067   if(vecA.L!=vecB.L){
00068     std::cerr
00069       << "[ERROR] operator+(const dcovector&, const _dcovector&)" << 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(int i=0; i<vecA.Ll; i++){ vecB.Array[i] +=vecA.Array[i]; }
00078   
00079   return vecB;
00080 }

_dcovector operator+ const _dcovector vecA,
const dcovector vecB
[friend]
 

_dcovector+dcovector operator

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

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(vecA.L!=vecB.L){
00007     std::cerr
00008       << "[ERROR] operator+(const _dcovector&, const dcovector&)" << 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   
00015 #endif//CPPSL_DEBUG
00016 
00017   for(int i=0; i<vecA.Ll; i++){ vecA.Array[i] +=vecB.Array[i]; }
00018   
00019   return vecA;
00020 }

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

_dcovector+_dcovector operator

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

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(vecA.L!=vecB.L){
00007     std::cerr
00008       << "[ERROR] operator+(const _dcovector&, const _dcovector&)" << 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   vecB.destroy();
00019   return vecA;
00020 }

_dcovector operator- const dcovector vecA,
const dcovector vecB
[friend]
 

dcovector-dcovector operator

Definition at line 88 of file dcovector-dcovector.hpp.

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

_dcovector operator- const dcovector vecA,
const _dcovector vecB
[friend]
 

dcovector-_dcovector operator

Definition at line 84 of file dcovector-_dcovector.hpp.

00085 {
00086 #ifdef  CPPSL_DEBUG
00087   if(vecA.L!=vecB.L){
00088     std::cerr
00089       << "[ERROR] operator-(const dcovector&, const _dcovector&)" << 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(int i=0; i<vecA.Ll; i++){
00098     vecB.Array[i] =vecA.Array[i]-vecB.Array[i];
00099   }
00100   
00101   return vecB;
00102 }

_dcovector operator- const _dcovector vecA,
const dcovector vecB
[friend]
 

_dcovector-dcovector operator

Definition at line 24 of file _dcovector-dcovector.hpp.

00025 {
00026 #ifdef  CPPSL_DEBUG
00027   if(vecA.L!=vecB.L){
00028     std::cerr
00029       << "[ERROR] operator-(const _dcovector&, const dcovector&)" << 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(int i=0; i<vecA.Ll; i++){ vecA.Array[i] -=vecB.Array[i]; }
00038   
00039   return vecA;
00040 }

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

_dcovector-_dcovector operator

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

00025 {
00026 #ifdef  CPPSL_DEBUG
00027   if(vecA.L!=vecB.L){
00028     std::cerr
00029       << "[ERROR] operator-(const _dcovector&, const _dcovector&)" << 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(int i=0; i<vecA.Ll; i++){ vecA.Array[i] -=vecB.Array[i]; }
00038   
00039   vecB.destroy();
00040   return vecA;
00041 }

_dcovector operator * const dgematrix mat,
const dcovector vec
[friend]
 

dgematrix*dcovector operator

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

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(mat.N!=vec.L){
00007     std::cerr << "[ERROR] operator*(const dgematrix&, const dcovector&)"
00008               << std::endl
00009               << "These matrix and vector can not make a product." << std::endl
00010               << "Your input was (" << mat.m << "x" << mat.n << ") * ("
00011               << vec.l << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _dcovector newvec(mat.M);
00017   pdgemv_( 'N', 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 }

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

dgematrix*_dcovector operator

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

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(mat.N!=vec.L){
00007     std::cerr << "[ERROR] operator*(const dgematrix&, const _dcovector&)"
00008               << std::endl
00009               << "These matrix and vector can not make a product." << std::endl
00010               << "Your input was (" << mat.M << "x" << mat.N << ") * ("
00011               << vec.L << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _dcovector newvec(mat.M);
00017   pdgemv_( 'N', 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 }

_dcovector operator * const _dgematrix mat,
const dcovector vec
[friend]
 

_dgematrix*dcovector operator

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

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(mat.N!=vec.L){
00007     std::cerr << "[ERROR] operator*(const _dgematrix&, const dcovector&)"
00008               << std::endl
00009               << "These matrix and vector can not make a product." << std::endl
00010               << "Your input was (" << mat.M << "x" << mat.N << ") * ("
00011               << vec.L << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _dcovector newvec(mat.M);
00017   pdgemv_( 'N', 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 }

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

_dgematrix*_dcovector operator

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

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(mat.N!=vec.L){
00007     std::cerr << "[ERROR] operator*(const _dgematrix&, const _dcovector&)"
00008               << std::endl
00009               << "These matrix and vector can not make a product." << std::endl
00010               << "Your input was (" << mat.M << "x" << mat.N << ") * ("
00011               << vec.L << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   _dcovector newvec(mat.M);
00017   pdgemv_( 'N', 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   vec.destroy();
00023   return newvec;
00024 }

_dcovector operator * const dcovector vec,
const double &  d
[friend]
 

dcovector*double operator

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

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

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

_dcovector*double operator

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

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

_dcovector operator * const double &  d,
const dcovector vec
[friend]
 

double*dcovector operator

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

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

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

double*_dcovector operator

Definition at line 3 of file double-_dcovector.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   covec.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   covec.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 }

_dcovector operator/ const dcovector vec,
const double &  d
[friend]
 

dcovector/double operator

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

00034 {
00035   double inv_d(1./d);
00036   
00037   _dcovector 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 }

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

_dcovector/double operator

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

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

double operator% const dcovector vecA,
const _dcovector vecB
[friend]
 

dcovector^T*_dcovector operator (inner product)

Definition at line 106 of file dcovector-_dcovector.hpp.

00107 {
00108 #ifdef  CPPSL_DEBUG
00109   if(vecA.L!=vecB.L){
00110     std::cerr
00111       << "[ERROR] operator%(const dcovector&, const _dcovector&)" << 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 _dcovector vecA,
const dcovector vecB
[friend]
 

_dcovector^T*dcovector operator (inner product)

Definition at line 44 of file _dcovector-dcovector.hpp.

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

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

_dcovector^T*_dcovector operator (inner product)

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

00046 {
00047 #ifdef  CPPSL_DEBUG
00048   if(vecA.L!=vecB.L){
00049     std::cerr
00050       << "[ERROR] operator%(const _dcovector&, const _dcovector&)" << 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 _dcovector::L [mutable]
 

global vector size

Definition at line 7 of file _dcovector.hpp.

Referenced by _dcovector(), operator *(), operator%(), operator()(), operator+(), dcovector::operator+=(), operator-(), dcovector::operator-=(), operator<<(), and dcovector::shallow_copy().

long _dcovector::Ll [mutable]
 

local vector size

Definition at line 8 of file _dcovector.hpp.

Referenced by _dcovector(), operator *(), operator+(), operator-(), operator/(), and dcovector::shallow_copy().

long _dcovector::Desc[9] [mutable]
 

vector description

Definition at line 9 of file _dcovector.hpp.

Referenced by _dcovector(), operator *(), operator%(), operator()(), and dcovector::shallow_copy().

double* _dcovector::Array [mutable]
 

1D array to store vector data

Definition at line 10 of file _dcovector.hpp.

Referenced by _dcovector(), destroy(), operator *(), operator%(), operator()(), operator+(), dcovector::operator+=(), operator-(), dcovector::operator-=(), operator/(), and dcovector::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