Array.permute<'T> 함수(F#)
모든 요소가 지정된 순열에 따라 배치된 배열을 반환합니다.
네임스페이스/모듈 경로: Microsoft.FSharp.Collections.Array
어셈블리: FSharp.Core(FSharp.Core.dll)
// Signature:
Array.permute : (int -> int) -> 'T [] -> 'T []
// Usage:
Array.permute indexMap array
매개 변수
반환 값
배치된 배열입니다.
설명
컴파일된 어셈블리에서 이 함수의 이름은 Permute입니다.F# 이외의 언어에서 기능에 액세스하거나 리플렉션을 통해 기능에 액세스하는 경우 이 이름을 사용합니다.
예제
다음 코드에서는 Array.permute의 사용 예를 보여 줍니다.
let printPermutation n array1 =
let length = Array.length array1
if (n > 0 && n < length) then
Array.permute (fun index -> (index + n) % length) array1
else
array1
|> printfn "%A"
let array1 = [| 1 .. 5 |]
// There are 5 valid permutations of array1, with n from 0 to 4.
for n in 0 .. 4 do
printPermutation n array1
Output
플랫폼
Windows Windows 서버 2012, Windows Server 2008 R2, Windows 7, 8
버전 정보
F# 코어 라이브러리 버전
지원: 2.0, 4.0, 노트북