This piece of software implements the procedure called IALGENCAN for
solving the problem of packing rectangles within isotropic convex
regions, described in [1].

[1] E. G. Birgin and R. D. Lobato, Orthogonal packing of rectangles
within isotropic convex regions, submitted, 2009.

This instructions guides you on how to install and run it in a SUN, Solaris 
or Linux platform (installation in a Windows platform is also possible,
but it may vary from system to system, depending on the compiler you have).

How to compile:
===============

Type

./compile.sh

(If the compiler gives you a "warning" just ignore it.)

How to run:
===========

Just type

./igenpack

The program will ask you which problem you would like to solve (choose
a number between 1 and 16 to solve one of the 16 problems presented in
[1]) and the minimum and maximum number of rectangles the method will
try to pack.

The program will show in the screen the number of rectangles it is
being packing until the upper bound is reached.

How to generate the graphical representation of the solution:
=============================================================

Compile the metapost file generated by IALGENCAN typing

mpost solution.mp

It will generate a file called solution.1

Then, to generate the postcript file, just type

latex solution.tex

and then

dvips solution.dvi -o solution.ps

The postscript file with the graphical representation of the solution 
will be in the file called solution.ps.

To see this file, type, for example,

gv solution.ps

How to solve your own problem:
==============================

To solve your own problem you just need a rudimentary acknowledge of
Fortran 77 programming language to edit the file Packing.f95.

In this file you will need add the information of your problem in
the following subroutines:

DEFPRO is the subroutine which defines some information of the problem.
------

Rectangular item information:
-----------------------------

dx = half of the horizontal side of the rectangles
dy = half of the vertical side of the rectangles

Box constraints of the convex region:
-------------------------------------

lx = lower bound for the x-axis 
ux = upper bound for the x-axis 
ly = lower bound for the y-axis 
uy = upper bound for the y-axis 

Extra-information of the convex region:
---------------------------------------

This four parameters must represent a limited box that contains the
convex region. See, for example, problems 4, 5, 6 and 11 that have 
their boxes (which ARE NOT part of the definition of the convex region) 
drawed in [1]. You can see that these boxes do not take part in the
definition of the convex regions at Table 1 of [1].

xmin = containing-box lower bound for the x-axis 
xmax = containing-box upper bound for the y-axis
ymin = containing-box lower bound for the x-axis
ymax = containing-box upper bound for the y-axis

More information of the convex region:
--------------------------------------

r = number of smooth functions in the definition of the convex region

EVALW   is the subroutine that implements the smooth functions that define
-----   the convex region.

EVALDW  is the subroutine that computes the derivatives of the smooth
------  functions that define the convex region.

DRAWSOL is the subroutine that draws the graphical representation of the
------- solution. The piece of code that draws the packed items is common 
        to all the problems and you do not need to modify it. You just 
        need to add the piece of code that draws the convex region. If you 
        are not interested in the graphical representation of the solution, 
        you may skip this subroutine.

After having modified the four subroutines, just compile the program and
run it as explained above.
