EMAN2
Functions
project3d_Cart.h File Reference
#include "mpi.h"
#include "emdata.h"
Include dependency graph for project3d_Cart.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int sphpart (MPI_Comm comm_2d, int nrays, int *ptrs, int *nnzbase, int *ptrstart)
int getcb2sph (Vec3i volsize, int ri, Vec3i origin, int nnz0, int *ptrs, int *cord)
int fwdpj3_Cart (Vec3i volsize, int nraysloc, int nnzloc, float *dm, Vec3i origin, int ri, int *ptrs, int *cord, int myptrstart, float *x, float *y)
int bckpj3_Cart (Vec3i volsize, int nraysloc, int nnzloc, float *dm, Vec3i origin, int ri, int *ptrs, int *cord, int myptrstart, float *x, float *y)

Function Documentation

int bckpj3_Cart ( Vec3i  volsize,
int  nraysloc,
int  nnzloc,
float *  dm,
Vec3i  origin,
int  ri,
int *  ptrs,
int *  cord,
int  myptrstart,
float *  x,
float *  y 
)
int fwdpj3_Cart ( Vec3i  volsize,
int  nraysloc,
int  nnzloc,
float *  dm,
Vec3i  origin,
int  ri,
int *  ptrs,
int *  cord,
int  myptrstart,
float *  x,
float *  y 
)
int getcb2sph ( Vec3i  volsize,
int  ri,
Vec3i  origin,
int  nnz0,
int *  ptrs,
int *  cord 
)
int sphpart ( MPI_Comm  comm_2d,
int  nrays,
int *  ptrs,
int *  nnzbase,
int *  ptrstart 
)

Definition at line 85 of file project3d_Cart.cpp.

{
        int ROW = 0, COL = 1;
        int dims[2], periods[2], mycoords[2];
        int nraysloc = 0;
        
        // Get information associated with comm_2d
        MPI_Cart_get(comm_2d, 2, dims, periods, mycoords);

        int count = 1;
        if (mycoords[COL] == 0){ // First column starts out with the first ray
          nraysloc++;
        }
        ptrstart[0] = 0;

        for(int i=1; i<nrays ; i++){
          if (ptrs[i]-1 <= nnzbase[count] && ptrs[i+1]-1 >= nnzbase[count]){ 
                //nnzbase is between or equal to ptrs

            if (nnzbase[count]-(ptrs[i]-1)>= ptrs[i+1]-1-nnzbase[count]){
              if(mycoords[COL] == count-1){  // ray belongs to count-1
                nraysloc++;
              }
              ptrstart[count] = i+1;
              count++;

            } else { //nnzbase[count]-(ptrs[i]-1)>= ptrs[i+1]-1-nnzbase[count]
                if(mycoords[COL] == count){// ray belongs to count and it's a new starting ray
                  nraysloc++;
                }
                ptrstart[count] = i;
                count++;
            }

        }
        else {  //ptrs[i]-1 > nnzbase[count] so ray belongs to count-1
          if(mycoords[COL] == count-1){
            nraysloc++;
          }

        }
        } // end for
        ptrstart[dims[COL]] = nrays;
        return nraysloc;

}