From 0fd2450818eab4bacb1bf02f585e412fff43b833 Mon Sep 17 00:00:00 2001 From: Samuel GOUGEON Date: Thu, 22 Dec 2016 22:25:51 +0100 Subject: [PATCH] help flipdim: description fixed and page improved * The variable name "sb" and its description were unclear => "blockSize" * The description of the blockSize variable was partly wrong. * There were no illustrated results * There was no See also section * The pt_BR and ru_RU pages are outdated after the introduction of the "blockSize" option 3 years ago. Easier to retranslate from scrach => removed. Change-Id: Ife9c013ba779a4cfb9a495a09493171074a2201d --- scilab/CHANGES.md | 2 +- .../help/en_US/matrixmanipulation/flipdim.xml | 171 ++++++++++++++++---- .../help/fr_FR/matrixmanipulation/flipdim.xml | 146 ++++++++++++++--- .../help/ja_JP/matrixmanipulation/flipdim.xml | 166 +++++++++++++++---- .../help/pt_BR/matrixmanipulation/flipdim.xml | 82 ---------- .../help/ru_RU/matrixmanipulation/flipdim.xml | 79 --------- 6 files changed, 403 insertions(+), 243 deletions(-) delete mode 100644 scilab/modules/elementary_functions/help/pt_BR/matrixmanipulation/flipdim.xml delete mode 100644 scilab/modules/elementary_functions/help/ru_RU/matrixmanipulation/flipdim.xml diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index 06a2808..f2b8879 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -209,7 +209,7 @@ Help pages: * fixed / improved: `members`, `part`, `ode`, `ode_optional_output`, `ode_roots`, `plot2d`, `roots`, `printf`, `sprintf`, `iconvert`, `stdev`, `xlabel`, `and_op`, `or_op`, `tree2code`, `%helps`, - `scilab|scilex` + `scilab|scilex`, `flipdim` * rewritten: `consolebox`, `double`, `isoview`, `pixel_drawing_mode`, `householder`, `or`, `and`, `format`, `typeof`, `brackets`, `setlanguage`, `sleep`, `isinf`, `bitor`, `bitxor`, `bitand`, `macr2tree`, `geomean` * reorganized: diff --git a/scilab/modules/elementary_functions/help/en_US/matrixmanipulation/flipdim.xml b/scilab/modules/elementary_functions/help/en_US/matrixmanipulation/flipdim.xml index 7968f93..1d3075d 100644 --- a/scilab/modules/elementary_functions/help/en_US/matrixmanipulation/flipdim.xml +++ b/scilab/modules/elementary_functions/help/en_US/matrixmanipulation/flipdim.xml @@ -2,7 +2,7 @@ - + flipdim - reverses the order of (blocs of) rows, columns, pages.. of a matrix or hypermatrix + reverses the order of (blocks of) rows, columns, pages.. of a matrix or hypermatrix Syntax - y = flipdim(x, dim [,sb]) + + y = flipdim(x, dim) + y = flipdim(x, dim, blockSize) + Arguments @@ -29,19 +35,28 @@ x, y - scalars, vectors, matrices, or hypermatrices of any type, of same sizes + + vectors, matrices, or hypermatrices of any regular data type. + y gets the sizes of x. + dim - a positive integer, the dimension number along which the flipping should occur + + positive integer : index of the dimension / direction of x + along which the order of x components must be inverted. + - sb + blockSize - a positive integer, the size of the blocks to permute + + a positive integer, sub-multiple of size(x,dim): + number of rows, of columns, of pages etc in each block. Default value = 1 + @@ -49,39 +64,47 @@ Description - Given x, a scalar/vector/matrix/hypermatrix of any type and - two positive integers dim and sb, - this function flips the x components by blocks of size sb - along the dimension number dim of x - (x and y have the same size). + flipdim(x, 1) inverts the order of + rows in the matrix or hypermatrix + x. - The optional parameter sb (for Size Block) allows flipping - x by blocks of size sb*size(x,2) - (dim=1) or size(x,1)*sb (dim=2). + flipdim(x, 2) inverts the order of + columns of x. + + + flipdim(x, 3) inverts the order of + pages in the hypermatrix + x. Etc. + + + The optional parameter blockSize allows splitting + x in size(x,1)/blockSize blocks + of blockSize rows (dim=1), + or in size(x,2)/blockSize blocks of blockSize + columns (dim=2), etc (dim>2) + and to invert their order. + In each block, the order of components (rows, columns, pages etc) + is unchanged. Examples - Examples using sb: + Examples using blockSize : [9 10 11 6 7 8 3 4 5 0 1 2] flipdim(X, 2, 4) // => [8 9 10 11 4 5 6 7 0 1 2 3] flipdim(X, 2, 6) // => [6 7 8 9 10 11 0 1 2 3 4 5] -// Error if sb does not divide the targeted dimension of x. -y = flipdim(x, 2, 5); // size(X) = [1 12] and sb=5 does not divide 12. +// Error if blockSize does not divide the targeted dimension of x. +y = flipdim(x, 2, 5); // size(X) = [1 12] and blockSize=5 does not divide 12. ]]> + Example of results: + x + x = + -5 -2 0 9 + 0 -7 -6 9 + -1 -8 -7 8 + +--> flipdim(x, 1) + ans = + -1 -8 -7 8 + 0 -7 -6 9 + -5 -2 0 9 + +--> flipdim(x, 2) + ans = + 9 0 -2 -5 + 9 -6 -7 0 + 8 -7 -8 -1 +]]> + + x + x = +(:,:,1) + 9 4 -3 + -4 -8 -3 + +(:,:,2) + 5 8 9 + 4 4 9 + +--> flipdim(x, 3) + ans = +(:,:,1) + 5 8 9 + 4 4 9 + +(:,:,2) + 9 4 -3 + -4 -8 -3 +]]> + + x + x = + -2 3 -5 9 -4 -8 + 2 8 4 -9 6 -6 + -9 8 3 4 -3 4 + +--> flipdim(x, 2, 2) + ans = + -4 -8 -5 9 -2 3 + 6 -6 4 -9 2 8 + -3 4 3 4 -9 8 + +--> flipdim(x, 2, 3) + ans = + 9 -4 -8 -2 3 -5 + -9 6 -6 2 8 4 + 4 -3 4 -9 8 3 +]]> + + + See also + + + fftshift + + + ifftshift + + + colon + + History @@ -126,8 +225,16 @@ y = flipdim(x, 2, 5); // size(X) = [1 12] and sb=5 does not divide 12. 5.5.0 - Extension from decimals to any type: booleans, integers, strings, polynomials and rationals. - New input argument sb to flip x blockwise. + + + Extension to all regular data types: booleans, integers, + strings, polynomials, rationals, graphic handles, etc. + + + New input argument blockSize to flip + x blockwise. + + diff --git a/scilab/modules/elementary_functions/help/fr_FR/matrixmanipulation/flipdim.xml b/scilab/modules/elementary_functions/help/fr_FR/matrixmanipulation/flipdim.xml index e731b78..a02a533 100644 --- a/scilab/modules/elementary_functions/help/fr_FR/matrixmanipulation/flipdim.xml +++ b/scilab/modules/elementary_functions/help/fr_FR/matrixmanipulation/flipdim.xml @@ -2,7 +2,7 @@ - + flipdim @@ -23,7 +26,10 @@ Séquence d'appel - y = flipdim(x, dim [,sb]) + + y = flipdim(x, dim) + y = flipdim(x, dim, blockSize) + Paramètres @@ -31,21 +37,28 @@ x, y - scalaires, vecteurs, matrices, ou hypermatrices de n'importe quel type, de même taille + + scalaires, vecteurs, matrices, ou hypermatrices de n'importe quel type de données régulier. + y prend la taille de x. + dim - entier positif, la dimension de x selon laquelle les éléments seront retournés + entier positif : n° de la dimension / direction de x + selon laquelle l'ordre des éléments de x doit être inversé. - sb + blockSize - entier positif, la taille des blocs à permuter + + entier positif, sous-multiple de size(x,dim) : + taille des blocs dont l'ordre doit être inversé. Vaut 1 par défaut. + @@ -53,15 +66,26 @@ Description - A partir de x, un scalaire/vecteur/matrice/hypermatrice de n'importe quel type et - deux entiers positifs dim et sb, cette fonction retourne les éléments de - x par blocs de taille sb selon le nombre dimension dim de - x (x et y ont la même taille) + flipdim(x, 1) inverse l'ordre des + lignes de la matrice ou hypermatrice + x. + + + flipdim(x, 2) inverse l'ordre des + colonnes de x. + + + flipdim(x, 3) inverse l'ordre des + pages de l'hypermatrice + x. etc. - Le paramètre optionnel sb (pour Size Block) permet de retounerles éléments de x - par blocs de taille sb*size(x,2) (dim=1) - ou size(x,1)*sb (dim=2). + Le paramètre optionnel blockSize permet d'inverser l'ordre des + size(x,1)/blockSize blocs de blockSize + lignes de x (dim=1), ou des + size(x,2)/blockSize blocs de blockSize + colonnes (dim=2), etc (dim>2). + À l'intérieur de chaque bloc, l'ordre des éléments (lignes, colonnes, etc) n'est pas modifié. @@ -110,7 +134,7 @@ r = n./d flipdim(r, 2) ]]> - Exemples utilisant sb : + Exemples utilisant blockSize : [9 10 11 6 7 8 3 4 5 0 1 2] flipdim(X, 2, 4) // => [8 9 10 11 4 5 6 7 0 1 2 3] flipdim(X, 2, 6) // => [6 7 8 9 10 11 0 1 2 3 4 5] -// Erreur si sb ne divise pas la dimension ciblée de x. -y = flipdim(x, 2, 5); // size(X) = [1 12] et sb=5 ne divise pas 12. +// Erreur si la valeur de blockSize n'est pas sous-multiple de la dimension ciblée de x. +y = flipdim(x, 2, 5); // size(X) = [1 12] et blockSize=5 ne divise pas 12. ]]> + Exemple de résultats : + x + x = + -5 -2 0 9 + 0 -7 -6 9 + -1 -8 -7 8 + +--> flipdim(x, 1) + ans = + -1 -8 -7 8 + 0 -7 -6 9 + -5 -2 0 9 + +--> flipdim(x, 2) + ans = + 9 0 -2 -5 + 9 -6 -7 0 + 8 -7 -8 -1 +]]> + + x + x = +(:,:,1) + 9 4 -3 + -4 -8 -3 + +(:,:,2) + 5 8 9 + 4 4 9 + +--> flipdim(x, 3) + ans = +(:,:,1) + 5 8 9 + 4 4 9 + +(:,:,2) + 9 4 -3 + -4 -8 -3 +]]> + + x + x = + -2 3 -5 9 -4 -8 + 2 8 4 -9 6 -6 + -9 8 3 4 -3 4 + +--> flipdim(x, 2, 2) + ans = + -4 -8 -5 9 -2 3 + 6 -6 4 -9 2 8 + -3 4 3 4 -9 8 + +--> flipdim(x, 2, 3) + ans = + 9 -4 -8 -2 3 -5 + -9 6 -6 2 8 4 + 4 -3 4 -9 8 3 +]]> + + + Voir aussi + + + fftshift + + + ifftshift + + + colon + + History @@ -129,8 +229,16 @@ y = flipdim(x, 2, 5); // size(X) = [1 12] et sb=5 ne divise pas 12. 5.5.0 - Extension de décimaux à tout type : booléens, entiers, chaines de caractères, polynômes et fractions rationnelles. - Nouveau paramètre optionnel sb pour retourner x par blocs. + + + Extension aux matrices et hypermatrices de booléens, entiers encodés, textes, + polynômes, fractions rationnelles, identifiants graphiques, etc. + + + Nouveau paramètre optionnel blockSize pour réordonner + x par blocs. + + diff --git a/scilab/modules/elementary_functions/help/ja_JP/matrixmanipulation/flipdim.xml b/scilab/modules/elementary_functions/help/ja_JP/matrixmanipulation/flipdim.xml index fc032da..55f1e59 100644 --- a/scilab/modules/elementary_functions/help/ja_JP/matrixmanipulation/flipdim.xml +++ b/scilab/modules/elementary_functions/help/ja_JP/matrixmanipulation/flipdim.xml @@ -2,6 +2,7 @@ - + flipdim 指定した次元に沿って x ブロック要素を反転 呼び出し手順 - y = flipdim(x, dim [,sb]) + + y = flipdim(x, dim) + y = flipdim(x, dim, blockSize) + 引数 @@ -28,19 +35,28 @@ x, y - 任意の型, 同じ大きさのスカラー, ベクトル, 行列またはハイパー行列 + + ベクトル、行列、または任意の通常のデータ型のハイパーマトリックスを含む。 + y は x のサイズを取得します。 + dim - 正の整数, 反転させる次元の番号 + + positive integer : index of the dimension / direction of x + along which the order of x components must be inverted. + - sb + blockSize - 正の整数, 交換するブロックの大きさ + + a positive integer, sub-multiple of size(x,dim): + number of rows, of columns, of pages etc in each block. Default value = 1 + @@ -48,51 +64,65 @@ 説明 - 任意の型のスカラー/ベクトル/配列/ハイパー行列 xと - 2つの正の整数dimおよびsbを指定すると, - この関数は大きさsbのブロック要素により - xの次元番号 dim - に沿って x の要素を反転します. - (x および y は同じ大きさとなります) + flipdim(x, 1) inverts the order of + rows in the matrix or hypermatrix + x. - オプションパラメータsb (Size Block) により, - ブロックの大きさ sb*size(x,2) - (dim=1) または size(x,1)*sb (dim=2) - での反転が可能となります. + flipdim(x, 2) inverts the order of + columns of x. + + + flipdim(x, 3) inverts the order of + pages in the hypermatrix + x. Etc. + + + The optional parameter blockSize allows splitting + x in size(x,1)/blockSize blocks + of blockSize rows (dim=1), + or in size(x,2)/blockSize blocks of blockSize + columns (dim=2), etc (dim>2) + and to invert their order. + In each block, the order of components (rows, columns, pages etc) + is unchanged. 例 0) y = flipdim(x, 2) + // テキスト: x = matrix(strsplit("a":"x", 1:23), 4, 6); x = x+x flipdim(x, 2) + // 多項式: x = inv_coeff(grand(3, 9, "uin", 0, 3), 2) flipdim(x, 1) + // 有理数: n = inv_coeff(grand(3, 9, "uin", 0, 3), 2); d = inv_coeff(grand(3, 9, "uin", 0, 3), 2); @@ -100,7 +130,7 @@ r = n./d flipdim(r, 2) ]]> - sbの使用例: + blockSizeの使用例 : [10 11 8 9 6 7 4 5 2 3 0 1] // ブロックサ flipdim(X, 2, 3) // => [9 10 11 6 7 8 3 4 5 0 1 2] flipdim(X, 2, 4) // => [8 9 10 11 4 5 6 7 0 1 2 3] flipdim(X, 2, 6) // => [6 7 8 9 10 11 0 1 2 3 4 5] -// sbがxの指定した次元を分割しない場合はエラー. -y = flipdim(x, 2, 5); // size(X) = [1 12] および sb=5 は 12を割り切れない. +// blockSizeがxの指定した次元を分割しない場合はエラー. +y = flipdim(x, 2, 5); // size(X) = [1 12] および blockSize=5 は 12を割り切れない. ]]> + Example of results: + x + x = + -5 -2 0 9 + 0 -7 -6 9 + -1 -8 -7 8 + +--> flipdim(x, 1) + ans = + -1 -8 -7 8 + 0 -7 -6 9 + -5 -2 0 9 + +--> flipdim(x, 2) + ans = + 9 0 -2 -5 + 9 -6 -7 0 + 8 -7 -8 -1 +]]> + + x + x = +(:,:,1) + 9 4 -3 + -4 -8 -3 + +(:,:,2) + 5 8 9 + 4 4 9 + +--> flipdim(x, 3) + ans = +(:,:,1) + 5 8 9 + 4 4 9 + +(:,:,2) + 9 4 -3 + -4 -8 -3 +]]> + + x + x = + -2 3 -5 9 -4 -8 + 2 8 4 -9 6 -6 + -9 8 3 4 -3 4 + +--> flipdim(x, 2, 2) + ans = + -4 -8 -5 9 -2 3 + 6 -6 4 -9 2 8 + -3 4 3 4 -9 8 + +--> flipdim(x, 2, 3) + ans = + 9 -4 -8 -2 3 -5 + -9 6 -6 2 8 4 + 4 -3 4 -9 8 3 +]]> + + + 参照 + + + fftshift + + + ifftshift + + + colon + + 履歴 @@ -120,7 +226,7 @@ y = flipdim(x, 2, 5); // size(X) = [1 12] および sb=5 は 12を割り切れ 10進数から任意の型に拡張: 論理値, 整数, 文字列, 多項式および有理数. xブロック毎に反転するために, - 新しい入力引数 sbが追加されました. + 新しい入力引数 blockSizeが追加されました. diff --git a/scilab/modules/elementary_functions/help/pt_BR/matrixmanipulation/flipdim.xml b/scilab/modules/elementary_functions/help/pt_BR/matrixmanipulation/flipdim.xml deleted file mode 100644 index e799940..0000000 --- a/scilab/modules/elementary_functions/help/pt_BR/matrixmanipulation/flipdim.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - flipdim - gira os componentes de x ao longo de uma dada - dimensão - - - - Seqüência de Chamamento - y=flipdim(x,dim) - - - Parâmetros - - - x - - um escalar, vetor ou array de reais - - - - dim - - um inteiro positivo - - - - y - - um escalar, vetor ou array de reais - - - - - - Descrição - - Dado x, um escalar/vetor/array de reais e - dim um inteiro positivo, esta função gira os - componentes de x ao longo da dimensão de número dim de - x (x e y têm o - mesmo tamanho) - - - - Exemplos - - - - Ver Também - F.Belahcene - - diff --git a/scilab/modules/elementary_functions/help/ru_RU/matrixmanipulation/flipdim.xml b/scilab/modules/elementary_functions/help/ru_RU/matrixmanipulation/flipdim.xml deleted file mode 100644 index 3e32d8e..0000000 --- a/scilab/modules/elementary_functions/help/ru_RU/matrixmanipulation/flipdim.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - flipdim - зеркальное отражение компонентов x по заданному измерению - - - Синтаксис - y=flipdim(x,dim) - - - Аргументы - - - x - - скаляр, вектор или массив чисел - - - - dim - - положительное целое число - - - - y - - скаляр, вектор или массив чисел - - - - - - Описание - - Для указанных x, скаляра/вектора/массива чисел и - dim, положительного целого числа, эта функция зеркально - отражает компоненты x по номеру dim - размерности x (x и y - одного размера) - - - - Примеры - - - -- 1.7.9.5