2008-01-28 19:15:21 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								! Copyright (C) 2008 Slava Pestov.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								! See http://factorcode.org/license.txt for BSD license.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								USING: arrays kernel kernel.private math sequences
							 | 
						
					
						
							
								
									
										
										
										
											2008-04-19 23:56:28 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								sequences.private growable float-arrays prettyprint.backend
							 | 
						
					
						
							
								
									
										
										
										
											2008-04-20 03:30:52 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								parser accessors ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-01-28 19:15:21 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								IN: float-vectors
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-06-28 03:36:20 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								TUPLE: float-vector
							 | 
						
					
						
							
								
									
										
										
										
											2008-07-02 03:03:30 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{ underlying float-array initial: F{ } }
							 | 
						
					
						
							
								
									
										
										
										
											2008-06-29 22:37:57 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{ length array-capacity } ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-04-20 01:18:27 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-01-28 19:15:21 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								: <float-vector> ( n -- float-vector )
							 | 
						
					
						
							
								
									
										
										
										
											2008-07-02 03:03:30 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    <float-array> 0 float-vector boa ; inline
							 | 
						
					
						
							
								
									
										
										
										
											2008-01-28 19:15:21 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-04-20 01:18:27 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								: >float-vector ( seq -- float-vector )
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    T{ float-vector f F{ } 0 } clone-like ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-01-28 19:15:21 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								M: float-vector like
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    drop dup float-vector? [
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        dup float-array?
							 | 
						
					
						
							
								
									
										
										
										
											2008-07-01 21:19:03 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        [ dup length float-vector boa ] [ >float-vector ] if
							 | 
						
					
						
							
								
									
										
										
										
											2008-01-28 19:15:21 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    ] unless ;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-04-13 13:54:58 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								M: float-vector new-sequence
							 | 
						
					
						
							
								
									
										
										
										
											2008-07-02 03:03:30 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    drop [ <float-array> ] [ >fixnum ] bi float-vector boa ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-01-28 19:15:21 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								M: float-vector equal?
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    over float-vector? [ sequence= ] [ 2drop f ] if ;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-01-30 02:42:51 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								M: float-array new-resizable drop <float-vector> ;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-01-28 19:15:21 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								INSTANCE: float-vector growable
							 | 
						
					
						
							
								
									
										
										
										
											2008-04-19 23:56:28 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								: FV{ \ } [ >float-vector ] parse-literal ; parsing
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-04-20 01:18:27 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								M: float-vector >pprint-sequence ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-04-19 23:56:28 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								M: float-vector pprint-delims drop \ FV{ \ } ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-09-06 04:23:54 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								M: float-vector pprint* pprint-object ;
							 |