Skip to content

Instantly share code, notes, and snippets.

@agirault
Created March 24, 2014 18:19
Show Gist options
  • Save agirault/9745990 to your computer and use it in GitHub Desktop.
Save agirault/9745990 to your computer and use it in GitHub Desktop.
compilation errors after creating new solver to be added to the CSolverFactory for calaTK
=> MODIFICATIONS
/* In CSolverFactory.h */
+ #include "CSolverStepLengthSelection.h"
+ typedef CSolverStepLengthSelection< TState > SolverStepLengthSelection;
+ enum NumericSolverType {StepLengthSelection, LineSearchUnconstrained, LineSearchConstrained, IpOpt, LBFGS, NLOPT };
- enum NumericSolverType {LineSearchUnconstrained, LineSearchConstrained, IpOpt, LBFGS, NLOPT };
/* In CSolverFactory.txx */
CSolverFactory< TState >::CreateNewSolver( NumericSolverType solver )
+ case StepLengthSelection:
+ ptrSolver = new SolverStepLengthSelection;
+ break;
CSolverFactory< TState >::GetSolverTypeFromString( std::string sSolver )
+ if ( sSolverLowerCase == "steplengthselection" )
+ {
+ return StepLengthSelection;
+ }
/* In CSolverMultiScale.txx */
CSolverMultiScale< TState >::CSolverMultiScale()
+ : DefaultSingleScaleSolver( "StepLengthSelection" ),
=> COMPILATION ERRORS
CSolverFactory.txx: In static member function ‘static CALATK::CSolver<TState>* CALATK::CSolverFactory<TState>::CreateNewSolver(CALATK::CSolverFactory<TState>::NumericSolverType) [with TState = CALATK::CStateInitialImageMomentum<float, 1u>]’:
CSolverFactory.txx:85: instantiated from ‘static CALATK::CSolver<TState>* CALATK::CSolverFactory<TState>::CreateNewSolver(std::string) [with TState = CALATK::CStateInitialImageMomentum<float, 1u>]’
CSolverMultiScale.txx:75: instantiated from ‘void CALATK::CSolverMultiScale<TState>::SetDefaultSingleScaleSolver() [with TState = CALATK::CStateInitialImageMomentum<float, 1u>]’
CSolverMultiScale.txx:110: instantiated from ‘bool CALATK::CSolverMultiScale<TState>::Solve() [with TState = CALATK::CStateInitialImageMomentum<float, 1u>]’
json.h:864: instantiated from here
CSolverFactory.txx:73: error: cannot allocate an object of abstract type ‘CALATK::CSolverStepLengthSelection<CALATK::CStateInitialImageMomentum<float, 1u> >’
CSolverStepLengthSelection.h:17: note: because the following virtual functions are pure within ‘CALATK::CSolverStepLengthSelection<CALATK::CStateInitialImageMomentum<float, 1u> >’:
CSolver.h:59: note: bool CALATK::CSolver<TState>::SolvePreInitialized() [with TState = CALATK::CStateInitialImageMomentum<float, 1u>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment