Skip to content

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

Description

@jcfr

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)
                                          ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions