Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Sublist_indices Calculator

Sublist_indices

Function: sublist_indices (<L>, <P>) Returns the indices of the elements x of the list <L> for which the predicate maybe(<P>(x)) returns true; this excludes unknown as well as false. <P> may be the name of a function or a lambda expression. <L> must be a literal list.

gensym();
f(l, x) ::= buildq([l : l, x : x, z : abad9987629%],sublist_indices(l, lambda([z], z =  x)));
f([x,y,z],a);
f([x,y,z],x);
macroexpand(f([x,y,z],a));
macroexpand(f([x,y,z],x));

Examples:

          (%i1) sublist_indices ([a, b, b, c, 1, 2, b, 3, b],
                                 lambda ([x], x=b));
          (%o1)                     [2, 3, 7, 9]
          (%i2) sublist_indices ([a, b, b, c, 1, 2, b, 3, b], symbolp);
          (%o2)                  [1, 2, 3, 4, 7, 9]
          (%i3) sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0],
                                 identity);
          (%o3)                       [1, 4, 5]
          (%i4) assume (x < -1);
          (%o4)                       [x < - 1]
          (%i5) map (maybe, [x > 0, x < 0, x < -2]);
          (%o5)                [false, true, unknown]
          (%i6) sublist_indices ([x > 0, x < 0, x < -2], identity);
          (%o6)                          [2]

(%o1)                                true
(%i2) 

Sublist_indices Example

Related Examples

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate

indices-lambda-part-sublist_indices

alist: [df_u[1,0],df_...

sublist_indices(alist...

Calculate

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate

indices-load

load(itensor);

ishow(a([i,j],[k,l],...

indices(%);

Calculate