help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Help-glpk] "Assertion failed: 1 <= p && p <= T->nslots Errordetecte


From: Kelly, Jeff (ON0F)
Subject: RE: [Help-glpk] "Assertion failed: 1 <= p && p <= T->nslots Errordetected in file ..\src\glpios03.c at line 116"
Date: Fri, 25 Mar 2011 13:27:22 -0400

Andrew;

Thanks.

My callback subroutine shown below in Fortran (sorry) uses the tree as an 
integer pointer and passes this to glp_ios_curr_node().  And, even when 
glp_ios_curr_node() is not used in the callback subroutine I still get the 
assestion failure.

Therefore I take it that I am somehow corrupting the tree structure 
inadvertently.

I am wondering if there is anything else I can do? other then chalking it up as 
a Fortran to C "inoperability" issue.

Regards, Jeff

      subroutine GLPKintsolcb(tree,info) 
cDEC$ ATTRIBUTES DLLEXPORT, STDCALL, REFERENCE, ALIAS : "GLPKINTSOLCB" :: 
GLPKINTSOLCB     
                      
        integer(4), intent(in) :: tree
cDEC$ ATTRIBUTES REFERENCE :: tree
        integer(4), optional, intent(in) :: info
cDEC$ ATTRIBUTES REFERENCE :: info

        interface
          
            integer(4) function glp_ios_curr_node(tree)
cDEC$ ATTRIBUTES DLLIMPORT, STDCALL, ALIAS : "_glp_ios_curr_node" :: 
glp_ios_curr_node
                    integer(4) :: tree
cDEC$ ATTRIBUTES REFERENCE :: tree
          end function
          
        end interface  

!comment        write(*,*)glp_ios_curr_node(tree)
                 
      end subroutine GLPKintsolcb 

-----Original Message-----
From: Andrew Makhorin [mailto:address@hidden 
Sent: Friday, March 25, 2011 12:41 PM
To: Kelly, Jeff (ON0F)
Cc: address@hidden
Subject: Re: [Help-glpk] "Assertion failed: 1 <= p && p <= T->nslots 
Errordetected in file ..\src\glpios03.c at line 116"


> I am interfacing GLPK using Fortran 2003 and when solving a MILP
>   problem using the callback function “cb_func” I am getting the
>   following assertion error from is_branch_hopeful().  Assertion
>  failed:  1 <= p && p <= T->nslots
> 
> Error detected in file ..\src\glpios03.c at line 116
> 
> However, when I run with cb_func = NULL as the default GLPK works fine
> but I have no callback to interrupt when integer-feasible solutions
> are found unfortunately.
> 
> When I write out the subproblem index or node number i.e., “p” above
> using glp_ios_curr_node(tree)within my callback routine, it correctly
> writes out “0” and “1” – see below:
> 
> Integer optimization begins...
> 
>            0
> 
> +  3457: mip =     not found yet <=              +inf        (1; 0)
> 
>            1
> 
> Therefore my only conclusion is that the tree’s number of slots i.e.,
> “T->nslots” is 0 (zero) for some reason after the call to
> glp_intopt().
> 
> Any assistance on this would be appreciated.

It is an internal error. It might happen if the tree data structure
(glp_tree) is invalid or damaged.

Please note that the search tree exists only within glp_intopt. It is
destroyed on exit from glp_intopt, so you should not access it when
glp_intopt has returned to your main program, even if you stored the
pointer to it (i.e. T) passed to the callback routine. Currently glpk
api routines do not check if a pointer to glp_prob or glp_tree is valid
(assuming that it is valid), so no reasonable error message is
generated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]