--- ray/doc/man/man1/rcollate.1 2019/07/20 00:57:43 1.8 +++ ray/doc/man/man1/rcollate.1 2020/09/07 17:08:08 1.14 @@ -1,7 +1,7 @@ -.\" RCSid "$Id: rcollate.1,v 1.8 2019/07/20 00:57:43 greg Exp $" +.\" RCSid "$Id: rcollate.1,v 1.14 2020/09/07 17:08:08 greg Exp $" .TH RCOLLATE 1 7/8/97 RADIANCE .SH NAME -rcollate - resize or transpose matrix data +rcollate - resize or re-order matrix data .SH SYNOPSIS .B rcollate [ @@ -9,8 +9,10 @@ rcollate - resize or transpose matrix data ][ .B \-w ][ -.B \-f[afdb][N] +.B \-c ][ +.B \-f{a|f|d|b}[N] +][ .B \-t ][ .B "\-ic in_col" @@ -20,6 +22,8 @@ rcollate - resize or transpose matrix data .B "\-oc out_col" ][ .B "\-or out_row" +][ +.B "\-o RxC[xR1xC2..]" ] [ .B input.dat @@ -30,6 +34,21 @@ reads in a single matrix file (table) and reshapes it the number of columns specified by the .I \-oc option. +The number of rows may be specified with a +.I \-or +option, or may be determined automatically from the size of the input if +it is an even multiple of the number of columns (as it should be). +Alternatively, both may be specified using a +.I \-o +option with the number of rows and columns separated by an 'x', as in "30x14" +for 30 rows by 14 columns. +.I Rcollate +can also reorder the input into nested blocks by continuing the output size +string. +For example, "3x10X7x2" would order output data with a 3x10 super-array of +7x2 subblocks. +This type of block hierarchy is convenient for visualizing tensor data. +.PP By default, the file is assumed to include an information header, which is copied to the standard output along with the command name. The @@ -44,6 +63,16 @@ The .I \-w option turns off non-fatal warning messages, such as unexpected EOD. .PP +Normally, +.I rcollate +detects whether any transformation is actually taking place, and will +reproduce the data verbatim if the input size and shape should be unaltered. +The +.I \-c +opiton forces the operation to proceed, even if it appears to be a no-op, +which can be useful to correct a misshapen input matrix or check that +the data is the proper size. +.PP The input format is assumed to be ASCII, with three white-space separated words (typically numbers) in each record. A different input format may be specified with the @@ -72,8 +101,8 @@ and would all be equivalent. Note that the lack of row separators in binary files means that .I rcollate -does not actually do anything for binary files unless the transpose -option is given, also. +does not actually do anything for binary files unless the data is being +re-ordered. .PP If an input header is present, it may contain the format, number of components and matrix dimensions. @@ -88,23 +117,23 @@ information if provided. The transpose option, .I \-t swaps rows and columns on the input. -For binary files, the user must specify at least one input or output -dimension to define the matrix size. +For binary files with no header information, the user must +specify at least one input or output dimension to define the matrix size. For ASCII files, .I rcollate will automatically determine the number of columns based on the position of the first EOL (end-of-line) character, and the number of rows based on the total count of records in the file. The user may override these determinations, allowing the matrix to -be resized as well as transposed. -If input and output dimensions are given, the number of input rows -must equal the number of output columns, +be resized or re-ordered as well as transposed. +If input and output dimensions are given and there is no block re-ordering, +the number of input rows must equal the number of output columns, and the number of input columns must equal the number of output rows. -For large transpose operations on Unix systems, it is most efficient -to specify the input file on the command line, rather than reading -from the standard input, since -.I rcollate -can map the file directly into virtual memory. +If the +.I \-o +option is also given with multiple block levels, the transpose operation +will logically precede the re-ordering operation, regardless of their +position on the command line. .SH EXAMPLES To change put 8760 color triplets per row in a matrix with no header: .IP "" .2i @@ -118,9 +147,20 @@ To create an appropriate header for a binary float mat .I rmtxop(1)\: .IP "" .2i rcollate -hi -ff3 -or 145 -oc 8760 input.smx | rmtxop dcoef.dmx - > res.txt +.PP +To visualize a Shirley-Chiu BTDF matrix where the interior resolution is +64x64 and the exterior resolution is 32x32: +.IP "" .2i +rcollate -o 64x64X32x32 s-c_bsdf.mtx | rmtxop -fc - > s-c_bsdf.hdr .SH AUTHOR Greg Ward .SH NOTES +For large transpose or re-ordering operations on Unix systems, +it is most efficient to specify the input file on the command line, +rather than reading from the standard input, since +.I rcollate +can map the file directly into virtual memory. +.PP The .I rcollate command is rather inflexible when it comes to output field and record @@ -131,7 +171,7 @@ between words and tabs as record separators on output. Output row separtors will always be an EOL, which may differ between systems. .PP If no options are given on the command line, or a binary file is specified -without a transpose, +without a transpose or re-ordering, .I rcollate issues a warning and simply copies its input to its standard output. .SH "SEE ALSO"