Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2792 > unrolled thread

Using the Combinatorica Package in my own package

Started byKarl Schulz <karlschulz@pwned.de>
First post2011-05-30 10:34 +0000
Last post2011-05-31 11:47 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Using the Combinatorica Package in my own package Karl Schulz <karlschulz@pwned.de> - 2011-05-30 10:34 +0000
    Re: Using the Combinatorica Package in my own package "Nasser M. Abbasi" <nma@12000.org> - 2011-05-31 11:47 +0000

#2792 — Using the Combinatorica Package in my own package

FromKarl Schulz <karlschulz@pwned.de>
Date2011-05-30 10:34 +0000
SubjectUsing the Combinatorica Package in my own package
Message-ID<irvrs1$8ij$1@smc.vnet.net>
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

[toc] | [next] | [standalone]


#2822

From"Nasser M. Abbasi" <nma@12000.org>
Date2011-05-31 11:47 +0000
Message-ID<is2kh5$qpc$1@smc.vnet.net>
In reply to#2792
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web