MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Using the Combinatorica Package in my own package

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119343] Re: Using the Combinatorica Package in my own package
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Tue, 31 May 2011 07:47:32 -0400 (EDT)
  • References: <irvrs1$8ij$1@smc.vnet.net>
  • Reply-to: nma at 12000.org

On 5/30/2011 3:34 AM, Karl Schulz wrote:
> Hello all,
>
> I am currently trying to create my first package in mathematica 8.0.
>
> I tried the reference package from http://reference.wolfram.com/mathematica/tutorial/SettingUpMathematicaPackages.html, which worked without a problem.
>
> In my own package, I would like to use the package combinatorica for the numbers
>  of vertices of a graph V[G], since I would like to create multiple arrays with V[G] entries.
>
> So I tried the following:
> ----------------------------
> BeginPackage["karl`"]
>
> Needs["Combinatorica`"]
>
> Begin["`Private`"]
>
> karl[G_]:=Array[numberone, V[G]];
> Array[numbertwo, V[G]];
>
> End[ ]
> ----------------------------
> Which gave me the following message:
>
> Array::ilsmn: "Single or list of non-negative machine-sized integers expected
>at position 2 of Array[numbertwo,V[G]]. "
> EndPackage[ ]
>
> I then tried karl[G_Graph] to see if that fixed it, but the same error occurs.
>
> Can someone see my error or suggest a fix? Thank you :-)
>
> Many greetings,
> Karl Schulz
>

In 8.0.1, I get this:

Needs["Combinatorica`"]

General::compat: Combinatorica Graph and Permutations functionality has
been superseded by preloaded functionaliy. The package now being
loaded may conflict with this. Please see the Compatibility Guide for details.

Do you this in 8.0?  w.r.t to your call, I do not understand it,
as I do not see what what these 'numberone', 'V' and 'G' came
from. Isn't some of these things supposed to be defined before
making the call?

--Nasser


  • Prev by Date: Re: Export["...",...,"GIF"] results in nonreadable gif file
  • Next by Date: Re: sequential elements of list
  • Previous by thread: Using the Combinatorica Package in my own package
  • Next by thread: Export["...",...,"GIF"] results in nonreadable gif file