]> gitweb.factorcode.org Git - factor.git/blob - basis/float-vectors/float-vectors-docs.factor
714c8512c19836ebe4c580200eda905ef540f2ac
[factor.git] / basis / float-vectors / float-vectors-docs.factor
1 USING: arrays float-arrays help.markup help.syntax kernel\r
2 combinators ;\r
3 IN: float-vectors\r
4 \r
5 ARTICLE: "float-vectors" "Float vectors"\r
6 "A float vector is a resizable mutable sequence of unsigned floats. Float vector words are found in the " { $vocab-link "float-vectors" } " vocabulary."\r
7 $nl\r
8 "Float vectors form a class:"\r
9 { $subsection float-vector }\r
10 { $subsection float-vector? }\r
11 "Creating float vectors:"\r
12 { $subsection >float-vector }\r
13 { $subsection <float-vector> }\r
14 "Literal syntax:"\r
15 { $subsection POSTPONE: FV{ }\r
16 "If you don't care about initial capacity, a more elegant way to create a new float vector is to write:"\r
17 { $code "FV{ } clone" } ;\r
18 \r
19 ABOUT: "float-vectors"\r
20 \r
21 HELP: float-vector\r
22 { $description "The class of resizable float vectors. See " { $link "float-vectors" } " for information." } ;\r
23 \r
24 HELP: <float-vector>\r
25 { $values { "n" "a positive integer specifying initial capacity" } { "float-vector" float-vector } }\r
26 { $description "Creates a new float vector that can hold " { $snippet "n" } " floats before resizing." } ;\r
27 \r
28 HELP: >float-vector\r
29 { $values { "seq" "a sequence" } { "float-vector" float-vector } }\r
30 { $description "Outputs a freshly-allocated float vector with the same elements as a given sequence." }\r
31 { $errors "Throws an error if the sequence contains elements other than real numbers." } ;\r
32 \r
33 HELP: FV{\r
34 { $syntax "FV{ elements... }" }\r
35 { $values { "elements" "a list of real numbers" } }\r
36 { $description "Marks the beginning of a literal float vector. Literal float vectors are terminated by " { $link POSTPONE: } } "." } \r
37 { $examples { $code "FV{ 1.0 2.0 3.0 }" } } ;\r