Items tagged with module module Tagged Items Feed

Hello,

I have .mla. package and I would like to create the source code associated to this package.

In the past, you have also help me to obtain the source code of procedure of the module.

Here the post where Carl Love has helped me :

http://www.mapleprimes.com/questions/203676-Open-A-Maple-Package

How can I do to create the complete source code of package directly ?

Is there a direct way enabling to not have to read one procedure by one procedure but to obtain the code source for all the package ?

Thank you for your help

 

 

Hello,

In the creation of package wrapping some procedures, may you tell me the differences between using a table or a module so as to wrap the procedures ?

In my case, it seems to me that table is more convenient since I can create with table packages while keeping my program with a structure of section, subsection, ...

But, I'm a beginner in the use of packages. Consequently, I'm very interested in your opinions on this question.

Thanks a lot for your help

Hello, guys

         I am a totally new comer in this erea. I get a new module file and want to implement it into maple,here is the link:

         http://cpc.cs.qub.ac.uk/summaries/ADWE

         After I downloaded the package, I didn't know the next step and I can't find a perfect solution to this case, maybe it is too easy.

         Can some cool guys can help me, THX.

The issue Type check of parameters was resolved using the depends modifier. As far as I can tell, this modifier is not allowed for expected or keyword parameters, though. Thus the issue seems to reemerge for these types of parameters. Consider the following test example:

createModule := proc(V::Vector)
   local dim := LinearAlgebra:-Dimension(V);
   module()
      export f,g,h;
      f := proc( x::depends('Vector'(dim))              ) x end proc;
      g := proc( x::expects('Vector'(dim)) := something ) x end proc;
      h := proc({x::        'Vector'(dim)  := something}) x end proc;
   end module
end proc:
createModule(Vector(4)):-f(    Vector(4));
createModule(Vector(4)):-g(    Vector(4));
createModule(Vector(4)):-h(x = Vector(4));

The function f is just a restatement of the already resolved issue, compare the above link, while the functions g and h are for the expected and keyword parameter cases, respectively. The problem remains the same: the variable dim is not evaluated for g and h. What to do? Does there exist a solution equally satisfactory as the one for f?

Consider the following two test procedures for creation of the same module:

createModule1 := proc(dim::posint)
    module()
        export det;
        det := (x::Matrix(1..dim,1..dim)) -> Determinant(x);
    end module
end proc:

and

createModule2 := proc(A::Matrix(square))
    local dim;
    dim := RowDimension(A);
    module()
        export det;
        det := (x::Matrix(1..dim,1..dim)) -> Determinant(x);
    end module
end proc:

as well as the following code lines calling these:

createModule1(       2 ):-det(IdentityMatrix(2));
createModule2(Matrix(2)):-det(IdentityMatrix(2));

The first line executes unproblematically, while for the second line an error results concerning the dimensionality check 1..dim,1..dim of the matrix. Why is dim available/initialized in the first version, while not in the second?

Hello,

I would like to know : how I can get all the contents of the module GetMultibody of MapleSim?

Is there in classic maple a function enabling me to ask the content of a module ?

Thank a lot for your help.

 

Hi,

i have been looking to see if i could get the source code for some of the calculus functions in maple. So far, i have tried this

kernelopts(opaquemodules = false)

interface(verboseproc = 3)

print(DiffTutor)

which shows the result

module() ... end module

does anybody have any idea how i would:

1) get the full list of sub-procedures in the module

2) get the source code of any of the sub-procedures in the module?

Thanks in advance!!

Here is one I have been struggling with lately:

I have a relatively large module with many procedures inside (plus some other data structures). In one of the procedures, it turns out that it would be convenient to have a subprocedure defined inside to both shorten the code by avoiding duplication as well as make it more error proof (once the subprocedure is debugged it'll be correct everywhere it is used). Here is the skeleton

Lattice:=module() option package;
export Track;   ...
   Track:=proc(arguments) uses LinearAlgebra;
   local trackElement;
      ...

      for ... do
         result:=trackElement(parms); # This does not work
         ...
      end do

      trackElement:=proc(arguments) uses LinearAlgebra;
         ...
      end proc; # trackElement

   end proc; # Track;

end module; # Lattice

The problem I have is that procedure trackElement is not recognized as i found out running the code in the debugger. I can make it work by taking trackElement out of Track and make it local to the Lattice module. While functionally this works (and it is how I have it now programmed), I do  not like it as every proc in the Lattice module can see trackElement. That should not be so, I want it local to procedure Track, which is where it belongs.

I really thought I could define procedures within procedures. Am I wrong? Or is there something else ging on?

TIA,

Mac Dude

PS: The whole module is more than 100 kB of Maple code sitting in a library. I refrain from uploading it here as it would be non-trivial to get going even for a simple test case.

There are no examples for ModuleDeconstruct either on its help page or in the Programming Guide. Of course, I can figure out its basic and primarily intended purpose: to render the module/object in a one-dimensional plaintext printed form, which would be useful for debugging. But I am most interested in this use described in the second sentence of this, the second paragraph of Description at ?ModuleDeconstruct [italics added]:

When the value returned by ModuleDeconstruct is printed, the output could be capable of being parsed to the original module. When used with an object, ModuleDeconstruct can return an unevaluated call to a constructor to achieve this.

That seems very powerful. Is there any example of it being used in Maple library code? in user code? Can anyone here come up with a practical use for this? A Google search turns up nothing.

I ran into a problem mentioned here before: With lots of code in one execution group, the standard GUI editor becomes very slow at least in older versions of Maple (I have reason to believe that this is mostly fixed in Maple 17 and, presumably, newer). With one of my packages this has become enough of a problem to force me to deal with it (and Modules and Packages have to be all in one execution group). I have some machines that cannot go beyond Maple 15 so I keep my stuff compatible with it (so far not a big sacrifice).

The fix is rather easy: In the GUI, export the code as "Maple Input" which creates a file with extension .mpl. Then, in the GUI have a small file that uses "read" to read-in and execute the code (of the module). In my case, I have the necessary LibTools statement to save as a .mla right after the package code ends so, bingo, I have just updated the package. I edit the .mpl file in Emacs.

So I installed Joe Riel's Emacs mode maplev-mode.el. This works rather well. However, it took not long for it to show its age: it does not recognize the multi-line comments (*...*). This is kind-of bad as this forces me to not use quotes in the comments since they mess-up the keyword highlighting esp. when using single quotes as in "I'll" and so on. Likewise, maplev-indent-buffer messes up the whole buffer as it interprets the multiline comments as code.

So my question is: is someone still working on this and using it?? I guess I can work around some of these things, but it would be nice if this worked.

Incidentally, my version of maplev-mode.el seems to be dated June 2005.

I know Joe is here on occasion, maybe he can chime in. It is not absolutely fatal; I could forgo using maplev, but if I am forced to go this route of readin in the package; using maplev-mode at least gives me something in return. Unfortunately my elisp skills are not quite up to fixing this myself; at least not in a reasonable time.

If it is relevant: I use Emacs 22.1 on Mac OS X. Yes, I could upgrade to at least Emace 23.4, if that were the issue.

Thanks in advance,

Mac Dude

Hi,

I want to write a proc to calculate exponential averages. Each call will add one data point to the averge. To do that, I need to store the previous average. I can do that by handing the previous average back to the proc at the next call, but I'd rather store it in the proc. Is there a way to guarantee that a variable---once set---remains alive keeping the last value upon entering the proc again? Note that I need the variable to be local to each instance of the proc since I will have several of these running in parallel (I intend to create these procs using the module factory scheme outlined in the programming guide). So I cannot store the previous average in a global variable since that would not be unique to a given instance.

Any ideas out there?

TIA,

Mac Dude

 

Has anyone made use of the GeM module?  found here http://math.usask.ca/~shevyakov/gem/

 

 

Hello all of you,

I'm new here and I have a problem.

For homework I have to write a Maple package for the usage of dual quaternions. This is not a problem.

For example two functions of the package:

MyQuaternions := module()

  export Pretty, Ugly:
  local l1:
  option package:
 
  protect('i,j,k,epsilon'):
 
Pretty := proc(q::Vector)
  description "":
  return LinearAlgebra[Transpose](q)[1..4].Vector([1,i,j,k])+epsilon*(LinearAlgebra[Transpose](q)[5..8].Vector([1,i,j,k])):
end proc:

Ugly := proc(q)
  description "":
  local a;
  a := Vector(8);
  a[1]:=remove(has,remove(has,q,epsilon),{i,j,k});
  a[2]:=coeff(remove(has,q,epsilon),i,1);
  a[3]:=coeff(remove(has,q,epsilon),j,1);
  a[4]:=coeff(remove(has,q,epsilon),k,1);
  a[5]:=remove(has,coeff(q,epsilon),{i,j,k});
  a[6]:=coeff(coeff(q,epsilon),i,1);
  a[7]:=coeff(coeff(q,epsilon),j,1);
  a[8]:=coeff(coeff(q,epsilon),k,1);
  return a:
end proc:

end module:

savelib('MyQuaternions'):

 

Now I can load the module in a differnet maple worksheet "main.mw" by typing "with(MyQuaternions):"

The crucial thing now is the following: i,j,k,epsilon should be protected in "main.mw". I can do this by typing "protect('i,j,k,epsilon'):" Is there a way to tell maple to protect these variables automatically when the module is loaded? Or do I always have to type in the protect command by hand?

Thank you,

Josef

how to convert between (system of polynomials or module) and rational function which is a four dimensional space

1. is module in algebraic geometry or group cohomology to classify homology group?

2. is final result like this? for example,

a dictionary  or table store

homology group 1, key=invariant = 1 hole in topological space , value = module 1, module 2 module 3 etc

homology group 2, key=invariant = 2 holes in topological space , value =module 4, module 5, module 6 etc

homology group 3, key=invariant = 3 holes in topological space , value = module 7, module 8.. etc

 ... etc

 

3. i find betti number can count holes, however how to know the form for

all combination?

i mean if it is module, how to change the module to get the full combination

http://www.singular.uni-kl.de/Manual/html/sing_159.htm

i find betti number's input is just ideal, but it is not module

if ideal is enough, why need module?

how to permuate module? and what do it classify and result in module?

1 2 3 4 Page 1 of 4