Items tagged with module module Tagged Items Feed

I have a module to overload the * operator for the function f such that:

a*f(b,c,d) = f(a*b,a*c,a*d)

FPackage :=  module()option package;    export `*`;    `*` :=    overload    (      [        proc(a::algebraic, b::specfunc(anything, f))          option overload;          map2(:-`*`, a, b...

Hello,

I would like to write some functions and algebra that work with dual numbers.

http://en.wikipedia.org/wiki/Dual_number 

http://en.wikipedia.org/wiki/Dual_quaternion 

I have not found a library that supports this.

The basis of dual numbers it is epsilon^2=0, similar to i,j,k in complex algebra where i^2=-1,i*j=-1 etc.

I know Maple has/had opensource ideas behind it, that's why

interface(verboseproc=3)

print(sum)

allows seing source code for function sum, but what if I want to see the source code for local procedures in Statistics module,

for example

print(Statistics[Distribution])

>proc() local T; try if type(args[1],':-ProbabilityDistribution') then if nargs=1 then return eval(args[1...

Hello all,

I've noticed that something has changed to the type of sqrt in Maple 15, which breaks backward compatibility...

In Maple 14, we have

> type(sqrt,procedure);          true
> type(sqrt,`module`); false
> eval(sqrt);          proc(x::algebraic, f::identical(symbolic))  ...  end proc

while in Maple 15, we have

> type(sqrt,procedure);          false
> type(sqrt,`module`); true

How could we get module which contain this export, for example

I have

m1 := module export a; end module;

 temp := m:-a;

evalb(temp = a);
 # false
evalb(temp = m:-a);
 # true 

 but how could I get back the module like this

temp2 := getModule(temp); 

temp2;

 # m

evalb(temp2 = m) ;

# true 

Debugging a module

May 02 2011 by Budgie 10 Maple 14

Hi

I'm trying to debug my module, but cannot find the problem! The problem areas are marked with red. Can you help?

Modul.mw

 

User friendly package

April 27 2011 by Budgie 10 Maple

Hello

I'm working on a project, where I need to create some user friendly proc/modules. I need it to ask for the variables e.i.

'Enter equation'

'Define range'

etc. but I have no idea how to do so. Can you describe a method of doing so?

 

When a procedure is called that is nested inside of a module, it returns its own name rather than the value it calculates.  E.g. here is a very simple package:

somePackage := module ()

  export someproc; 

  someproc := proc (yr)

    return (2010);

  end proc

end module;

 

That compiles fine.  But when this is executed:

somePackage[someproc];

The...

Hi there,

 

i've wirtten a library for maple12, say "MyLib", which is given by the files "MyLib.ind" and "MyLib.lib".

I've done this via

> restart;  
>  march('create', "<path>/MyLib.lib", 1);
>
> read "functions.txt";
>      
> savelibname:="<path>";
> savelib( `MyLib` );

where "functions.txt" is given as

MyLib:= module()
 

hi all,

swapping variables in the export line of a module changes its behavior.

First Example (works fine):

restart;
mp:= module() option package;
export mult, f2;
mult:=proc(v) return(3*v) end proc;
f2 :=proc(v) mult(v); end proc;
end module;

savelibname:="E:\\tmp";
savelib('mp');

restart;
libname := libname, "E:\\tmp";

with(mp);
mp:-f2(5);
mp:-mult(4);

# Output: [f2,mult], 15, 12

The numerical solution of PDE with IBC is given as a module: Download PDE1.mw . How to extract u(0.5,t) and u'_t(0.5,t) from this solution? Thanks in advance.

The Maple ?Compiler can compile a limited subset of Maple commands to native code. The result is substantially faster than running interpreted Maple code. This article shows how you can save a compiled procedure for reuse.

When a Maple procedure is compiled, a shared object library (dynamic-linked library for Windows) is created on the file system, as a temporary file.  When the Maple...

I'm using Maple 14 on 4-way and 6-way AMD 64 hardware running Windows Vista to numerically estimate inverses of a cumulative distribution function at hundreds of points, and am using the Task model to assign each point's inverse computation to a separate task. The cdf is a weighted sum of thousands of simpler functions, and so each task needs the weights. Initially I had set these up as a global variable, but after reading Darin Ohashi's MaplePrime's post ...

One way to enhance a package is to add to Maple's context-sensitive menus  some new menu entries which utilize that package's features.

In Maple's Standard GUI, context-sensitive menus (a.k.a. context-menus) appear when the mouse is right-clicked over (input or output) 2D Math expressions.

For a package implemented as a module, new and relevant context-menu entries can be created inside the module's ModuleLoad export. That will cause the new menu entries to be created (automatically...

What could be done with a module whose ModuleLoad routine redefined itself?

Could such a routine do some action, and then cover its tracks effectively by overwriting itself?

Would there be any way to use march() to examine the .mla archive member, in which that ModuleLoad routine is stored, without accessing the name of the module? Presumably any invocation of the actual module name would result in its being accessed from the library and hence trigger its ModuleLoad routine.

1 2 Page 1 of 2