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

Update proxTV to easily call it from C #62

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9c97251
Minor syntax changes to compile properly
nathanemac Sep 3, 2024
bc79acd
avoid mangling by encapsulating functions in cpp files
nathanemac Sep 3, 2024
73b2528
pus for alexis
nathanemac Sep 3, 2024
5fb3bef
fixing bugs
nathanemac Sep 3, 2024
1a0b1aa
fix one extern C
nathanemac Sep 3, 2024
149df38
Fix the compilation
amontoison Sep 3, 2024
f06877d
Remove Mac files
amontoison Sep 3, 2024
6f7ad7e
Final version of proxTV
amontoison Sep 3, 2024
02af58b
fix double-free memory issue with wsinner in GPFW_TVp
nathanemac Sep 20, 2024
37ccfc9
fix double-free memory issue with wsinner in GPFW_TVp
nathanemac Sep 20, 2024
fa1bd94
Update .gitignore with .DS_Store
nathanemac Sep 20, 2024
8d780db
Résolution des conflits et configuration de .gitignore
nathanemac Nov 19, 2024
d35fc41
modify first candidate in LPopt.cpp & allow TV to take objGap as opti…
nathanemac Nov 19, 2024
3225ef9
add files to .gitignore
nathanemac Nov 19, 2024
716fa41
Résolution des conflits et configuration de .gitignore
nathanemac Nov 19, 2024
c7c91a5
modify first candidate in LPopt.cpp & allow TV to take objGap as opti…
nathanemac Nov 19, 2024
2a51811
add files to .gitignore
nathanemac Nov 19, 2024
0272ffc
Merge remote-tracking branch 'upstream/master'
nathanemac Dec 3, 2024
977395b
add callback
nathanemac Nov 26, 2024
a9add91
small updates
nathanemac Nov 27, 2024
ed29a96
small updates
nathanemac Nov 27, 2024
08048a4
use kwargs in PN_LPp to dispatch whether to use objgap condition or c…
nathanemac Nov 28, 2024
5d937a3
fix signs when calling callback
nathanemac Nov 29, 2024
8a8b7ff
small updates
nathanemac Nov 29, 2024
48c5847
small updates
nathanemac Nov 29, 2024
b8f5d3f
last changes before update
nathanemac Dec 2, 2024
324313a
last update on clipping if d in inf ou too big
nathanemac Dec 2, 2024
66a2ced
remove crap
nathanemac Dec 2, 2024
ac72164
remove crap
nathanemac Dec 2, 2024
45e51ec
remove crap
nathanemac Dec 2, 2024
243b28c
remove useless prints
nathanemac Dec 3, 2024
1531747
addressing memory issue
nathanemac Dec 3, 2024
1e5026e
fixing memory issue
nathanemac Dec 4, 2024
2774119
fixing memory issue
nathanemac Dec 4, 2024
778233b
fixing memory issue
nathanemac Dec 4, 2024
cf17880
addressing memory issue
nathanemac Dec 4, 2024
ac21e5b
Merge pull request #3 from nathanemac/add_callback_objgap
nathanemac Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
small updates
nathanemac committed Dec 3, 2024
commit a9add918d0adab16776840c41f72422793143e1c
4 changes: 2 additions & 2 deletions src/LPopt.cpp
Original file line number Diff line number Diff line change
@@ -222,9 +222,9 @@ int PN_LPp(double *y,double lambda,double *x,double *info,int n,double p,Workspa
int i,j,iters,recomp,found,nI;
short updateKind;

/* If ctx_ptr and callback are NULL, return an error with message "Error: PN_LPp can only be use with valid context pointer and callback."*/
/* If ctx_ptr or callback are NULL, return an error with message "Error: PN_LPp can only be used with valid context pointer and callback."*/
if (ctx_ptr == NULL || callback == NULL) {
printf("Error: PN_LPp can only be use with valid context pointer and callback.\n");
printf("Error: PN_LPp can only be used with valid context pointer and callback.\n");
return 0;
}

2 changes: 2 additions & 0 deletions src/TVgenopt.cpp
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@
@param p degree of the TV norm to apply
@param ws pointer to workspace to use, or null if the method should alloc its own memory
@param objGapTVp dual gap required by user for the 1D-TVp algorithm
@param ctx_ptr pointer to context data to pass to the callback function
@param callback callback function to call at each iteration
*/
int TV(double *y,double lambda,double *x,double *info,int n,double p,Workspace *ws, void* ctx_ptr, int (*callback)(const double* s_ptr, size_t s_length, double delta_k, void* ctx_ptr), double objGapTVp) {
#define CANCEL(txt,info) \