2008-01-30 00:13:47 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								USING:  arrays  float-arrays  help.markup  help.syntax  kernel 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								float-vectors.private combinators ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								IN:  float-vectors 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "float-vectors"  "Float vectors" 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-23 03:46:35 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"A float vector is a resizable mutable sequence of unsigned floats. Float vector words are found in the "  { $vocab-link "float-vectors"  } " vocabulary." 
							 
						 
					
						
							
								
									
										
										
										
											2008-01-30 00:13:47 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								$nl
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Float vectors form a class:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection float-vector }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection float-vector? }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Creating float vectors:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection >float-vector }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection <float-vector> }
							 
						 
					
						
							
								
									
										
										
										
											2008-04-19 23:56:28 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Literal syntax:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection POSTPONE:  FV{  }
							 
						 
					
						
							
								
									
										
										
										
											2008-01-30 00:13:47 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"If you don't care about initial capacity, a more elegant way to create a new float vector is to write:" 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-04 20:42:35 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $code "FV{ } clone"  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-01-30 00:13:47 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ABOUT: "float-vectors" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  float-vector 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-23 03:46:35 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "The class of resizable float vectors. See "  { $link "float-vectors"  } " for information."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-01-30 00:13:47 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  <float-vector> 
							 
						 
					
						
							
								
									
										
										
										
											2008-01-30 02:10:58 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "n"  "a positive integer specifying initial capacity"  } { "float-vector"  float-vector } }
							 
						 
					
						
							
								
									
										
										
										
											2008-01-30 00:13:47 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Creates a new float vector that can hold "  { $snippet "n"  } " floats before resizing."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  >float-vector 
							 
						 
					
						
							
								
									
										
										
										
											2008-01-30 02:22:29 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "seq"  "a sequence"  } { "float-vector"  float-vector } }
							 
						 
					
						
							
								
									
										
										
										
											2008-01-30 00:13:47 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs a freshly-allocated float vector with the same elements as a given sequence."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $errors "Throws an error if the sequence contains elements other than real numbers."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  float-array>vector 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "float-array"  "an array"  } { "length"  "a non-negative integer"  } { "float-vector"  float-vector } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Creates a new float vector using the array for underlying storage with the specified initial length."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $warning "This word is in the "  { $vocab-link "float-vectors.private"  } " vocabulary because it does not perform type or bounds checks. User code should call "  { $link >float-vector } " instead."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-19 23:56:28 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  FV{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $syntax "FV{ elements... }"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "elements"  "a list of real numbers"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Marks the beginning of a literal float vector. Literal float vectors are terminated by "  { $link POSTPONE:  }  } "."  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples { $code "FV{ 1.0 2.0 3.0 }"  } } ;