Search found 8 matches

Go to advanced search

by qichen
14 Aug 2021, 09:03
Forum: Helpdesk
Topic: how to avoid ERROR: No random access
Replies: 5
Views: 6313

Declare and initialize Array or Vector in two steps

When use an Array, in C++, we first declare it, then initialize it, for example int a[3]; for(int i=0;i<=2;i++){ a[I]=i; } However, in polymake, we have to do it in one step. $a=new Array<Int>(0,1,2); However, when we deal with some complicated long arrays, it seems it cannot be initialize in the fi...
by qichen
14 Aug 2021, 06:27
Forum: Helpdesk
Topic: how to avoid ERROR: No random access
Replies: 5
Views: 6313

Some operations on Array and Vector to realize data type change

I think one scheme to solve my problem is turn a Set<Set<Int>> data to Array<Set<Int>> or Vector<Set<Int>> type. But I find it lacks enough operations on Array or Vector. For example, I may create $a=new Array<Set<Int>>(); , then add the elements of Set<Set<Int>> one by one, but it seems it lacks su...
by qichen
14 Aug 2021, 05:20
Forum: Helpdesk
Topic: how to avoid ERROR: No random access
Replies: 5
Views: 6313

Re: how to avoid ERROR: No random access

I think I know why my misunderstanding occurs. It is because of the following function and the documentation about it is incorrect. The type it returns is Set, but not Array or Vector, even if the first parameter is Array or Vector. all_subsets_of_k(Any c, Int k) Returns all subsets of size k of a g...
by qichen
08 Aug 2021, 11:27
Forum: Helpdesk
Topic: how to avoid ERROR: No random access
Replies: 5
Views: 6313

how to avoid ERROR: No random access

When I use the types of data such as Set, Vector and Array,

for example

Code: Select all

$a=new Set<Int>(0,1,2,3); print $a->[2];
sometimes it is okay, sometimes it will show
ERROR: No random access
Why does it occur and how to avoid it? Thanks.
by qichen
01 Aug 2021, 12:07
Forum: Helpdesk
Topic: Label the ground set of a matroid from 1 to n
Replies: 3
Views: 5350

Re: Label the ground set of a matroid from 1 to n

But if use the following, labels in the figure are still from 0 to 6. Is it related to VISUAL()?

Code: Select all

$l=$F->LATTICE_OF_FLATS; $l->VISUAL();
by qichen
31 Jul 2021, 04:43
Forum: Helpdesk
Topic: how to use polymake other than command line?
Replies: 2
Views: 5131

how to use polymake other than command line?

Can I write a bunch of codes and run them one time, but not just line by line in command line terminal. More over, can I define some functions by myself and save it to a file, then use it when I needed?
by qichen
31 Jul 2021, 04:30
Forum: Helpdesk
Topic: Label the ground set of a matroid from 1 to n
Replies: 3
Views: 5350

Label the ground set of a matroid from 1 to n

The default labels of the ground set of a matroid with cardinality n is from 0 to n-1. How to change it to from 1 to n ? Thanks.

Go to advanced search