CPPLapack
 All Classes Files Functions Variables Friends
Functions
dsymatrix_small-functions.hpp File Reference

Go to the source code of this file.

Functions

template<long n>
std::ostream & operator<< (std::ostream &s, const dsymatrix_small< n > &A)
template<long n>
void idamax (long &I, long &J, const dsymatrix_small< n > &A)
template<long n>
double damax (const dsymatrix_small< n > &A)
template<long n>
dsymatrix_small< n > & operator+= (dsymatrix_small< n > &A, const dsymatrix_small< n > &B)
template<long n>
dsymatrix_small< n > & operator-= (dsymatrix_small< n > &A, const dsymatrix_small< n > &B)
template<long n>
dsymatrix_small< n > & operator/= (dsymatrix_small< n > &A, const double &v)
template<long n>
const dsymatrix_small< n > & operator+ (const dsymatrix_small< n > &A)
template<long n>
dsymatrix_small< n > operator- (const dsymatrix_small< n > &A)
template<long n>
dgematrix_small< n, n > operator+ (const dsymatrix_small< n > &A, const dgematrix_small< n, n > &B)
template<long n>
dsymatrix_small< n > operator+ (const dsymatrix_small< n > &A, const dsymatrix_small< n > &B)
template<long n>
dgematrix_small< n, n > operator- (const dsymatrix_small< n > &A, const dgematrix_small< n, n > &B)
template<long n>
dsymatrix_small< n > operator- (const dsymatrix_small< n > &A, const dsymatrix_small< n > &B)
template<long n>
dcovector_small< n > operator* (const dsymatrix_small< n > &A, const dcovector_small< n > &B)
template<long m, long n>
dgematrix_small< m, n > operator* (const dsymatrix_small< m > &A, const dgematrix_small< m, n > &B)
template<long n>
dgematrix_small< n, n > operator* (const dsymatrix_small< n > &A, const dsymatrix_small< n > &B)
template<long n>
dsymatrix_small< n > operator* (const dsymatrix_small< n > &A, const double &v)
template<long n>
dsymatrix_small< n > operator/ (const dsymatrix_small< n > &A, const double &v)

Function Documentation

template<long n>
std::ostream& operator<< ( std::ostream &  s,
const dsymatrix_small< n > &  A 
) [inline]

Definition at line 81 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  s << std::setiosflags(std::ios::showpos);
  for(long i=0; i<n; i++){
    for(long j=0;   j<=i; j++){ s << " " << A(i,j) << " "<< std::flush; }
    for(long j=i+1; j<n;  j++){ s << "{" << A(j,i) << "}" << std::flush; }
    s << std::endl;
  }
  return s;
}
template<long n>
void idamax ( long &  I,
long &  J,
const dsymatrix_small< n > &  A 
) [inline]

Definition at line 191 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  double max(-1.);
  for(int i=0; i<n; i++){
    for(int j=0; j<=i; j++){
      if( max<fabs(A(i,j)) ){
        I=i;
        J=j;
        max =fabs(A(i,j));
      }
    }
  }
  return;  
}
template<long n>
double damax ( const dsymatrix_small< n > &  A) [inline]

Definition at line 209 of file dsymatrix_small-functions.hpp.

References i(), and idamax().

{VERBOSE_REPORT;
  long i(0),j(0);
  idamax(i,j,A);
  return A(i,j);
}
template<long n>
dsymatrix_small<n>& operator+= ( dsymatrix_small< n > &  A,
const dsymatrix_small< n > &  B 
) [inline]

Definition at line 227 of file dsymatrix_small-functions.hpp.

References dsymatrix_small< n >::array.

{VERBOSE_REPORT;
  for(long k=0; k<(n*(n+1))/2; k++){ A.array[k]+=B.array[k]; }
  return A;
}
template<long n>
dsymatrix_small<n>& operator-= ( dsymatrix_small< n > &  A,
const dsymatrix_small< n > &  B 
) [inline]

Definition at line 236 of file dsymatrix_small-functions.hpp.

References dsymatrix_small< n >::array.

{VERBOSE_REPORT;
  for(long k=0; k<(n*(n+1))/2; k++){ A.array[k]-=B.array[k]; }
  return A;
}
template<long n>
dsymatrix_small<n>& operator/= ( dsymatrix_small< n > &  A,
const double &  v 
) [inline]

Definition at line 245 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  for(long i=0; i<n; i++){
    for(long j=0; j<=i; j++){
      A(i,j)/=v;
    }
  }
  return A;
}
template<long n>
const dsymatrix_small<n>& operator+ ( const dsymatrix_small< n > &  A) [inline]

unary

Definition at line 262 of file dsymatrix_small-functions.hpp.

{VERBOSE_REPORT;
  return A;
}
template<long n>
dsymatrix_small<n> operator- ( const dsymatrix_small< n > &  A) [inline]

unary

Definition at line 270 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dsymatrix_small<n> X;
  for(long i=0; i<n; i++){
    for(long j=0; j<=i; j++){
      X(i,j)=-A(i,j);
    }
  }
  return X;
}
template<long n>
dgematrix_small<n,n> operator+ ( const dsymatrix_small< n > &  A,
const dgematrix_small< n, n > &  B 
) [inline]

Definition at line 288 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dgematrix_small<n,n> X;
  for(long i=0; i<n; i++){
    for(long j=0; j<i; j++){
      X(i,j) =A(i,j)+B(i,j);
    }
    for(long j=i; j<n; j++){
      X(i,j) =A(j,i)+B(i,j);
    }
  }
  return X;
}
template<long n>
dsymatrix_small<n> operator+ ( const dsymatrix_small< n > &  A,
const dsymatrix_small< n > &  B 
) [inline]

Definition at line 305 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dsymatrix_small<n> X;
  for(long i=0; i<n; i++){
    for(long j=0; j<=i; j++){
      X(i,j) =A(i,j)+B(i,j);
    }
  }
  return X;
}
template<long n>
dgematrix_small<n,n> operator- ( const dsymatrix_small< n > &  A,
const dgematrix_small< n, n > &  B 
) [inline]

Definition at line 320 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dgematrix_small<n,n> X;
  for(long i=0; i<n; i++){
    for(long j=0; j<i; j++){
      X(i,j) =A(i,j)-B(i,j);
    }
    for(long j=i; j<n; j++){
      X(i,j) =A(j,i)-B(i,j);
    }
  }
  return X;
}
template<long n>
dsymatrix_small<n> operator- ( const dsymatrix_small< n > &  A,
const dsymatrix_small< n > &  B 
) [inline]

Definition at line 337 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dsymatrix_small<n> X;
  for(long i=0; i<n; i++){
    for(long j=0; j<=i; j++){
      X(i,j) =A(i,j)-B(i,j);
    }
  }
  return X;
}
template<long n>
dcovector_small<n> operator* ( const dsymatrix_small< n > &  A,
const dcovector_small< n > &  B 
) [inline]

Definition at line 351 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dcovector_small<n> C(0.);
  for(long i=0; i<n; i++){
    for(long j=0; j<i; j++){
      C(i) +=A(i,j)*B(j);
    }
    for(long j=i; j<n; j++){
      C(i) +=A(j,i)*B(j);
    }
  }
  return C;
}
template<long m, long n>
dgematrix_small<m,n> operator* ( const dsymatrix_small< m > &  A,
const dgematrix_small< m, n > &  B 
) [inline]

Definition at line 368 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dgematrix_small<m,n> X(0.);
  for(long i=0; i<m; i++){
    for(long j=0; j<n; j++){
      for(long k=0; k<i; k++){
        X(i,j) +=A(i,k)*B(k,j);
      }
      for(long k=i; k<m; k++){
        X(i,j) +=A(k,i)*B(k,j);
      }
    }
  }
  return X;
}
template<long n>
dgematrix_small<n,n> operator* ( const dsymatrix_small< n > &  A,
const dsymatrix_small< n > &  B 
) [inline]

Definition at line 387 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dgematrix_small<n,n> X(0.);
  for(long i=0; i<n; i++){
    for(long j=0; j<i; j++){
      for(long k=0; k<j; k++){
        X(i,j) +=A(i,k)*B(j,k);
      }
      for(long k=j; k<i; k++){
        X(i,j) +=A(i,k)*B(k,j);
      }
      for(long k=i; k<n; k++){
        X(i,j) +=A(k,i)*B(k,j);
      }
    }
    for(long j=i; j<n; j++){
      for(long k=0; k<i; k++){
        X(i,j) +=A(i,k)*B(j,k);
      }
      for(long k=i; k<j; k++){
        X(i,j) +=A(k,i)*B(j,k);
      }
      for(long k=j; k<n; k++){
        X(i,j) +=A(k,i)*B(k,j);
      }
    }
  }
  return X;
}
template<long n>
dsymatrix_small<n> operator* ( const dsymatrix_small< n > &  A,
const double &  v 
) [inline]

Definition at line 420 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dsymatrix_small<n> C;
  for(long i=0; i<n; i++){
    for(long j=0; j<=i; j++){
      C(i,j) =A(i,j)*v;
    }
  }
  return C;
}
template<long n>
dsymatrix_small<n> operator/ ( const dsymatrix_small< n > &  A,
const double &  v 
) [inline]

Definition at line 434 of file dsymatrix_small-functions.hpp.

References i().

{VERBOSE_REPORT;
  dsymatrix_small<n> C;
  for(long i=0; i<n; i++){
    for(long j=0; j<=i; j++){
      C(i,j) =A(i,j)/v;
    }
  }
  return C;
}
 All Classes Files Functions Variables Friends