98 eulA, eulB, eulG, settings );
142 std::max ( staticStructure->
getYDim(), movingStructure->
getYDim() ),
143 std::max ( staticStructure->
getZDim(), movingStructure->
getZDim() ) );
145 std::max ( staticStructure->
getYDim(), movingStructure->
getYDim() ),
146 std::max ( staticStructure->
getZDim(), movingStructure->
getZDim() ) );
155 proshade_double mapPeak = 0.0;
156 proshade_unsign xDimS = staticStructure->
getXDim();
157 proshade_unsign yDimS = staticStructure->
getYDim();
158 proshade_unsign zDimS = staticStructure->
getZDim();
162 if ( *trsX > (
static_cast< proshade_double
> ( xDimS ) / 2.0 ) ) { *trsX = *trsX -
static_cast< proshade_double
> ( xDimS ); }
163 if ( *trsY > (
static_cast< proshade_double
> ( yDimS ) / 2.0 ) ) { *trsY = *trsY -
static_cast< proshade_double
> ( yDimS ); }
164 if ( *trsZ > (
static_cast< proshade_double
> ( zDimS ) / 2.0 ) ) { *trsZ = *trsZ -
static_cast< proshade_double
> ( zDimS ); }
173 proshade_single xMov =
static_cast< proshade_single
> ( -(*trsX) );
174 proshade_single yMov =
static_cast< proshade_single
> ( -(*trsY) );
175 proshade_single zMov =
static_cast< proshade_single
> ( -(*trsZ) );
178 std::stringstream hlpSS;
179 hlpSS <<
"Optimal map translation distances are " << *trsX <<
" ; " << *trsY <<
" ; " << *trsZ <<
" Angstroms with peak height " << mapPeak / (
static_cast< proshade_double
> ( xDimS ) *
static_cast< proshade_double
> ( yDimS ) *
static_cast< proshade_double
> ( zDimS ) );
195 static_cast< proshade_signed
> ( movingStructure->
getXDim() ),
static_cast< proshade_signed
> ( movingStructure->
getYDim() ),
196 static_cast< proshade_signed
> ( movingStructure->
getZDim() ) );
223 proshade_single xSamplRate = (
static_cast< proshade_single
> ( staticStructure->
getXDimSize() ) /
static_cast< proshade_single
> ( staticStructure->
getXDim() ) );
224 proshade_single ySamplRate = (
static_cast< proshade_single
> ( staticStructure->
getYDimSize() ) /
static_cast< proshade_single
> ( staticStructure->
getYDim() ) );
225 proshade_single zSamplRate = (
static_cast< proshade_single
> ( staticStructure->
getZDimSize() ) /
static_cast< proshade_single
> ( staticStructure->
getZDim() ) );
227 proshade_single xCor =
static_cast< proshade_single
> (
static_cast< proshade_single
> ( staticStructure->
xFrom - movingStructure->
xFrom ) * xSamplRate );
228 proshade_single yCor =
static_cast< proshade_single
> (
static_cast< proshade_single
> ( staticStructure->
yFrom - movingStructure->
yFrom ) * ySamplRate );
229 proshade_single zCor =
static_cast< proshade_single
> (
static_cast< proshade_single
> ( staticStructure->
zFrom - movingStructure->
zFrom ) * zSamplRate );
231 proshade_single xMov =
static_cast< proshade_single
> ( 0.0 -
static_cast< proshade_double
> ( xCor ) - ( *trsX *
static_cast< proshade_double
> ( xSamplRate ) ) );
232 proshade_single yMov =
static_cast< proshade_single
> ( 0.0 -
static_cast< proshade_double
> ( yCor ) - ( *trsY *
static_cast< proshade_double
> ( ySamplRate ) ) );
233 proshade_single zMov =
static_cast< proshade_single
> ( 0.0 -
static_cast< proshade_double
> ( zCor ) - ( *trsZ *
static_cast< proshade_double
> ( zSamplRate ) ) );
236 *trsX =
static_cast< proshade_double
> ( -xMov );
237 *trsY =
static_cast< proshade_double
> ( -yMov );
238 *trsZ =
static_cast< proshade_double
> ( -zMov );
253 std::vector< proshade_double > ret;
254 proshade_double mapPeak = 0.0;
255 proshade_unsign xDimS = staticStructure->
getXDim();
256 proshade_unsign yDimS = staticStructure->
getYDim();
257 proshade_unsign zDimS = staticStructure->
getZDim();
258 proshade_double trsX = 0.0, trsY = 0.0, trsZ = 0.0;
269 if ( trsX > (
static_cast< proshade_double
> ( xDimS ) / 2.0 ) ) { trsX = trsX -
static_cast< proshade_double
> ( xDimS ); }
270 if ( trsY > (
static_cast< proshade_double
> ( yDimS ) / 2.0 ) ) { trsY = trsY -
static_cast< proshade_double
> ( yDimS ); }
271 if ( trsZ > (
static_cast< proshade_double
> ( zDimS ) / 2.0 ) ) { trsZ = trsZ -
static_cast< proshade_double
> ( zDimS ); }
276 this->originalPdbTransX = trsX;
277 this->originalPdbTransY = trsY;
278 this->originalPdbTransZ = trsZ;
280 proshade_single xMov =
static_cast< proshade_single
> ( -trsX );
281 proshade_single yMov =
static_cast< proshade_single
> ( -trsY );
282 proshade_single zMov =
static_cast< proshade_single
> ( -trsZ );
290 this->mapMovFromsChangeX =
static_cast<proshade_double
> ( this->xFrom );
291 this->mapMovFromsChangeY =
static_cast<proshade_double
> ( this->yFrom );
292 this->mapMovFromsChangeZ =
static_cast<proshade_double
> ( this->zFrom );
296 this->getXFromPtr(), this->getXToPtr(),
297 this->getYFromPtr(), this->getYToPtr(),
298 this->getZFromPtr(), this->getZToPtr(),
299 this->getXAxisOrigin(), this->getYAxisOrigin(), this->getZAxisOrigin() );
302 this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
303 static_cast< proshade_signed
> ( this->getXDim() ),
static_cast< proshade_signed
> ( this->getYDim() ),
static_cast< proshade_signed
> ( this->getZDim() ) );
306 this->mapMovFromsChangeX =
static_cast<proshade_double
> ( this->xFrom ) - this->mapMovFromsChangeX;
307 this->mapMovFromsChangeY =
static_cast<proshade_double
> ( this->yFrom ) - this->mapMovFromsChangeY;
308 this->mapMovFromsChangeZ =
static_cast<proshade_double
> ( this->zFrom ) - this->mapMovFromsChangeZ;
327 fftw_complex *tmpIn1 =
nullptr, *tmpOut1 =
nullptr, *tmpIn2 =
nullptr, *tmpOut2 =
nullptr, *resOut =
nullptr;
328 fftw_plan forwardFourierObj1, forwardFourierObj2, inverseFourierCombo;
329 proshade_unsign dimMult = staticStructure->
getXDim() * staticStructure->
getYDim() * staticStructure->
getZDim();
330 ProSHADE_internal_overlay::allocateTranslationFunctionMemory ( tmpIn1, tmpOut1, tmpIn2, tmpOut2, this->translationMap, resOut, forwardFourierObj1, forwardFourierObj2, inverseFourierCombo, staticStructure->
getXDim(), staticStructure->
getYDim(), staticStructure->
getZDim() );
333 for ( proshade_unsign iter = 0; iter < dimMult; iter++ ) { tmpIn1[iter][0] = staticStructure->
getMapValue ( iter ); tmpIn1[iter][1] = 0.0; }
334 for ( proshade_unsign iter = 0; iter < dimMult; iter++ ) { tmpIn2[iter][0] = this->getMapValue ( iter ); tmpIn2[iter][1] = 0.0; }
337 fftw_execute ( forwardFourierObj1 );
338 fftw_execute ( forwardFourierObj2 );
342 fftw_execute ( inverseFourierCombo );
367 void ProSHADE_internal_overlay::allocateTranslationFunctionMemory ( fftw_complex*& tmpIn1, fftw_complex*& tmpOut1, fftw_complex*& tmpIn2, fftw_complex*& tmpOut2, fftw_complex*& resIn, fftw_complex*& resOut, fftw_plan& forwardFourierObj1, fftw_plan& forwardFourierObj2, fftw_plan& inverseFourierCombo, proshade_unsign xD, proshade_unsign yD, proshade_unsign zD )
370 tmpIn1 =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * xD * yD * zD ) );
371 tmpOut1 =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * xD * yD * zD ) );
372 tmpIn2 =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * xD * yD * zD ) );
373 tmpOut2 =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * xD * yD * zD ) );
374 resIn =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * xD * yD * zD ) );
375 resOut =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * xD * yD * zD ) );
386 forwardFourierObj1 = fftw_plan_dft_3d (
static_cast< int > ( xD ),
static_cast< int > ( yD ),
static_cast< int > ( zD ), tmpIn1, tmpOut1, FFTW_FORWARD , FFTW_ESTIMATE );
387 forwardFourierObj2 = fftw_plan_dft_3d (
static_cast< int > ( xD ),
static_cast< int > ( yD ),
static_cast< int > ( zD ), tmpIn2, tmpOut2, FFTW_FORWARD , FFTW_ESTIMATE );
388 inverseFourierCombo = fftw_plan_dft_3d (
static_cast< int > ( xD ),
static_cast< int > ( yD ),
static_cast< int > ( zD ), resOut, resIn , FFTW_BACKWARD, FFTW_ESTIMATE );
409 fftw_destroy_plan ( forwardFourierObj1 );
410 fftw_destroy_plan ( forwardFourierObj2 );
411 fftw_destroy_plan ( inverseFourierCombo );
412 fftw_free ( tmpIn1 );
413 fftw_free ( tmpIn2 );
414 fftw_free ( tmpOut1 );
415 fftw_free ( tmpOut2 );
416 fftw_free ( resOut );
436 if ( ( this->xDimIndices > xDim ) || ( this->yDimIndices > yDim ) || ( this->zDimIndices > zDim ) )
438 throw ProSHADE_exception (
"Cannot zero-pad in negative direction.",
"EO00034", __FILE__, __LINE__, __func__,
"The requested padded size of a structure is smaller than\n : the current size. If the user sees this error, there is\n : likely a considerable bug. Please report this error." );
442 if ( ( this->xDimIndices == xDim ) && ( this->yDimIndices == yDim ) && ( this->zDimIndices == zDim ) ) { return ; }
445 proshade_unsign addXPre, addYPre, addZPre, addXPost, addYPost, addZPost;
446 ProSHADE_internal_overlay::computeBeforeAfterZeroCounts ( &addXPre, &addYPre, &addZPre, &addXPost, &addYPost, &addZPost, xDim, yDim, zDim, this->xDimIndices, this->yDimIndices, this->zDimIndices );
449 proshade_double* newMap =
new proshade_double [xDim * yDim * zDim];
452 ProSHADE_internal_overlay::paddMapWithZeroes ( this->internalMap, newMap, xDim, yDim, zDim, this->xDimIndices, this->yDimIndices, this->zDimIndices, addXPre, addYPre, addZPre );
455 delete[] this->internalMap;
456 this->internalMap =
new proshade_double [xDim * yDim * zDim];
457 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( xDim * yDim * zDim ); iter++ ) { this->internalMap[iter] = newMap[iter]; }
463 this->xDimSize =
static_cast< proshade_single
> ( xDim ) * ( this->xDimSize /
static_cast< proshade_single
> ( this->xDimIndices ) );
464 this->yDimSize =
static_cast< proshade_single
> ( yDim ) * ( this->yDimSize /
static_cast< proshade_single
> ( this->yDimIndices ) );
465 this->zDimSize =
static_cast< proshade_single
> ( zDim ) * ( this->zDimSize /
static_cast< proshade_single
> ( this->zDimIndices ) );
466 this->xDimIndices = xDim ; this->yDimIndices = yDim ; this->zDimIndices = zDim;
467 this->xGridIndices = xDim ; this->yGridIndices = yDim ; this->zGridIndices = zDim;
468 this->xFrom -= addXPre ; this->yFrom -= addYPre ; this->zFrom -= addZPre;
469 this->xTo += addXPost; this->yTo += addYPost; this->zTo += addZPost;
470 this->xAxisOrigin -= addXPre ; this->yAxisOrigin -= addYPre ; this->zAxisOrigin -= addZPre ;
492 void ProSHADE_internal_overlay::computeBeforeAfterZeroCounts ( proshade_unsign* addXPre, proshade_unsign* addYPre, proshade_unsign* addZPre, proshade_unsign* addXPost, proshade_unsign* addYPost, proshade_unsign* addZPost, proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim, proshade_unsign xDimIndices, proshade_unsign yDimIndices, proshade_unsign zDimIndices )
495 *addXPre = ( xDim - xDimIndices ) / 2;
496 *addYPre = ( yDim - yDimIndices ) / 2;
497 *addZPre = ( zDim - zDimIndices ) / 2;
498 *addXPost = *addXPre;
if ( ( xDim - xDimIndices ) % 2 == 1 ) { *addXPost += 1; }
499 *addYPost = *addYPre;
if ( ( yDim - yDimIndices ) % 2 == 1 ) { *addYPost += 1; }
500 *addZPost = *addZPre;
if ( ( zDim - zDimIndices ) % 2 == 1 ) { *addZPost += 1; }
521 void ProSHADE_internal_overlay::paddMapWithZeroes ( proshade_double* oldMap, proshade_double*& newMap, proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim, proshade_unsign xDimIndices, proshade_unsign yDimIndices, proshade_unsign zDimIndices, proshade_unsign addXPre, proshade_unsign addYPre, proshade_unsign addZPre )
524 proshade_unsign newMapIndex = 0;
525 proshade_unsign oldMapIndex = 0;
528 for ( proshade_unsign xIt = 0; xIt < xDim; xIt++ )
530 for ( proshade_unsign yIt = 0; yIt < yDim; yIt++ )
532 for ( proshade_unsign zIt = 0; zIt < zDim; zIt++ )
535 newMapIndex = zIt + zDim * ( yIt + yDim * xIt );
538 if ( xIt < addXPre ) { newMap[newMapIndex] = 0.0;
continue; }
539 if ( yIt < addYPre ) { newMap[newMapIndex] = 0.0;
continue; }
540 if ( zIt < addZPre ) { newMap[newMapIndex] = 0.0;
continue; }
543 if ( xIt >= ( addXPre + xDimIndices ) ) { newMap[newMapIndex] = 0.0;
continue; }
544 if ( yIt >= ( addYPre + yDimIndices ) ) { newMap[newMapIndex] = 0.0;
continue; }
545 if ( zIt >= ( addZPre + zDimIndices ) ) { newMap[newMapIndex] = 0.0;
continue; }
548 oldMapIndex = (zIt-addZPre) + zDimIndices * ( (yIt-addYPre) + yDimIndices * (xIt-addXPre) );
549 newMap[newMapIndex] = oldMap[oldMapIndex];
574 this->maxShellBand = this->spheres[this->noSpheres-1]->getLocalBandwidth();
577 this->findMapCOM ( );
578 this->mapCOMProcessChangeX += ( this->xCom - this->originalMapXCom );
579 this->mapCOMProcessChangeY += ( this->yCom - this->originalMapYCom );
580 this->mapCOMProcessChangeZ += ( this->zCom - this->originalMapZCom );
586 this->allocateRotatedSHMemory ( );
589 this->computeRotatedSH ( );
592 this->invertSHCoefficients ( );
595 std::vector<proshade_double> lonCO, latCO;
599 proshade_double *densityMapRotated =
new proshade_double [this->xDimIndices * this->yDimIndices * this->zDimIndices];
601 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { densityMapRotated[iter] = 0.0; }
604 this->interpolateMapFromSpheres ( densityMapRotated );
607 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
609 this->internalMap[iter] = densityMapRotated[iter];
613 delete[] densityMapRotated;
635 bool withinBounds =
true;
636 proshade_double c000, c001, c010, c011, c100, c101, c110, c111, c00, c01, c10, c11, c0, c1;
638 proshade_double xCOM, yCOM, zCOM;
639 std::vector< proshade_double > ret;
642 proshade_single xSampRate = this->xDimSize /
static_cast< proshade_single
> ( this->xTo - this->xFrom );
643 proshade_single ySampRate = this->yDimSize /
static_cast< proshade_single
> ( this->yTo - this->yFrom );
644 proshade_single zSampRate = this->zDimSize /
static_cast< proshade_single
> ( this->zTo - this->zFrom );
647 ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xCOM, &yCOM, &zCOM, this->xDimSize, this->yDimSize, this->zDimSize, this->xFrom, this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo,
false );
650 proshade_single *mins =
new proshade_single[3];
651 proshade_single *maxs =
new proshade_single[3];
652 proshade_single *rotMat =
new proshade_single[9];
653 proshade_single *rotVec;
654 proshade_single *interpMins =
new proshade_single[3];
655 proshade_single *interpMaxs =
new proshade_single[3];
656 proshade_single *interpDiff =
new proshade_single[3];
657 proshade_single *movs =
new proshade_single[3];
658 map =
new proshade_double[ this->xDimIndices * this->yDimIndices * this->zDimIndices ];
671 for (
size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { map[iter] = 0.0; }
674 mins[0] = std::floor (
static_cast< proshade_single
> ( this->xDimIndices ) / -2.0f );
675 mins[1] = std::floor (
static_cast< proshade_single
> ( this->yDimIndices ) / -2.0f );
676 mins[2] = std::floor (
static_cast< proshade_single
> ( this->zDimIndices ) / -2.0f );
682 if ( this->xDimIndices % 2 == 0 ) { maxs[0] -= 1.0f; }
683 if ( this->yDimIndices % 2 == 0 ) { maxs[1] -= 1.0f; }
684 if ( this->zDimIndices % 2 == 0 ) { maxs[2] -= 1.0f; }
700 for ( proshade_single xIt = mins[0]; xIt <= maxs[0]; xIt += 1.0f )
702 for ( proshade_single yIt = mins[1]; yIt <= maxs[1]; yIt += 1.0f )
704 for ( proshade_single zIt = mins[2]; zIt <= maxs[2]; zIt += 1.0f )
711 for (
size_t posIt = 0; posIt < 3; posIt++ )
714 interpMins[posIt] = std::floor ( rotVec[posIt] );
715 interpMaxs[posIt] = interpMins[posIt] + 1.0f;
718 if ( ( maxs[posIt] < interpMins[posIt] ) || ( interpMins[posIt] < mins[posIt] ) || ( maxs[posIt] < interpMaxs[posIt] ) || ( interpMaxs[posIt] < mins[posIt] ) )
720 withinBounds =
false;
725 interpDiff[posIt] = rotVec[posIt] - interpMins[posIt];
727 if ( !withinBounds ) {
continue; }
730 for (
size_t posIt = 0; posIt < 3; posIt++ )
732 interpMaxs[posIt] = std::min ( maxs[posIt], std::max ( mins[posIt], interpMaxs[posIt] ) );
739 arrPos =
static_cast< size_t > ( ( interpMins[2] - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( interpMins[1] - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( interpMins[0] - mins[0] ) ) );
740 c000 = this->internalMap[arrPos];
742 arrPos =
static_cast< size_t > ( ( interpMaxs[2] - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( interpMins[1] - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( interpMins[0] - mins[0] ) ) );
743 c001 = this->internalMap[arrPos];
745 arrPos =
static_cast< size_t > ( ( interpMins[2] - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( interpMaxs[1] - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( interpMins[0] - mins[0] ) ) );
746 c010 = this->internalMap[arrPos];
748 arrPos =
static_cast< size_t > ( ( interpMaxs[2] - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( interpMaxs[1] - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( interpMins[0] - mins[0] ) ) );
749 c011 = this->internalMap[arrPos];
751 arrPos =
static_cast< size_t > ( ( interpMins[2] - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( interpMins[1] - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( interpMaxs[0] - mins[0] ) ) );
752 c100 = this->internalMap[arrPos];
754 arrPos =
static_cast< size_t > ( ( interpMaxs[2] - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( interpMins[1] - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( interpMaxs[0] - mins[0] ) ) );
755 c101 = this->internalMap[arrPos];
757 arrPos =
static_cast< size_t > ( ( interpMins[2] - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( interpMaxs[1] - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( interpMaxs[0] - mins[0] ) ) );
758 c110 = this->internalMap[arrPos];
760 arrPos =
static_cast< size_t > ( ( interpMaxs[2] - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( interpMaxs[1] - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( interpMaxs[0] - mins[0] ) ) );
761 c111 = this->internalMap[arrPos];
764 c00 = ( c000 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c100 *
static_cast< proshade_double
> ( interpDiff[0] ) );
765 c01 = ( c001 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c101 *
static_cast< proshade_double
> ( interpDiff[0] ) );
766 c10 = ( c010 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c110 *
static_cast< proshade_double
> ( interpDiff[0] ) );
767 c11 = ( c011 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c111 *
static_cast< proshade_double
> ( interpDiff[0] ) );
770 c0 = ( c00 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[1] ) ) ) + ( c10 *
static_cast< proshade_double
> ( interpDiff[1] ) );
771 c1 = ( c01 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[1] ) ) ) + ( c11 *
static_cast< proshade_double
> ( interpDiff[1] ) );
774 arrPos =
static_cast< size_t > ( ( zIt - mins[2] ) +
static_cast< proshade_single
> ( this->zDimIndices ) * ( ( yIt - mins[1] ) +
static_cast< proshade_single
> ( this->yDimIndices ) * ( xIt - mins[0] ) ) );
775 map[arrPos] = ( c0 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[2] ) ) ) + ( c1 *
static_cast< proshade_double
> ( interpDiff[2] ) );
808 proshade_double axX, axY, axZ, axAng, tmp, *rMat, *map;
811 rMat =
new proshade_double[9];
836 std::vector< proshade_double > ret = this->rotateMapRealSpace ( axX, axY, axZ, axAng, map );
839 for (
size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
841 this->internalMap[iter] = map[iter];
849 this->originalPdbRotCenX = ret.at(0);
850 this->originalPdbRotCenY = ret.at(1);
851 this->originalPdbRotCenZ = ret.at(2);
876 size_t dimMax =
static_cast< size_t > ( xDim * yDim * zDim );
877 proshade_double *rotMat =
new proshade_double[9];
878 proshade_signed *mins =
new proshade_signed[3];
879 proshade_signed *maxs =
new proshade_signed[3];
880 proshade_signed *interpMins =
new proshade_signed[3];
881 proshade_signed *interpMaxs =
new proshade_signed[3];
882 proshade_double *interpDiff =
new proshade_double[3];
883 rotCoeffs =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * dimMax ) );
884 fftw_complex *rotCoeffsHlp =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * dimMax ) );
885 proshade_double *rotVec;
886 std::complex< proshade_double > c000, c001, c010, c011, c100, c101, c110, c111, c00, c01, c10, c11, c0, c1;
889 bool withinBounds =
false;
902 for (
size_t iter = 0; iter < static_cast< size_t > ( dimMax ); iter++ ) { rotCoeffs[iter][0] = 0.0; rotCoeffs[iter][1] = 0.0; rotCoeffsHlp[iter][0] = 0.0; rotCoeffsHlp[iter][1] = 0.0; }
909 mins[0] =
static_cast< proshade_signed
> ( std::floor (
static_cast< proshade_single
> ( xDim ) / -2.0f ) );
910 mins[1] =
static_cast< proshade_signed
> ( std::floor (
static_cast< proshade_single
> ( yDim ) / -2.0f ) );
911 mins[2] =
static_cast< proshade_signed
> ( std::floor (
static_cast< proshade_single
> ( zDim ) / -2.0f ) );
913 maxs[0] = -( mins[0] + 1 );
914 maxs[1] = -( mins[1] + 1 );
915 maxs[2] = -( mins[2] + 1 );
918 for ( proshade_signed xIt = mins[0]; xIt <= maxs[0]; xIt++ )
920 for ( proshade_signed yIt = mins[1]; yIt <= maxs[1]; yIt++ )
922 for ( proshade_signed zIt = mins[2]; zIt <= 0; zIt++ )
926 static_cast< proshade_double
> ( xIt ),
927 static_cast< proshade_double
> ( yIt ),
928 static_cast< proshade_double
> ( zIt ) );
932 for (
size_t posIt = 0; posIt < 3; posIt++ )
935 interpMins[posIt] =
static_cast< proshade_signed
> ( std::round ( rotVec[posIt] ) );
936 if ( interpMins[posIt] > rotVec[posIt] ) { interpMaxs[posIt] = interpMins[posIt]; interpMins[posIt]--; }
937 else { interpMaxs[posIt] = interpMins[posIt] + 1; }
940 if ( ( maxs[posIt] < interpMins[posIt] ) || ( interpMins[posIt] < mins[posIt] ) || ( maxs[posIt] < interpMaxs[posIt] ) || ( interpMaxs[posIt] < mins[posIt] ) )
942 withinBounds =
false;
947 interpDiff[posIt] = rotVec[posIt] -
static_cast< proshade_double
> ( interpMins[posIt] );
949 if ( !withinBounds ) {
continue; }
952 for (
size_t posIt = 0; posIt < 3; posIt++ )
954 interpMaxs[posIt] = std::min ( maxs[posIt], std::max ( mins[posIt], interpMaxs[posIt] ) );
961 arrPos =
static_cast< size_t > ( ( interpMins[0] - mins[0] ) + zDim * ( ( interpMins[1] - mins[1] ) + yDim * ( interpMins[2] - mins[2] ) ) );
962 if ( arrPos >= dimMax ) {
continue; }
963 c000 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
965 arrPos =
static_cast< size_t > ( ( interpMins[0] - mins[0] ) + zDim * ( ( interpMins[1] - mins[1] ) + yDim * ( interpMaxs[2] - mins[2] ) ) );
966 if ( arrPos >= dimMax ) {
continue; }
967 c001 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
969 arrPos =
static_cast< size_t > ( ( interpMins[0] - mins[0] ) + zDim * ( ( interpMaxs[1] - mins[1] ) + yDim * ( interpMins[2] - mins[2] ) ) );
970 if ( arrPos >= dimMax ) {
continue; }
971 c010 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
973 arrPos =
static_cast< size_t > ( ( interpMins[0] - mins[0] ) + zDim * ( ( interpMaxs[1] - mins[1] ) + yDim * ( interpMaxs[2] - mins[2] ) ) );
974 if ( arrPos >= dimMax ) {
continue; }
975 c011 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
977 arrPos =
static_cast< size_t > ( ( interpMaxs[0] - mins[0] ) + zDim * ( ( interpMins[1] - mins[1] ) + yDim * ( interpMins[2] - mins[2] ) ) );
978 if ( arrPos >= dimMax ) {
continue; }
979 c100 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
981 arrPos =
static_cast< size_t > ( ( interpMaxs[0] - mins[0] ) + zDim * ( ( interpMins[1] - mins[1] ) + yDim * ( interpMaxs[2] - mins[2] ) ) );
982 if ( arrPos >= dimMax ) {
continue; }
983 c101 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
985 arrPos =
static_cast< size_t > ( ( interpMaxs[0] - mins[0] ) + zDim * ( ( interpMaxs[1] - mins[1] ) + yDim * ( interpMins[2] - mins[2] ) ) );
986 if ( arrPos >= dimMax ) {
continue; }
987 c110 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
989 arrPos =
static_cast< size_t > ( ( interpMaxs[0] - mins[0] ) + zDim * ( ( interpMaxs[1] - mins[1] ) + yDim * ( interpMaxs[2] - mins[2] ) ) );
990 if ( arrPos >= dimMax ) {
continue; }
991 c111 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
994 c00 = ( c000 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c100 *
static_cast< proshade_double
> ( interpDiff[0] ) );
995 c01 = ( c001 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c101 *
static_cast< proshade_double
> ( interpDiff[0] ) );
996 c10 = ( c010 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c110 *
static_cast< proshade_double
> ( interpDiff[0] ) );
997 c11 = ( c011 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c111 *
static_cast< proshade_double
> ( interpDiff[0] ) );
1000 c0 = ( c00 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[1] ) ) ) + ( c10 *
static_cast< proshade_double
> ( interpDiff[1] ) );
1001 c1 = ( c01 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[1] ) ) ) + ( c11 *
static_cast< proshade_double
> ( interpDiff[1] ) );
1004 arrPos =
static_cast< size_t > ( ( zIt - mins[2] ) + zDim * ( ( yIt - mins[1] ) + yDim * ( xIt - mins[0] ) ) );
1005 if ( arrPos >= dimMax ) {
continue; }
1006 rotCoeffs[arrPos][0] = ( ( c0 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[2] ) ) ) + ( c1 *
static_cast< proshade_double
> ( interpDiff[2] ) ) ).real();
1007 rotCoeffs[arrPos][1] = ( ( c0 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[2] ) ) ) + ( c1 *
static_cast< proshade_double
> ( interpDiff[2] ) ) ).imag();
1010 if ( ( mins[0] == xIt ) || ( mins[1] == yIt ) || ( mins[2] == zIt ) ) {
continue; }
1012 arrPos2 =
static_cast< size_t > ( ( -zIt - mins[2] ) + zDim * ( ( -yIt - mins[1] ) + yDim * ( -xIt - mins[0] ) ) );
1013 if ( arrPos2 >= dimMax ) {
continue; }
1014 rotCoeffs[arrPos2][0] = rotCoeffs[arrPos][0];
1015 rotCoeffs[arrPos2][1] = rotCoeffs[arrPos][1] * -1.0;
1021 for ( proshade_signed xIt = 0; xIt < xDim; xIt++ )
1023 for ( proshade_signed yIt = 0; yIt < yDim; yIt++ )
1025 for ( proshade_signed zIt = 0; zIt < zDim; zIt++ )
1027 arrPos =
static_cast< size_t > ( zIt + zDim * ( yIt + yDim * xIt ) );
1028 arrPos2 =
static_cast< size_t > ( xIt + xDim * ( yIt + yDim * zIt ) );
1030 if ( std::isnan ( rotCoeffs[arrPos][0] ) ) { rotCoeffsHlp[arrPos2][0] = 0.0;
continue; }
1031 if ( std::isnan ( rotCoeffs[arrPos][1] ) ) { rotCoeffsHlp[arrPos2][1] = 0.0;
continue; }
1033 rotCoeffsHlp[arrPos2][0] = rotCoeffs[arrPos][0];
1034 rotCoeffsHlp[arrPos2][1] = rotCoeffs[arrPos][1];
1038 for (
size_t iter = 0; iter < static_cast< size_t > ( xDim * yDim * zDim ); iter++ ) { rotCoeffs[iter][0] = rotCoeffsHlp[iter][0]; rotCoeffs[iter][1] = rotCoeffsHlp[iter][1]; }
1044 delete[] interpMaxs;
1045 delete[] interpMins;
1046 delete[] interpDiff;
1047 fftw_free ( rotCoeffsHlp );
1067 proshade_single xMov =
static_cast< proshade_single
> ( -trsX );
1068 proshade_single yMov =
static_cast< proshade_single
> ( -trsY );
1069 proshade_single zMov =
static_cast< proshade_single
> ( -trsZ );
1073 this->getXFromPtr(), this->getXToPtr(), this->getYFromPtr(), this->getYToPtr(),
1074 this->getZFromPtr(), this->getZToPtr(), this->getXAxisOrigin(), this->getYAxisOrigin(), this->getZAxisOrigin() );
1078 static_cast< proshade_signed
> ( this->getXDim() ),
static_cast< proshade_signed
> ( this->getYDim() ),
1079 static_cast< proshade_signed
> ( this->getZDim() ) );
1091 this->rotSphericalHarmonics =
new proshade_complex* [this->noSpheres];
1095 for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
1098 this->rotSphericalHarmonics[iter] =
new proshade_complex [
static_cast<proshade_unsign
> ( pow ( (this->spheres[iter]->getLocalBandwidth() * 2), 2) )];
1102 for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( pow ( (this->spheres[iter]->getLocalBandwidth() * 2), 2) ); it++ )
1104 this->rotSphericalHarmonics[iter][it][0] = 0.0;
1105 this->rotSphericalHarmonics[iter][it][1] = 0.0;
1119 proshade_double WigDR, WigDI, *ShR, *ShI, retR, retI;
1120 proshade_unsign arrPos;
1123 for ( proshade_signed shell = 0; shell < static_cast<proshade_signed> ( this->noSpheres ); shell++ )
1126 for ( proshade_signed bandIter = 0; bandIter < static_cast<proshade_signed> ( this->spheres[shell]->getLocalBandwidth() ); bandIter++ )
1129 for ( proshade_signed order1 = 0; order1 < ( ( bandIter * 2 ) + 1 ); order1++ )
1132 ShR = getRealSphHarmValue (
static_cast< proshade_unsign
> ( bandIter ),
static_cast< proshade_unsign
> ( order1 ),
static_cast< proshade_unsign
> ( shell ) );
1133 ShI = getImagSphHarmValue (
static_cast< proshade_unsign
> ( bandIter ),
static_cast< proshade_unsign
> ( order1 ),
static_cast< proshade_unsign
> ( shell ) );
1136 for ( proshade_signed order2 = 0; order2 < ( ( bandIter * 2 ) + 1 ); order2++ )
1139 this->getWignerMatrixValue (
static_cast< proshade_unsign
> ( bandIter ),
static_cast< proshade_unsign
> ( order1 ),
static_cast< proshade_unsign
> ( order2 ), &WigDR, &WigDI );
1145 arrPos =
static_cast<proshade_unsign
> ( seanindex (
static_cast< int > ( order2-bandIter ),
static_cast< int > ( bandIter ),
1146 static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ) ) );
1147 this->rotSphericalHarmonics[shell][arrPos][0] += retR;
1148 this->rotSphericalHarmonics[shell][arrPos][1] += retI;
1174 proshade_unsign oneDim = shBand * 2;
1177 sigR =
new double [(oneDim * oneDim * 4)];
1178 sigI = sigR + (oneDim * oneDim * 2);
1179 rcoeffs =
new double [(oneDim * oneDim * 2)];
1180 icoeffs = rcoeffs + (oneDim * oneDim);
1181 weights =
new double [4 * shBand];
1182 workspace =
new double [( 20 * shBand * shBand ) + ( 24 * shBand )];
1191 idctPlan = fftw_plan_r2r_1d (
static_cast< int > ( oneDim ), weights, workspace, FFTW_REDFT01, FFTW_ESTIMATE );
1194 int rank, howmany_rank;
1195 fftw_iodim dims[1], howmany_dims[1];
1198 dims[0].n = 2 *
static_cast< int > ( shBand );
1199 dims[0].is = 2 *
static_cast< int > ( shBand );
1202 howmany_dims[0].n = 2 *
static_cast< int > ( shBand );
1203 howmany_dims[0].is = 1;
1204 howmany_dims[0].os = 2 *
static_cast< int > ( shBand );
1207 ifftPlan = fftw_plan_guru_split_dft ( rank, dims, howmany_rank, howmany_dims, sigR, sigI, rcoeffs, icoeffs, FFTW_ESTIMATE );
1220 double *sigR =
nullptr, *sigI =
nullptr, *rcoeffs =
nullptr, *icoeffs =
nullptr, *weights =
nullptr, *workspace =
nullptr;
1221 fftw_plan idctPlan, ifftPlan;
1224 for (
int shell = 0; shell < static_cast<int> ( this->noSpheres ); shell++ )
1227 proshade_unsign oneDim = this->spheres[shell]->getLocalBandwidth() * 2;
1233 makeweights (
static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ), weights );
1236 this->spheres[shell]->allocateRotatedMap ( );
1239 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( oneDim * oneDim ); iter++ )
1241 rcoeffs[iter] = this->rotSphericalHarmonics[shell][iter][0];
1242 icoeffs[iter] = this->rotSphericalHarmonics[shell][iter][1];
1248 InvFST_semi_fly ( rcoeffs,
1252 static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ),
1255 static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ),
1260 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( oneDim * oneDim ); iter++ )
1262 this->spheres[shell]->setRotatedMappedData ( iter, sigR[iter] );
1266 fftw_destroy_plan ( idctPlan );
1267 fftw_destroy_plan ( ifftPlan );
1290 for ( proshade_unsign iter = 0; iter <= angRes; iter++ )
1292 ProSHADE_internal_misc::addToDoubleVector ( lonCO,
static_cast<proshade_double
> ( iter ) * ( (
static_cast<proshade_double
> ( M_PI ) * 2.0 ) /
static_cast<proshade_double
> ( angRes ) ) - (
static_cast<double> ( M_PI ) ) );
1296 for ( proshade_unsign iter = 0; iter <= angRes; iter++ )
1298 ProSHADE_internal_misc::addToDoubleVector ( latCO,
static_cast<proshade_double
> ( iter ) * (
static_cast<proshade_double
> ( M_PI ) /
static_cast<proshade_double
> ( angRes ) ) - (
static_cast<proshade_double
> ( M_PI ) / 2.0 ) );
1313 proshade_double rad = 0.0, lon = 0.0, lat = 0.0, newU = 0.0, newV = 0.0, newW = 0.0;
1314 proshade_unsign lowerLonL = 0, upperLonL = 0, lowerLonU = 0, upperLonU = 0, lowerLatL = 0, upperLatL = 0, lowerLatU = 0, upperLatU = 0, lowerShell = 0, upperShell = 0;
1315 proshade_double x00 = 0.0, x01 = 0.0, x10 = 0.0, x11 = 0.0, distLLon = 0.0, distLLat = 0.0, distLRad = 0.0, valLLon = 0.0, valULon = 0.0;
1316 proshade_double lowerShellValue = 0.0, upperShellValue = 0.0;
1317 proshade_double xSamplingRate =
static_cast<proshade_double
> ( this->xDimSize ) /
static_cast<proshade_double
> ( this->xDimIndices );
1318 proshade_double ySamplingRate =
static_cast<proshade_double
> ( this->yDimSize ) /
static_cast<proshade_double
> ( this->yDimIndices );
1319 proshade_double zSamplingRate =
static_cast<proshade_double
> ( this->zDimSize ) /
static_cast<proshade_double
> ( this->zDimIndices );
1320 proshade_signed arrPos;
1321 std::vector<proshade_double> lonCOU, latCOU, lonCOL, latCOL;
1323 for ( proshade_signed uIt = 0; uIt < static_cast<proshade_signed> (this->xDimIndices); uIt++ )
1325 for ( proshade_signed vIt = 0; vIt < static_cast<proshade_signed> (this->yDimIndices); vIt++ )
1327 for ( proshade_signed wIt = 0; wIt < static_cast<proshade_signed> (this->zDimIndices); wIt++ )
1330 newU =
static_cast<proshade_double
> ( uIt - (
static_cast<proshade_signed
> (this->xDimIndices) / 2 ) );
1331 newV =
static_cast<proshade_double
> ( vIt - (
static_cast<proshade_signed
> (this->yDimIndices) / 2 ) );
1332 newW =
static_cast<proshade_double
> ( wIt - (
static_cast<proshade_signed
> (this->zDimIndices) / 2 ) );
1335 if ( ( newU == 0.0 ) && ( newV == 0.0 ) && ( newW == 0.0 ) )
1337 arrPos = wIt +
static_cast< proshade_signed
> ( this->zDimIndices ) * ( vIt +
static_cast< proshade_signed
> ( this->yDimIndices ) * uIt );
1338 densityMapRotated[arrPos] = this->internalMap[arrPos];
1343 rad = sqrt ( pow( ( newU * xSamplingRate ), 2.0 ) +
1344 pow( ( newV * ySamplingRate ), 2.0 ) +
1345 pow( ( newW * zSamplingRate ), 2.0 ) );
1346 lon = atan2 ( ( newV * ySamplingRate ), ( newU * xSamplingRate ) );
1347 lat = asin ( ( newW * zSamplingRate ) / rad );
1350 if ( rad != rad ) { rad = 0.0; }
1351 if ( lon != lon ) { lon = 0.0; }
1352 if ( lat != lat ) { lat = 0.0; }
1357 for ( proshade_unsign iter = 0; iter < (this->noSpheres-1); iter++ )
1359 if ( (
static_cast< proshade_double
> ( this->spherePos.at(iter) ) <= rad ) && (
static_cast< proshade_double
> ( this->spherePos.at(iter+1) ) > rad ) )
1362 upperShell = iter+1;
1367 if ( upperShell == 0 )
1369 arrPos = wIt +
static_cast< proshade_signed
> ( this->zDimIndices ) * ( vIt +
static_cast< proshade_signed
> ( this->yDimIndices ) * uIt );
1370 densityMapRotated[arrPos] = 0.0;
1375 lonCOL.clear(); latCOL.clear(); lonCOU.clear(); latCOU.clear();
1380 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( lonCOL.size() ); iter++ )
1382 if ( iter == (
static_cast<proshade_unsign
> ( lonCOL.size() ) - 1 ) )
1388 if ( ( std::floor(10000. * lonCOL.at(iter)) <= std::floor(10000. * lon) ) && ( std::floor(10000. * lonCOL.at(iter+1)) > std::floor(10000. * lon) ) )
1395 if ( upperLonL == this->spheres[lowerShell]->getLocalAngRes() ) { upperLonL = 0; }
1397 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( lonCOU.size() ); iter++ )
1399 if ( iter == (
static_cast<proshade_unsign
> ( lonCOU.size() ) - 1 ) )
1405 if ( ( std::floor(10000. * lonCOU.at(iter)) <= std::floor(10000. * lon) ) && ( std::floor(10000. * lonCOU.at(iter+1)) > std::floor(10000. * lon) ) )
1412 if ( upperLonU == this->spheres[upperShell]->getLocalAngRes() ) { upperLonU = 0; }
1414 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( latCOL.size() ); iter++ )
1416 if ( iter == (
static_cast<proshade_unsign
> ( latCOL.size() ) - 1 ) )
1422 if ( ( std::floor(10000. * latCOL.at(iter)) <= std::floor(10000. * lat) ) && ( std::floor(10000. * latCOL.at(iter+1)) > std::floor(10000. * lat) ) )
1429 if ( upperLatL == this->spheres[lowerShell]->getLocalAngRes() ) { upperLatL = 0; }
1431 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( latCOU.size() ); iter++ )
1433 if ( iter == (
static_cast<proshade_unsign
> ( latCOU.size() ) - 1 ) )
1439 if ( ( std::floor(10000. * latCOU.at(iter)) <= std::floor(10000. * lat) ) && ( std::floor(10000. * latCOU.at(iter+1)) > std::floor(10000. * lat) ) )
1446 if ( upperLatU == this->spheres[upperShell]->getLocalAngRes() ) { upperLatU = 0; }
1449 x00 = this->spheres[lowerShell]->getRotatedMappedData ( lowerLatL * this->spheres[lowerShell]->getLocalAngRes() + lowerLonL );
1450 x01 = this->spheres[lowerShell]->getRotatedMappedData ( lowerLatL * this->spheres[lowerShell]->getLocalAngRes() + upperLonL );
1451 x10 = this->spheres[lowerShell]->getRotatedMappedData ( upperLatL * this->spheres[lowerShell]->getLocalAngRes() + lowerLonL );
1452 x11 = this->spheres[lowerShell]->getRotatedMappedData ( upperLatL * this->spheres[lowerShell]->getLocalAngRes() + upperLonL );
1454 distLLon = std::abs ( lon - lonCOL.at(lowerLonL) ) / ( std::abs( lon - lonCOL.at(lowerLonL) ) + std::abs( lon - lonCOL.at(upperLonL) ) );
1455 valLLon = ( ( 1.0 - distLLon ) * x00 ) + ( distLLon * x01 );
1456 valULon = ( ( 1.0 - distLLon ) * x10 ) + ( distLLon * x11 );
1458 distLLat = std::abs ( lat - latCOL.at(lowerLatL) ) / ( std::abs( lat - latCOL.at(lowerLatL) ) + std::abs( lat - latCOL.at(upperLatL) ) );
1459 lowerShellValue = ( ( 1.0 - distLLat ) * valLLon ) + ( distLLat * valULon );
1462 x00 = this->spheres[upperShell]->getRotatedMappedData ( lowerLatU * this->spheres[upperShell]->getLocalAngRes() + lowerLonU );
1463 x01 = this->spheres[upperShell]->getRotatedMappedData ( lowerLatU * this->spheres[upperShell]->getLocalAngRes() + upperLonU );
1464 x10 = this->spheres[upperShell]->getRotatedMappedData ( upperLatU * this->spheres[upperShell]->getLocalAngRes() + lowerLonU );
1465 x11 = this->spheres[upperShell]->getRotatedMappedData ( upperLatU * this->spheres[upperShell]->getLocalAngRes() + upperLonU );
1467 distLLon = std::abs ( lon - lonCOU.at(lowerLonU) ) / ( std::abs( lon - lonCOU.at(lowerLonU) ) + std::abs( lon - lonCOU.at(upperLonU) ) );
1468 valLLon = ( ( 1.0 - distLLon ) * x00 ) + ( distLLon * x01 );
1469 valULon = ( ( 1.0 - distLLon ) * x10 ) + ( distLLon * x11 );
1471 distLLat = std::abs ( lat - latCOU.at(lowerLatU) ) / ( std::abs( lat - latCOU.at(lowerLatU) ) + std::abs( lat - latCOU.at(upperLatU) ) );
1472 upperShellValue = ( ( 1.0 - distLLat ) * valLLon ) + ( distLLat * valULon );
1475 distLRad = std::abs ( rad -
static_cast< proshade_double
> ( this->spherePos.at(lowerShell) ) ) / ( std::abs( rad -
static_cast< proshade_double
> ( this->spherePos.at(lowerShell) ) ) +
1476 std::abs( rad -
static_cast< proshade_double
> ( this->spherePos.at(upperShell) ) ) );
1478 arrPos = wIt +
static_cast< proshade_signed
> ( this->zDimIndices ) * ( vIt +
static_cast< proshade_signed
> ( this->yDimIndices ) * uIt );
1479 densityMapRotated[arrPos] = ( ( 1.0 - distLRad ) * lowerShellValue ) + ( distLRad * upperShellValue );
1499 std::vector < proshade_double > ret;
1500 proshade_double eulA, eulB, eulG;
1504 this->getEMatDim ( ) * 2,
1505 &eulA, &eulB, &eulG, settings );