Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementation of positivity constraint #2

Open
mhantke opened this issue Jun 29, 2012 · 1 comment
Open

implementation of positivity constraint #2

mhantke opened this issue Jun 29, 2012 · 1 comment
Assignees

Comments

@mhantke
Copy link
Collaborator

mhantke commented Jun 29, 2012

Hi Filipe,

I found that choosing positivity constraint for a complex object forces the object to have positive real and imaginary parts. Is that how it is supposed to be?
We were assuming that positivity constraint only means that the real part is forced to be positive.

We were thinking about implementing a more general way of constraining the phase shift of the object. Filipe, what do you think?

I refer to the following two parts in the code:

phasing.c: phaser_apply_constraints(...)
}else if(constraints & SpPositiveComplexObject){
if(sp_real(new_model->image->data[i]) < 0){
if(constraints & SpPositivityFlipping){
sp_real(new_model->image->data[i]) = fabs(sp_real(new_model->image->data[i]));
}else{
sp_real(new_model->image->data[i]) = 0;
}
}
if(sp_imag(new_model->image->data[i]) < 0){
if(constraints & SpPositivityFlipping){
sp_imag(new_model->image->data[i]) = fabs(sp_imag(new_model->image->data[i]));
}else{
sp_imag(new_model->image->data[i]) = 0;
}
}

  1. phasing_kernels.cu
    }else if(constraints & SpPositiveComplexObject){
    if(g[i].x < 0){
    if(constraints & SpPositivityFlipping){
    g[i].x = fabs(g[i].x);
    }else{
    g[i].x = 0;
    }
    }
    if(g[i].y < 0){
    if(constraints & SpPositivityFlipping){
    g[i].y = fabs(g[i].y);
    }else{
    g[i].y = 0;
    }
    }
    }
@ghost ghost assigned FilipeMaia Jun 29, 2012
@FilipeMaia
Copy link
Collaborator

Hi,

Sure we could do something more flexible.
What do you have in mind?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants