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

GroupwiseRegistration::optimization doesn't make use of cost_function #18

Open
jcfr opened this issue Sep 11, 2018 · 1 comment
Open

Comments

@jcfr
Copy link
Contributor

jcfr commented Sep 11, 2018

In the GroupwiseRegistration::optimization function, the cost_function is not used hence the warning reported below.

Indeed, if we trace the flow, there functions are called:

GroupwiseRegistration::optimization -> min_newuoa -> min_newuoa -> newuoa_ -> newuob_ -> biglag_ -> no use of "func"
void GroupwiseRegistration::optimization(void)
{
	cost_function costFunc(this);
	int prev = 0;
	int step = 1;

	while (m_degree_inc < m_degree)
	{
		nIter = 0;
		int n = (m_degree_inc + 1) * (m_degree_inc + 1) * m_nSubj * 2 - prev;
		min_newuoa(n, &m_coeff[prev], costFunc, 1.0f, 1e-5f, m_maxIter);
		prev = (m_degree_inc + 1) * (m_degree_inc + 1) * m_nSubj * 2;
		m_degree_inc = min(m_degree_inc + step, m_degree);
	}
	
	// the entire optimization together
	nIter = 0;
	min_newuoa(m_csize * 2, m_coeff, costFunc, 1.0f, 1e-6f, m_maxIter);
}
In file included from /home/jcfr/Projects/SlicerSALT-Release-Qt5/GROUPS/Modules/CLI/Groups/GroupwiseRegistration.cpp:19:0:
/home/jcfr/Projects/SlicerSALT-Release-Qt5/GROUPS/Modules/CLI/Groups/newuoa.h: In instantiation of ‘int biglag_(int, int, TYPE*, TYPE*, TYPE*, TYPE*, int*, int*, int*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, Func&) [with TYPE = float; Func = cost_function]’:
/home/jcfr/Projects/SlicerSALT-Release-Qt5/GROUPS/Modules/CLI/Groups/newuoa.h:1311:10:   required from ‘TYPE newuob_(int, int, TYPE*, TYPE, TYPE, int*, int, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, TYPE*, int*, TYPE*, TYPE*, TYPE*, Func&) [with TYPE = float; Func = cost_function]’
/home/jcfr/Projects/SlicerSALT-Release-Qt5/GROUPS/Modules/CLI/Groups/newuoa.h:1709:16:   required from ‘TYPE newuoa_(int, int, TYPE*, TYPE, TYPE, int*, int, TYPE*, Func&) [with TYPE = float; Func = cost_function]’
/home/jcfr/Projects/SlicerSALT-Release-Qt5/GROUPS/Modules/CLI/Groups/newuoa.h:1720:15:   required from ‘TYPE min_newuoa(int, TYPE*, Func&, TYPE, TYPE, int) [with TYPE = float; Func = cost_function]’
/home/jcfr/Projects/SlicerSALT-Release-Qt5/GROUPS/Modules/CLI/Groups/GroupwiseRegistration.cpp:1263:65:   required from here
/home/jcfr/Projects/SlicerSALT-Release-Qt5/GROUPS/Modules/CLI/Groups/newuoa.h:59:42: warning: unused parameter ‘func’ [-Wunused-parameter]
        TYPE *gd, TYPE *s, TYPE *w, Func &func)
                                          ^
@jcfr
Copy link
Contributor Author

jcfr commented Sep 11, 2018

Cc: @ilwoolyu @juanprietob @bpaniagua

@jcfr jcfr changed the title GroupwiseRegistration::optimization doesn't make sure of cost_function GroupwiseRegistration::optimization doesn't make use of cost_function Sep 11, 2018
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

1 participant