Items tagged with overload overload Tagged Items Feed

The "." notation for the dot product of Vectors is very convenient and intuitive.  For example:

> <1,2,3> . <1,1,1>;

6

One sometimes annoying feature of it, however, is that by default Maple is using a dot product (suitable for Vectors with complex scalars) that is conjugate-linear in the first argument.  But let's say you will only be working with real scalars.  There's no problem if your Vectors have numeric entries, but...

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...

Hi, all. I'm not too confident in the results of Tolerances. I am very confident in the results of ScientificErrorAnalysis. Sadly, the Tolerances package has an awesome +- operator, while ScientificErrorAnalysis has the bulky Quantity() function. I'd like to define +- to be Quantity, something akin to this:

`&+-` := (a,b)->Quantity(a,b);

Sadly, 

1+`&+-`(2);

Help for operator overloading

February 02 2011 by kharal9 184 Maple

Hi, i want to overload the operators of union, intersection etc. But i do not know how to start this. kindly provide basic help. thanks.

Hi everyone, I just created my account in mapleprimes but I regularly find solutions to my problems searching through the posts, however, this time I was not so lucky.

I have the following problem in Maple: I have defined two procedures, A(v::array) and At(v::array) which perform simple algebraic tasks on 2x1 arrays. Then, I redefined the operation `+` when acting on two such arrays using overload. This new definition for addition does not correspond to normal matrix...

Over on the usenet newsgroup comp.math.soft-sys.maple, someone asked about using Maple's overload facility to redefine the operators such as `*`, `+`, etc.

The difficulty for the submitter is that while overload (and option overload for procedures) can provide enhanced operators for new routines, it doesn't affect routines saved in the Maple Library which already have their bindings. Overloading does not subsequently change the bindings of the operators when used in (most all) Library routines.

One way to try and get around this is to actually redefine the global operators. And since overload is on topic, one can still use it in the replacements that one writes.

In order to redefine global operators one must first unprotect them. They are protected for a very good reason. If the replacements are not adequate then Maple can fail in a multitude of ways. It's a case of caveat emptor.

Page 1 of 1