AmirHosein Sadeghimanesh

110 Reputation

6 Badges

5 years, 252 days

Social Networks and Content at Maplesoft.com

Finished Ph.D. in Applied Algebraic Geometry in Biology and did postdoc in Mathematics of Chemical Reaction Networks, University of Copenhagen. Another postdoc in Nonlinear Dynamics in the Mathematical Models of Cell Biology at University of Szeged. Currently a research fellow at Coventry University. Main interests; Applied and Computational Algebraic Geometry, Mathematical Biology, Coding. I'm also a language lover! I'm also a language lover!

MaplePrimes Activity


These are questions asked by AmirHosein Sadeghimanesh

Let's say I have an mpl file and in this file there are several lines $include<~/~/~.mpl> and in some of those called mpl files, there are also some more include lines. And assume the paths of these files are given relative to a specific folder. Now I guess this specific folder has to be mentioned by modifying includepath. But looking at the help pages related to includepath (here and here) I get this sentence "it can be modified by calling kernelopts(includepath)", but I tired typing things like kernelopts(includepath):="C:\\Homes\\testFolder"; and still I see "" for kernelopts(includepath);. How can I tell Maple to look for the files relative to this location either by typing something at the Maple worksheet before typing read("C:\\Home\\testFolder\\main.mpl); or by adding a line at my main mpl file?

We can write a list, set, MutableSet and array type together with their entries types. For example list(polynom) or array(array(integer)). But what about a table? For example how can I emphasize a type table with indices of the type integer and entries a list of integers? I was guessing table(integer,list(integer)) which is not working, so my guess is not correct. I tried some other combinations which they didn't work too. I can't see anything in the programming guide and the help of Maple or a post here that is addressing this question.

Example:

test:=table([1=[1,2,3],2=[6,5,4]]):
type(test,table(integer,list(integer))): # which of course is not working.

 

Consider 1-dimensional arrays in Maple. To add one element at the end of an array, there is a pre-defined command ArrayTools:-Append (or using ArrayTools:-Insert if one wants to add an element at another location of the array) and to remove one entry from an array there is another pre-defined command ArrayTools:-Remove. Now let's say I want to add several elements and remove several elements. If I want to add all of the new elements at the end of the array, there is a predefined command ArrayTools:-Extend. If I want to remove several entries that are sequal, then I can give the second argument of ArrayTools:-Remove as a range n1..n2. But now let's say I want to remove several entries that are not sequal, for examples entries with indices in [5,8,14]. Is there any special efficient way to do it or just defining a loop to do the removals one by one? Removing by a loop is not very nice since the number of indices will change after each removal. Then another idea is to redefine the whole array using a select or a seq. But I'm guessing that none of these are the best way to do so. If I was dealing with MutableSet, I would use &minus, but I can't use MutableSets in every situation, because MutableSets change the order of elements and have more special properties like no repeated elements etc.

Is there any predefined command in Maple that you can run it on a Maple code file such as an mpl file, or just on a piece of code written in the worksheet file and it edits the code by the easy usual styling preferences such as what pylint does in Python? Adding spaces arround ":=" or adding indentation etc.

Consider an easy example of a table.

myTable:=table(["a"=1,"b"=-1,"c"=1]);

We can give an index to it and get its corresponding entry if exists.

myTable["b"];

We can also get the set of all indices, or the set of all entries. But what about receiving the index or set of indices with a specific entry. for example asking what indices have the entry `1`?

Of course I can define a search procedure myself, but I thought there might be an efficient way which is already implemented as a function/method on tables.

1 2 3 4 5 6 7 Last Page 1 of 10