6 std::cerr <<
"# [MARK] operator+(const _zgbmatrix&, const _zgbmatrix&)"
11 if(matA.
N!=matB.
N || matA.
M!=matB.
M){
12 std::cerr <<
"[ERROR] operator+(_zgbmatrix&, _zgbmatrix&)" << std::endl
13 <<
"These two matrises can not make a summation." << std::endl
14 <<
"Your input was (" << matA.
M <<
"x" << matA.
N <<
") + ("
15 << matB.
M <<
"x" << matB.
N <<
")." << std::endl;
20 if(matA.
KL>matB.
KL && matA.
KU>matB.
KU){
21 for(
long i=0; i<matB.
M; i++){
22 for(
long j=
max(0,i-matB.
KL); j<min(matB.
N,i+matB.
KU+1); j++){
31 else if(matB.
KL>matA.
KL && matB.
KU>matA.
KU){
32 for(
long i=0; i<matA.
M; i++){
33 for(
long j=
max(0,i-matA.
KL); j<min(matA.
N,i+matA.
KU+1); j++){
46 for(
long i=0; i<matA.
M; i++){
47 for(
long j=
max(0,i-matA.
KL); j<min(matA.
N,i+matA.
KU+1); j++){
48 newmat(i,j)+=matA(i,j);
50 for(
long j=
max(0,i-matB.
KL); j<min(matB.
N,i+matB.
KU+1); j++){
51 newmat(i,j)+=matB(i,j);
66 std::cerr <<
"# [MARK] operator-(const _zgbmatrix&, const _zgbmatrix&)"
71 if(matA.
N!=matB.
N || matA.
M!=matB.
M){
72 std::cerr <<
"[ERROR] operator-(_zgbmatrix&, _zgbmatrix&)" << std::endl
73 <<
"These two matrises can not make a subtraction." << std::endl
74 <<
"Your input was (" << matA.
M <<
"x" << matA.
N <<
") - ("
75 << matB.
M <<
"x" << matB.
N <<
")." << std::endl;
80 if(matA.
KL>matB.
KL && matA.
KU>matB.
KU){
81 for(
long i=0; i<matB.
M; i++){
82 for(
long j=
max(0,i-matB.
KL); j<min(matB.
N,i+matB.
KU+1); j++){
95 for(
long i=0; i<matA.
M; i++){
96 for(
long j=
max(0,i-matA.
KL); j<min(matA.
N,i+matA.
KU+1); j++){
97 newmat(i,j)+=matA(i,j);
99 for(
long j=
max(0,i-matB.
KL); j<min(matB.
N,i+matB.
KU+1); j++){
100 newmat(i,j)-=matB(i,j);
115 std::cerr <<
"# [MARK] operator*(const _zgbmatrix&, const _zgbmatrix&)"
121 std::cerr <<
"[ERROR] operator*(_zgbmatrix&, _zgbmatrix&)" << std::endl
122 <<
"These two matrises can not make a product." << std::endl
123 <<
"Your input was (" << matA.
M <<
"x" << matA.
N <<
") * ("
124 << matB.
M <<
"x" << matB.
N <<
")." << std::endl;
133 #pragma omp parallel for private(j,k)
134 for(i=0; i<newmat.
m; i++){
135 for(j=
max(0,i-newmat.
kl); j<min(newmat.
n,i+newmat.
ku+1); j++){
137 k< min( min(matA.
N,i+matA.
KU+1), min(matB.
M,j+matB.
KL+1) ); k++){
138 newmat(i,j)+= matA(i,k)*matB(k,j);
double max(double v1, double v2)
Return maximum.
Definition: variousFunctions.cpp:355
friend _zrovector operator-(const _zrovector &)
Definition: _zrovector-unary.hpp:15
long const & n
matrix column size (readable)
Definition: zgbmatrix.hpp:17
long N
matrix column size
Definition: _zgbmatrix.hpp:8
void destroy() const
Definition: _zgbmatrix-misc.hpp:3
long KU
upper band width
Definition: _zgbmatrix.hpp:10
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
long const & m
matrix row size (readable)
Definition: zgbmatrix.hpp:16
friend _zrovector operator*(const zrovector &, const zgematrix &)
Definition: zrovector-zgematrix.hpp:3
long M
matrix row size
Definition: _zgbmatrix.hpp:7
long const & kl
lower band width (readable)
Definition: zgbmatrix.hpp:18
long const & ku
upper band width (readable)
Definition: zgbmatrix.hpp:19
(DO NOT USE) Smart-temporary Complex Double-precision General Band Matrix Class
Definition: _zgbmatrix.hpp:3
void zero()
Definition: zgbmatrix-misc.hpp:29
friend const _zrovector & operator+(const _zrovector &)
Definition: _zrovector-unary.hpp:3
long KL
lower band width
Definition: _zgbmatrix.hpp:9