本文整理汇总了C++中MyMatrix::getRank方法的典型用法代码示例。如果您正苦于以下问题:C++ MyMatrix::getRank方法的具体用法?C++ MyMatrix::getRank怎么用?C++ MyMatrix::getRank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyMatrix
的用法示例。
在下文中一共展示了MyMatrix::getRank方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createHamiltonian
void createHamiltonian(Geometry const &geometry, DynVars const &dynVars,
MyMatrix<std::complex<double> >& matrix,Parameters const ðer,Aux &aux,int type)
// Modified by IS Nov-08-04
{
int col, volume, i = 0, p,dir;
tpem_t hopping,hopping2,bandHop;
double tmp,tmp2;
int j,iTmp;
volume = ether.linSize;
tpem_t S_ij;
//static vector<double> phonon_q1(volume);
//static vector<double> phonon_q2(volume);
//static vector<double> phonon_q3(volume);
Phonons<Parameters,Geometry> phonons(ether,geometry);
for (p = 0; p < matrix.getRank(); p++)
for (col = 0; col < matrix.getRank(); col++)
matrix(p,col)=0;
for (p = 0; p < volume; p++) {
double phonon_q1=phonons.calcPhonon(p,dynVars,0);
double phonon_q2=phonons.calcPhonon(p,dynVars,1);
double phonon_q3=phonons.calcPhonon(p,dynVars,2);
matrix(p,p) = ether.phononEjt[0]*phonon_q1+ether.phononEjt[2]*phonon_q3+ether.potential[p];
matrix(p+volume,p+volume) = -ether.phononEjt[2]*phonon_q3+ether.phononEjt[0]*phonon_q1+ether.potential[p];
matrix(p,p+volume) = (ether.phononEjt[1]*phonon_q2);
matrix(p+volume,p) = conj(matrix(p,p+volume));
for (j = 0; j < geometry.z(p); j++) { /* hopping elements */
iTmp=geometry.borderId(p,j);;
if (iTmp>=0) hopping = ether.hoppings[iTmp];
else hopping= -1.0;
col = geometry.neighbor(p,j);
tmp=cos(0.5*dynVars.theta[p])*cos(0.5*dynVars.theta[col]);
tmp2=sin(0.5*dynVars.theta[p])*sin(0.5*dynVars.theta[col]);
S_ij=tpem_t(tmp+tmp2*cos(dynVars.phi[p]-dynVars.phi[col]),
-tmp2*sin(dynVars.phi[p]-dynVars.phi[col]));
if (p>col) hopping2 = conj(hopping);
else hopping2=hopping;
dir = int(j/2);
bandHop=ether.bandHoppings[0+0*2+dir*4];
hopping=hopping2 * bandHop ;
matrix(p,col) = hopping * S_ij;
matrix(col,p) = conj(hopping * S_ij);
bandHop=ether.bandHoppings[0+1*2+dir*4];
hopping= hopping2 * bandHop;
matrix(p, col+volume)=hopping * S_ij;
matrix(col+volume,p)=conj(matrix(p,col+volume));
//
bandHop=ether.bandHoppings[1+0*2+dir*4];
hopping= hopping2 * bandHop;
matrix(p+volume,col) = hopping * S_ij;
matrix(col,p+volume) = conj(matrix(p+volume,col));
bandHop=ether.bandHoppings[1+1*2+dir*4];
hopping=hopping2 * bandHop;
matrix(p+volume,col+volume) = hopping * S_ij;
matrix(col+volume,p+volume) = conj(matrix(p+volume,col+volume));
}
if (ether.isSet("tprime")) {
for (j = 0; j < geometry.z(p,2); j++) { /* hopping elements */
iTmp=geometry.borderId(p,j,2);
hopping= -1.0;
if (iTmp>=0) hopping = ether.hoppings[iTmp];
col = geometry.neighbor(p,j,2);
tmp=cos(0.5*dynVars.theta[p])*cos(0.5*dynVars.theta[col]);
tmp2=sin(0.5*dynVars.theta[p])*sin(0.5*dynVars.theta[col]);
S_ij=tpem_t(tmp+tmp2*cos(dynVars.phi[p]-dynVars.phi[col]),
-tmp2*sin(dynVars.phi[p]-dynVars.phi[col]));
if (p>col) hopping2 = conj(hopping);
else hopping2=hopping;
dir = int(j/2);
bandHop=ether.bandHoppings[0+0*2+dir*4]*ether.tprime;
hopping=hopping2 * bandHop ;
matrix(p,col) = hopping * S_ij;
matrix(col,p) = conj(hopping * S_ij);
bandHop=ether.bandHoppings[0+1*2+dir*4]*ether.tprime;
hopping= hopping2 * bandHop;
matrix(p, col+volume)=hopping * S_ij;
matrix(col+volume,p)=conj(matrix(p,col+volume));
//
bandHop=ether.bandHoppings[1+0*2+dir*4]*ether.tprime;
hopping= hopping2 * bandHop;
matrix(p+volume,col) = hopping * S_ij;
matrix(col,p+volume) = conj(matrix(p+volume,col));
bandHop=ether.bandHoppings[1+1*2+dir*4]*ether.tprime;
hopping=hopping2 * bandHop;
//.........这里部分代码省略.........