From: Mario R. R. <rio...@us...> - 2012-07-28 07:31:05
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima, A Computer Algebra System". The branch, master has been updated via 393e7628004a6d022c32c4abafa7d9193cb39d1a (commit) from a01be06c696a2d34da8c1a3086d6ac31b2b68794 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 393e7628004a6d022c32c4abafa7d9193cb39d1a Author: Mario Rodriguez <rio...@us...> Date: Sat Jul 28 09:27:54 2012 +0200 Updating translations diff --git a/doc/info/es/Lists.es.texi b/doc/info/es/Lists.es.texi index df1287d..d57c732 100644 --- a/doc/info/es/Lists.es.texi +++ b/doc/info/es/Lists.es.texi @@ -1,4 +1,4 @@ -@c English version 2011-06-12 +@c English version 2011-12-03 @page @node Listas, Arrays, Constantes, Tipos de datos y estructuras @section Listas @@ -57,35 +57,64 @@ El elemento que denota el tipo de expresi@'on en Maxima es tambi@'en una lista, @code{[} y @code{]} marcan, respectivamente, el comienzo y el final de una lista. -@code{[} y @code{]} tambi@'en sse utilizan para indicar los sub@'{@dotless{i}}ndices -de una lista no de un array. +@code{[} y @code{]} tambi@'en se utilizan para indicar los sub@'{@dotless{i}}ndices +de una lista o de un array. Ejemplos: +@c ===beg=== +@c x: [a, b, c]; +@c x[3]; +@c array (y, fixnum, 3); +@c y[2]: %pi; +@c y[2]; +@c z['foo]: 'bar; +@c z['foo]; +@c g[k] := 1/(k^2+1); +@c g[10]; +@c ===end=== @example +@group (%i1) x: [a, b, c]; (%o1) [a, b, c] +@end group +@group (%i2) x[3]; (%o2) c +@end group +@group (%i3) array (y, fixnum, 3); (%o3) y +@end group +@group (%i4) y[2]: %pi; (%o4) %pi +@end group +@group (%i5) y[2]; (%o5) %pi +@end group +@group (%i6) z['foo]: 'bar; (%o6) bar +@end group +@group (%i7) z['foo]; (%o7) bar +@end group +@group (%i8) g[k] := 1/(k^2+1); 1 (%o8) g := ------ k 2 k + 1 +@end group +@group (%i9) g[10]; 1 (%o9) --- 101 +@end group @end example @end defvr @@ -126,31 +155,47 @@ Devuelve una copia de la @var{lista}. Crea una lista mediante la evaluaci@'on de @var{form} con @var{x_1} tomando cada uno de los valores de @var{list_1}, para cada uno de estos valores liga @var{x_2} con cada elemento de @var{list_2}, .... El n@'umero de elementos en el resultado ser@'a el producto del n@'umero de elementos -en cada lista. Cada variable @var{x_i} debe ser un s@'{@dotless{i}}mbolo y no ser@'a evaluado. La lista de argumentos ser@'a evaluada una vez al comienzo de la iteraci@'on. +en cada lista. Cada variable @var{x_i} debe ser un s@'{@dotless{i}}mbolo y no ser@'a evaluado. +La lista de argumentos ser@'a evaluada una vez al comienzo de la iteraci@'on. + +Ejemplos: -Por ejemplo: +@c ===beg=== +@c create_list (x^i, i, [1, 3, 7]); +@c ===end=== @example -(%i1) create_list(x^i,i,[1,3,7]); - 3 7 -(%o1) [x, x , x ] +@group +(%i1) create_list (x^i, i, [1, 3, 7]); + 3 7 +(%o1) [x, x , x ] +@end group @end example @noindent Con una doble iteraci@'on: +@c ===beg=== +@c create_list ([i, j], i, [a, b], j, [e, f, h]); +@c ===end=== @example -(%i1) create_list([i,j],i,[a,b],j,[e,f,h]); -(%o1) [[a, e], [a, f], [a, h], [b, e], [b, f], [b, h]] +@group +(%i1) create_list ([i, j], i, [a, b], j, [e, f, h]); +(%o1) [[a, e], [a, f], [a, h], [b, e], [b, f], [b, h]] +@end group @end example En lugar de @var{list_i} se pueden suministrar dos argumentos cada uno de los cuales deber@'{@dotless{i}}a poder evaluarse a un n@'umero, los cuales ser@'an los l@'{@dotless{i}}mites inferior y superior, ambos inclusive, para cada iteraci@'on. -Por ejemplo: +@c ===beg=== +@c create_list ([i, j], i, [1, 2, 3], j, 1, i); +@c ===end=== @example -(%i1) create_list([i,j],i,[1,2,3],j,1,i); -(%o1) [[1, 1], [2, 1], [2, 2], [3, 1], [3, 2], [3, 3]] +@group +(%i1) create_list ([i, j], i, [1, 2, 3], j, 1, i); +(%o1) [[1, 1], [2, 1], [2, 2], [3, 1], [3, 2], [3, 3]] +@end group @end example N@'otese que los l@'{@dotless{i}}mites o lista para la variable @code{j} pueden depender @@ -186,8 +231,10 @@ Eliminando elementos de una lista. @c delete (y, [w, x, y, z, z, y, x, w]); @c ===end=== @example +@group (%i1) delete (y, [w, x, y, z, z, y, x, w]); (%o1) [w, x, z, z, x, w] +@end group @end example Eliminando t@'erminos de una suma. @@ -196,8 +243,10 @@ Eliminando t@'erminos de una suma. @c delete (sin(x), x + sin(x) + y); @c ===end=== @example +@group (%i1) delete (sin(x), x + sin(x) + y); (%o1) y + x +@end group @end example Eliminando factores de un producto. @@ -206,8 +255,10 @@ Eliminando factores de un producto. @c delete (u - x, (u - w)*(u - x)*(u - y)*(u - z)); @c ===end=== @example +@group (%i1) delete (u - x, (u - w)*(u - x)*(u - y)*(u - z)); (%o1) (u - w) (u - y) (u - z) +@end group @end example Eliminando argumentos de una expresi@'on arbitraria. @@ -216,8 +267,10 @@ Eliminando argumentos de una expresi@'on arbitraria. @c delete (a, foo (a, b, c, d, a)); @c ===end=== @example +@group (%i1) delete (a, foo (a, b, c, d, a)); (%o1) foo(b, c, d) +@end group @end example Limitando el n@'umero de argumentos a eliminar. @@ -226,8 +279,10 @@ Limitando el n@'umero de argumentos a eliminar. @c delete (a, foo (a, b, a, c, d, a), 2); @c ===end=== @example +@group (%i1) delete (a, foo (a, b, a, c, d, a), 2); (%o1) foo(b, c, d, a) +@end group @end example Los argumentos se comparan respecto de "=". @@ -243,22 +298,33 @@ pero no "=" no ser@'an eliminados. @c delete ((x + y)*(x - y), [(x + y)*(x - y), x^2 - y^2]); @c ===end=== @example +@group (%i1) [is (equal (0, 0)), is (equal (0, 0.0)), is (equal (0, 0b0))]; - -`rat' replaced 0.0 by 0/1 = 0.0 +rat: replaced 0.0 by 0/1 = 0.0 `rat' replaced 0.0B0 by 0/1 = 0.0B0 (%o1) [true, true, true] +@end group +@group (%i2) [is (0 = 0), is (0 = 0.0), is (0 = 0b0)]; (%o2) [true, false, false] +@end group +@group (%i3) delete (0, [0, 0.0, 0b0]); (%o3) [0.0, 0.0b0] +@end group +@group (%i4) is (equal ((x + y)*(x - y), x^2 - y^2)); (%o4) true +@end group +@group (%i5) is ((x + y)*(x - y) = x^2 - y^2); (%o5) false +@end group +@group (%i6) delete ((x + y)*(x - y), [(x + y)*(x - y), x^2 - y^2]); 2 2 (%o6) [x - y ] +@end group @end example @end deffn @@ -312,12 +378,18 @@ Ejemplos: @c join (L1, [aa, bb, cc, dd, ee, ff]); @c ===end=== @example +@group (%i1) L1: [a, sin(b), c!, d - 1]; (%o1) [a, sin(b), c!, d - 1] +@end group +@group (%i2) join (L1, [1, 2, 3, 4]); (%o2) [a, 1, sin(b), 2, c!, 3, d - 1, 4] +@end group +@group (%i3) join (L1, [aa, bb, cc, dd, ee, ff]); (%o3) [a, aa, sin(b), bb, c!, cc, d - 1, dd] +@end group @end example @end deffn @@ -350,24 +422,72 @@ Devuelve el valor @code{true} si @var{expr} es una lista, y @code{false} en caso @end deffn -@deffn {Funci@'on} makelist (@var{expr}, @var{i}, @var{i_0}, @var{i_1}) + + +@deffn {Funci@'on} makelist () +@deffnx {Funci@'on} makelist (@var{expr}, @var{n}) +@deffnx {Funci@'on} makelist (@var{expr}, @var{i}, @var{i_max}) +@deffnx {Funci@'on} makelist (@var{expr}, @var{i}, @var{i_0}, @var{i_max}) +@deffnx {Funci@'on} makelist (@var{expr}, @var{i}, @var{i_0}, @var{i_max}, @var{step}) @deffnx {Funci@'on} makelist (@var{expr}, @var{x}, @var{list}) -Construye y devuelve una lista, siendo cada uno de sus elementos generados por @var{expr}. +El primer formato, @code{makelist ()}, crea una lista vac@'{@dotless{i}}a. El +segundo formato, @code{makelist (@var{expr})}, crea una lista con @var{expr} +como @'unico elemento. @code{makelist (@var{expr}, @var{n})} crea una lista +de @var{n} elementos generados a partir de @var{expr}. + +El formato m@'as general, @code{makelist (@var{expr}, @var{i}, @var{i_0}, +@var{i_max}, @var{step})}, devuelve la lista de elementos obtenidos al +aplicar @code{ev (@var{expr}, @var{i}=@var{j})} a los elementos @var{j} +de la secuencia @var{i_0}, @var{i_0} + @var{step}, @var{i_0} + +2*@var{step}, ..., siendo @var{|j|} menor o igual que @var{|i_max|}. -La llamada @code{makelist (@var{expr}, @var{i}, @var{i_0}, @var{i_1})} devuelve una lista cuyo @code{j}-@'esimo elemento es igual a @code{ev (@var{expr}, @var{i}=j)}, tomando @code{j} los valores enteros entre @var{i_0} y @var{i_1}. +El incremento @var{step} puede ser un n@'umero (positivo o negativo) o una +expresi@'on. En caso de omitirse, se utilizar@'a 1 como valor por defecto. +Si se omiten @var{i_0} y @var{step}, se le asignar@'a a ambos 1 como valor +por defecto. + +@code{makelist (@var{expr}, @var{x}, @var{list})} devuelve una lista, cuyo +@code{j}-@'esimo elemento es igual a +@code{ev (@var{expr}, @var{x}=@var{list}[j])} tomando @code{j} valores desde +1 hasta @code{length (@var{list})}. -La llamada @code{makelist (@var{expr}, @var{x}, @var{list})} devuelve una lista cuyo @code{j}-@'esimo elemento es igual a -@code{ev (@var{expr}, @var{x}=@var{list}[j])}, tomando @code{j} los valores enteros entre 1 through @code{length (@var{list})}. Ejemplos: +@c ===beg=== +@c makelist (concat (x,i), i, 6); +@c makelist (x=y, y, [a, b, c]); +@c makelist (x^2, x, 3, 2*%pi, 2); +@c makelist (random(6), 4); +@c flatten (makelist (makelist (i^2, 3), i, 4)); +@c flatten (makelist (makelist (i^2, i, 3), 4)); +@c ===end=== @example -(%i1) makelist(concat(x,i),i,1,6); +@group +(%i1) makelist (concat (x,i), i, 6); (%o1) [x1, x2, x3, x4, x5, x6] -(%i2) makelist(x=y,y,[a,b,c]); +@end group +@group +(%i2) makelist (x=y, y, [a, b, c]); (%o2) [x = a, x = b, x = c] - +@end group +@group +(%i3) makelist (x^2, x, 3, 2*%pi, 2); +(%o3) [9, 25] +@end group +@group +(%i4) makelist (random(6), 4); +(%o4) [2, 0, 2, 5] +@end group +@group +(%i5) flatten (makelist (makelist (i^2, 3), i, 4)); +(%o5) [1, 1, 1, 4, 4, 4, 9, 9, 9, 16, 16, 16] +@end group +@group +(%i6) flatten (makelist (makelist (i^2, i, 3), 4)); +(%o6) [1, 4, 9, 1, 4, 9, 1, 4, 9, 1, 4, 9] +@end group @end example @end deffn @@ -401,24 +521,40 @@ Ejemplos: @c member ("ab", ["aa", "ab", sin(1), a + b]); @c ===end=== @example +@group (%i1) member (8, [8, 8.0, 8b0]); (%o1) true +@end group +@group (%i2) member (8, [8.0, 8b0]); (%o2) false +@end group +@group (%i3) member (b, [a, b, c]); (%o3) true +@end group +@group (%i4) member (b, [[a, b], [b, c]]); (%o4) false +@end group +@group (%i5) member ([b, c], [[a, b], [b, c]]); (%o5) true +@end group +@group (%i6) F (1, 1/2, 1/4, 1/8); 1 1 1 (%o6) F(1, -, -, -) 2 4 8 +@end group +@group (%i7) member (1/8, %); (%o7) true +@end group +@group (%i8) member ("ab", ["aa", "ab", sin(1), a + b]); (%o8) true +@end group @end example @end deffn @@ -464,66 +600,62 @@ Ejec@'utese @code{load(basic)} antes de utilizar esta funci@'on. Ejemplos: @c ===beg=== -@c ll:[]; -@c push(x,ll); -@c push(x^2+y,ll); -@c a:push("string",ll); -@c pop(ll); -@c pop(ll); -@c pop(ll); +@c load ("basic")$ +@c ll: []; +@c push (x, ll); +@c push (x^2+y, ll); +@c a: push ("string", ll); +@c pop (ll); +@c pop (ll); +@c pop (ll); @c ll; @c a; @c ===end=== @example -(%i1) ll:[]; -(%o1) [] -(%i2) push(x,ll); -(%o2) [x] -(%i3) push(x^2+y,ll); +(%i1) load ("basic")$ +@group +(%i2) ll: []; +(%o2) [] +@end group +@group +(%i3) push (x, ll); +(%o3) [x] +@end group +@group +(%i4) push (x^2+y, ll); 2 -(%o3) [y + x , x] -(%i4) a:push("string",ll); +(%o4) [y + x , x] +@end group +@group +(%i5) a: push ("string", ll); 2 -(%o4) [string, y + x , x] -(%i5) pop(ll); -(%o5) string -(%i6) pop(ll); +(%o5) [string, y + x , x] +@end group +@group +(%i6) pop (ll); +(%o6) string +@end group +@group +(%i7) pop (ll); 2 -(%o6) y + x -(%i7) pop(ll); -(%o7) x -(%i8) ll; -(%o8) [] -(%i9) a; +(%o7) y + x +@end group +@group +(%i8) pop (ll); +(%o8) x +@end group +@group +(%i9) ll; +(%o9) [] +@end group +@group +(%i10) a; 2 -(%o9) [string, y + x , x] +(%o10) [string, y + x , x] +@end group @end example -@end deffn - -@deffn {Funci@'on} unique (@var{L}) - -Devuelve la lista @var{L} sin redundancias, es decir, sin -elementos repetidos - -Cuando ninguno de los elementos de @var{L} est@'a repetido, -@code{unique} devuelve una r@'eplica de @var{L}, no la -propia @var{L}. - -Si @var{L} no es una lista, @code{unique} devuelve @var{L}. - -Ejemplo: - -@c ===beg=== -@c unique ([1, %pi, a + b, 2, 1, %e, %pi, a + b, [1]]); -@c ===end=== -@example -(%i1) unique ([1, %pi, a + b, 2, 1, %e, %pi, a + b, [1]]); -(%o1) [1, 2, %e, %pi, [1], b + a] -@end example -@end deffn - @deffn {Funci@'on} rest (@var{expr}, @var{n}) @deffnx {Funci@'on} rest (@var{expr}) @@ -561,87 +693,195 @@ Devuelve el sexto elemento de la lista o expresi@'on @var{expr}. V@'ease @code{f @deffn {Funci@'on} sort (@var{L}, @var{P}) @deffnx {Funci@'on} sort (@var{L}) -Ordena la lista @var{L} de acuerdo con el predicado @code{P} de dos argumentos, -de tal manera que @code{@var{P} (@var{L}[k], @var{L}[k + 1])} es @code{true} (verdadero) -para cualesquiera dos elementos sucesivos. -El predicado se puede especificar como nombre de una funci@'on o de un operador -infijo binario, o como una expresi@'on @code{lambda}. -Si se especifica con el nombre de un operador, este nombre debe -encerrarse con "comillas dobles". - -La lista ordenada se devuelve como un objeto nuevo, de manera que -el argumento @var{L} no se ve alterado. -A fin de construir el valor de retorno, @code{sort} hace una copia previa -de los elementos de @var{L}. - -@c MIGHT CONSIDER A REF FOR TOTAL ORDER HERE -Si el predicado @var{P} no ordena totalmente los elementos de @var{L}, -entonces @code{sort} puede seguir ejecut@'andose hasta el final sin emitir -errores, pero el resultado no es predecible. -La funci@'on muestra un mensaje de error en caso de que el predicado -devuelva algo diferente de @code{true} o @code{false}. - -La llamada @code{sort (@var{L})} equivale a @code{sort (@var{L}, orderlessp)}; -esto es, el orden por defecto es el ascendente, tal como queda definido por -@code{orderlessp}. Todos los @'atomos y expresiones de Maxima son comparables -para @code{orderlessp}. - -El predicado @code{ordergreatp} ordena una lista en sentido descendente. El -predicado @code{ordermagnitudep} ordena seg@'un sus respectivas normas, n@'umeros, -s@'{@dotless{i}}mbolos constantes con valores num@'ericos y expresiones -con valores constantes. Cualesquiera otros elementos de la lista @var{L} se ordenan -con @code{orderlessp}. El predicado @code{"<"} permite tambi@'en la ordenaci@'on -por norma, pero no ordena completamente los elementos de la lista @var{L} que -no sean comparables respecto de @code{"<"}. + +@code{sort(@var{L}, @var{P})} ordena la lista @var{L} de acuerdo con el predicado @code{P} +de dos argumentos, el cual define un preorden total sobre los elementos de @var{L}. +Si @code{@var{P}(a, b)} vale @code{true}, entonces @code{a} aparece antes que @code{b} en +el resultado. Si ninguna de las expresiones @code{@var{P}(a, b)} y @code{@var{P}(b, a)} +valen @code{true}, entonces @code{a} y @code{b} son equivalentes y aparecen en el +resultado en el mismo orden que a la entrada; esto es, @code{sort} es un orden estable. + +Si tanto @code{@var{P}(a, b)} como @code{@var{P}(b, a)} valen ambos @code{true} para +algunos elementos de @var{L}, entonces @var{P} no es un predicado de orden correcto, +siento entonces el resultado indefinido. Si @code{@var{P}(a, b)} toma un valor diferente +a @code{true} o @code{false}, entonces @code{sort} devuelve un error. + +El predicado puede especificarse como el nombre de una funci@'on, de una operaci@'on binaria +infija o como una expresi@'on @code{lambda}. Si se especifica con el nombre de un operador, +dicho nombre debe encerrarse con comillas dobles. + +La lista ordenada se devuelve como un nuevo objeto, no modific@'andose el argumento @var{L}. + +@code{sort(@var{L})} equivale a @code{sort(@var{L}, orderlessp)}. + +La ordenaci@'on por defecto es ascendente, tal como queda determinada por @code{orderlessp}. +El predicado @code{ordergreatp} ordena las listas en orden descendente. + +Todos los @'atomos y expresiones de Maxima son comparables respecto de los predicados +@code{orderlessp} y @code{ordergreatp}. + +Los operadores @code{<} y @code{>} ordenan n@'umeros, constantes y expresiones constantes por +magnitud. N@'otese que @code{orderlessp} y @code{ordergreatp} no ordenan n@'umeros, +constantes y expresiones constantes por magnitud. + +@code{ordermagnitudep} ordena n@'umeros, constantes y expresiones constantes de igual modo +que lo hace @code{<}, y cualesquiera otros elementos lo hace igual que @code{orderlessp}. Ejemplos: +@code{sort} ordena una lista respecto de un predicado de dos argumentos que define un +preorden total en los elementos de la lista. + +@c ===beg=== +@c sort ([1, a, b, 2, 3, c], 'orderlessp); +@c sort ([1, a, b, 2, 3, c], 'ordergreatp); +@c ===end=== +@example +@group +(%i1) sort ([1, a, b, 2, 3, c], 'orderlessp); +(%o1) [1, 2, 3, a, b, c] +(%i2) sort ([1, a, b, 2, 3, c], 'ordergreatp); +(%o2) [c, b, a, 3, 2, 1] +@end group +@end example + +El predicado puede especificarse con el nombre de una funci@'on, de un +operador binario infijo o una expresi@'on @code{lambda}. Si se especifica +con el nombre de un operador, dicho nombre debe encerrarse con comillas dobles. + +@c ===beg=== +@c L : [[1, x], [3, y], [4, w], [2, z]]; +@c foo (a, b) := a[1] > b[1]; +@c sort (L, 'foo); +@c infix (">>"); +@c a >> b := a[1] > b[1]; +@c sort (L, ">>"); +@c sort (L, lambda ([a, b], a[1] > b[1])); +@c ===end=== +@example +@group +(%i1) L : [[1, x], [3, y], [4, w], [2, z]]; +(%o1) [[1, x], [3, y], [4, w], [2, z]] +(%i2) foo (a, b) := a[1] > b[1]; +(%o2) foo(a, b) := a > b + 1 1 +(%i3) sort (L, 'foo); +(%o3) [[4, w], [3, y], [2, z], [1, x]] +(%i4) infix (">>"); +(%o4) >> +(%i5) a >> b := a[1] > b[1]; +(%o5) a >> b := a > b + 1 1 +(%i6) sort (L, ">>"); +(%o6) [[4, w], [3, y], [2, z], [1, x]] +(%i7) sort (L, lambda ([a, b], a[1] > b[1])); +(%o7) [[4, w], [3, y], [2, z], [1, x]] +@end group +@end example + +@code{sort(@var{L})} equivale a @code{sort(@var{L}, orderlessp)}. + @c ===beg=== -@c sort ([11, -17, 29b0, 7.55, 3, -5/2, b + a, 9 * c, 19 - 3 * x]); -@c sort ([11, -17, 29b0, 7.55, 3, -5/2, b + a, 9 * c, 19 - 3 * x], -@c ordergreatp); -@c sort ([%pi, 3, 4, %e, %gamma]); -@c sort ([%pi, 3, 4, %e, %gamma], "<"); -@c my_list : [[aa, hh, uu], [ee, cc], [zz, xx, mm, cc], [%pi, %e]]; -@c sort (my_list); -@c sort (my_list, lambda ([a, b], -@c orderlessp (reverse (a), reverse (b)))); +@c L : [a, 2*b, -5, 7, 1 + %e, %pi]; +@c sort (L); +@c sort (L, 'orderlessp); @c ===end=== @example -(%i1) sort ([11, -17, 29b0, 7.55, 3, -5/2, b + a, 9 * c, 19 - 3 * x]); - 5 -(%o1) [- 17, - -, 3, 7.55, 11, 2.9b1, b + a, 9 c, 19 - 3 x] - 2 -(%i2) sort ([11, -17, 29b0, 7.55, 3, -5/2, b + a, 9 * c, 19 - 3 * x], - ordergreatp); - 5 -(%o2) [19 - 3 x, 9 c, b + a, 2.9b1, 11, 7.55, 3, - -, - 17] - 2 -(%i3) sort ([%pi, 3, 4, %e, %gamma]); -(%o3) [3, 4, %e, %gamma, %pi] -(%i4) sort ([%pi, 3, 4, %e, %gamma], "<"); -(%o4) [%gamma, %e, 3, %pi, 4] -(%i5) my_list : [[aa, hh, uu], [ee, cc], [zz, xx, mm, cc], [%pi, %e]]; -(%o5) [[aa, hh, uu], [ee, cc], [zz, xx, mm, cc], [%pi, %e]] -(%i6) sort (my_list); -(%o6) [[%pi, %e], [aa, hh, uu], [ee, cc], [zz, xx, mm, cc]] -(%i7) sort (my_list, lambda ([a, b], - orderlessp (reverse (a), reverse (b)))); -(%o7) [[%pi, %e], [ee, cc], [zz, xx, mm, cc], [aa, hh, uu]] +@group +(%i1) L : [a, 2*b, -5, 7, 1 + %e, %pi]; +(%o1) [a, 2 b, - 5, 7, %e + 1, %pi] +(%i2) sort (L); +(%o2) [- 5, 7, %e + 1, %pi, a, 2 b] +(%i3) sort (L, 'orderlessp); +(%o3) [- 5, 7, %e + 1, %pi, a, 2 b] +@end group @end example -Ordena seg@'un sus normas n@'umeros, constantes y expresiones, as@'{@dotless{i}} -como cualesquiera otros elementos en orden ascendente: +La ordenaci@'on por defecto es ascendente, tal como queda determinada por @code{orderlessp}. +El predicado @code{ordergreatp} ordena las listas en orden descendente. @c ===beg=== -@c sort([%i,1+%i,2*x,minf,inf,%e,sin(1),0,1,2,3,1.0,1.0b0],ordermagnitudep); +@c L : [a, 2*b, -5, 7, 1 + %e, %pi]; +@c sort (L); +@c sort (L, 'ordergreatp); @c ===end=== @example -(%i8) sort([%i,1+%i,2*x,minf,inf,%e,sin(1),0,1,2,3,1.0,1.0b0], - ordermagnitudep); -(%o8) [minf, 0, sin(1), 1, 1.0, 1.0b0, 2, %e, 3, inf, %i, %i + 1, 2 x] +@group +(%i1) L : [a, 2*b, -5, 7, 1 + %e, %pi]; +(%o1) [a, 2 b, - 5, 7, %e + 1, %pi] +(%i2) sort (L); +(%o2) [- 5, 7, %e + 1, %pi, a, 2 b] +(%i3) sort (L, 'ordergreatp); +(%o3) [2 b, a, %pi, %e + 1, 7, - 5] +@end group @end example +Todos los @'atomos y expresiones de Maxima son comparables respecto de los predicados +@code{orderlessp} y @code{ordergreatp}. + +@c ===beg=== +@c L : [11, -17, 29b0, 9*c, 7.55, foo(x, y), -5/2, b + a]; +@c sort (L, orderlessp); +@c sort (L, ordergreatp); +@c ===end=== +@example +@group +(%i1) L : [11, -17, 29b0, 9*c, 7.55, foo(x, y), -5/2, b + a]; + 5 +(%o1) [11, - 17, 2.9b1, 9 c, 7.55, foo(x, y), - -, b + a] + 2 +(%i2) sort (L, orderlessp); + 5 +(%o2) [- 17, - -, 7.55, 11, 2.9b1, b + a, 9 c, foo(x, y)] + 2 +(%i3) sort (L, ordergreatp); + 5 +(%o3) [foo(x, y), 9 c, b + a, 2.9b1, 11, 7.55, - -, - 17] + 2 +@end group +@end example + +Los operadores @code{<} y @code{>} ordenan n@'umeros, constantes y expresiones constantes por +magnitud. N@'otese que @code{orderlessp} y @code{ordergreatp} no ordenan n@'umeros, +constantes y expresiones constantes por magnitud. + +@c ===beg=== +@c L : [%pi, 3, 4, %e, %gamma]; +@c sort (L, ">"); +@c sort (L, ordergreatp); +@c ===end=== +@example +@group +(%i1) L : [%pi, 3, 4, %e, %gamma]; +(%o1) [%pi, 3, 4, %e, %gamma] +(%i2) sort (L, ">"); +(%o2) [4, %pi, 3, %e, %gamma] +(%i3) sort (L, ordergreatp); +(%o3) [%pi, %gamma, %e, 4, 3] +@end group +@end example + +@code{ordermagnitudep} ordena n@'umeros, constantes y expresiones constantes de igual modo +que lo hace @code{<}, y cualesquiera otros elementos lo hace igual que @code{orderlessp}. + +@c ===beg=== +@c L : [%i, 1+%i, 2*x, minf, inf, %e, sin(1), 0, 1, 2, 3, 1.0, 1.0b0]; +@c sort (L, ordermagnitudep); +@c sort (L, orderlessp); +@c ===end=== +@example +@group +(%i1) L : [%i, 1+%i, 2*x, minf, inf, %e, sin(1), 0, 1, 2, 3, 1.0, 1.0b0]; +(%o1) [%i, %i + 1, 2 x, minf, inf, %e, sin(1), 0, 1, 2, 3, 1.0, + 1.0b0] +(%i2) sort (L, ordermagnitudep); +(%o2) [minf, 0, sin(1), 1, 1.0, 1.0b0, 2, %e, 3, inf, %i, + %i + 1, 2 x] +(%i3) sort (L, orderlessp); +(%o3) [0, 1, 1.0, 2, 3, %e, %i, %i + 1, inf, minf, sin(1), + 1.0b0, 2 x] +@end group +@end example @end deffn @@ -657,10 +897,14 @@ Ejemplo: @c sublist (L, evenp); @c ===end=== @example +@group (%i1) L: [1, 2, 3, 4, 5, 6]; (%o1) [1, 2, 3, 4, 5, 6] +@end group +@group (%i2) sublist (L, evenp); (%o2) [2, 4, 6] +@end group @end example @end deffn @@ -677,39 +921,74 @@ devuelve @code{true}, lo que excluye a @code{unknown} y a @code{false}. @var{L} debe ser una lista literal. Ejemplos: + @c ===beg=== -@c sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], -@c lambda ([x], x='b)); -@c sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], -@c symbolp); -@c sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0], -@c identity); +@c sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], +@c lambda ([x], x='b)); +@c sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], symbolp); +@c sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0], +@c identity); @c assume (x < -1); @c map (maybe, [x > 0, x < 0, x < -2]); @c sublist_indices ([x > 0, x < 0, x < -2], identity); @c ===end=== - @example +@group (%i1) sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], - lambda ([x], x='b)); + lambda ([x], x='b)); (%o1) [2, 3, 7, 9] -(%i2) sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], - symbolp); +@end group +@group +(%i2) sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], symbolp); (%o2) [1, 2, 3, 4, 7, 9] +@end group +@group (%i3) sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0], - identity); + identity); (%o3) [1, 4, 5] +@end group +@group (%i4) assume (x < -1); (%o4) [x < - 1] +@end group +@group (%i5) map (maybe, [x > 0, x < 0, x < -2]); (%o5) [false, true, unknown] +@end group +@group (%i6) sublist_indices ([x > 0, x < 0, x < -2], identity); (%o6) [2] +@end group @end example @end deffn +@deffn {Funci@'on} unique (@var{L}) + +Devuelve la lista @var{L} sin redundancias, es decir, sin +elementos repetidos + +Cuando ninguno de los elementos de @var{L} est@'a repetido, +@code{unique} devuelve una r@'eplica de @var{L}, no la +propia @var{L}. + +Si @var{L} no es una lista, @code{unique} devuelve @var{L}. + +Ejemplo: + +@c ===beg=== +@c unique ([1, %pi, a + b, 2, 1, %e, %pi, a + b, [1]]); +@c ===end=== +@example +@group +(%i1) unique ([1, %pi, a + b, 2, 1, %e, %pi, a + b, [1]]); +(%o1) [1, 2, %e, %pi, [1], b + a] +@end group +@end example +@end deffn + + @deffn {Funci@'on} tenth (@var{expr}) diff --git a/doc/info/es/Matrices.es.texi b/doc/info/es/Matrices.es.texi index 5cf7f87..5da79f9 100644 --- a/doc/info/es/Matrices.es.texi +++ b/doc/info/es/Matrices.es.texi @@ -1,4 +1,4 @@ -@c English version 2011-07-03 +@c English version 2011-09-03 @menu * Introducci@'on a las matrices y el @'algebra lineal:: * Funciones y variables para las matrices y el @'algebra lineal:: @@ -1288,19 +1288,11 @@ Para disponer de esta funci@'on es necesario cargar el paquete haciendo @code{lo @end deffn @deffn {Funci@'on} newdet (@var{M}) -Calcula el determinante de la matriz @var{M} por el algoritmo del @'arbol menor de Johnson-Gentleman. El resultado devuelto por @code{newdet} tiene formato CRE. +Calcula el determinante de la matriz @var{M} por el algoritmo del @'arbol menor +de Johnson-Gentleman. El resultado devuelto por @code{newdet} tiene formato CRE. @end deffn -@c NEEDS CLARIFICATION AND EXAMPLES -@defvr {Declaraci@'on} nonscalar -Hace que los @'atomos se comporten como hace una lista o matriz con respecto del operador @code{.} del la multiplicaci@'on no conmutativa. -@end defvr - -@deffn {Funci@'on} nonscalarp (@var{expr}) -Devuelve @code{true} si @var{expr} no es escalar, es decir, si contiene @'atomos declarados como no escalares, listas o matrices. - -@end deffn @deffn {Funci@'on} permanent (@var{M}) Calcula la permanente de la matriz @var{M} por el algoritmo del @'arbol menor de ----------------------------------------------------------------------- Summary of changes: doc/info/es/Lists.es.texi | 579 +++++++++++++++++++++++++++++++----------- doc/info/es/Matrices.es.texi | 14 +- 2 files changed, 432 insertions(+), 161 deletions(-) hooks/post-receive -- Maxima, A Computer Algebra System |