From: John Darrington Date: Sat, 26 Jul 2008 05:36:03 +0000 (+0800) Subject: Removed the value_cnt associated with the caseordering X-Git-Tag: v0.7.0~11 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=8407e8566f02d768975e0fc1b8cb650b12f5239a Removed the value_cnt associated with the caseordering Made sure that sort_execute returns a casereader the same dimensions as its subject. --- diff --git a/po/en_GB.po b/po/en_GB.po index bf073926..e09bbf09 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.4.3\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2008-06-07 23:34-0700\n" +"POT-Creation-Date: 2008-07-24 19:40+0800\n" "PO-Revision-Date: 2007-09-15 08:29+0800\n" "Last-Translator: John Darrington \n" "Language-Team: John Darrington \n" @@ -44,6 +44,12 @@ msgstr "" msgid "Date %04d-%d-%d is before the earliest acceptable date of 1582-10-15." msgstr "" +#: src/data/casereader-filter.c:221 +msgid "" +"At least one case in the data read had a weight value that was user-missing, " +"system-missing, zero, or negative. These case(s) were ignored." +msgstr "" + #: src/data/case-tmpfile.c:57 #, c-format msgid "failed to create temporary file" @@ -69,12 +75,6 @@ msgstr "" msgid "writing to temporary file" msgstr "" -#: src/data/casereader-filter.c:221 -msgid "" -"At least one case in the data read had a weight value that was user-missing, " -"system-missing, zero, or negative. These case(s) were ignored." -msgstr "" - #: src/data/data-in.c:262 src/data/data-in.c:452 msgid "Field contents are not numeric." msgstr "" @@ -320,14 +320,14 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:327 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1190 src/ui/gui/psppire-var-store.c:605 -#: src/ui/gui/psppire.glade:2176 +#: src/ui/gui/data-editor.glade:1190 src/ui/gui/psppire.glade:2176 +#: src/ui/gui/psppire-var-store.c:605 msgid "String" msgstr "" #: src/data/format.c:327 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1079 src/ui/gui/psppire-var-store.c:598 -#: src/ui/gui/psppire.glade:2131 +#: src/ui/gui/data-editor.glade:1079 src/ui/gui/psppire.glade:2131 +#: src/ui/gui/psppire-var-store.c:598 msgid "Numeric" msgstr "" @@ -1423,67 +1423,6 @@ msgstr "" msgid "Handle for %s not allowed here." msgstr "" -#: src/language/data-io/get-data.c:62 -#, c-format -msgid "Unsupported TYPE %s" -msgstr "" - -#: src/language/data-io/get-data.c:258 -#, c-format -msgid "" -"%s is allowed only with %s arrangement, but %s arrangement was stated or " -"implied earlier in this command." -msgstr "" - -#: src/language/data-io/get-data.c:313 -msgid "expecting FIXED or DELIMITED" -msgstr "" - -#: src/language/data-io/get-data.c:326 -msgid "Value of FIRSTCASE must be 1 or greater." -msgstr "" - -#: src/language/data-io/get-data.c:351 -msgid "expecting LINE or VARIABLES" -msgstr "" - -#: src/language/data-io/get-data.c:364 -msgid "Value of FIXCASE must be at least 1." -msgstr "" - -#: src/language/data-io/get-data.c:384 -msgid "Value of FIRST must be at least 1." -msgstr "" - -#: src/language/data-io/get-data.c:396 -msgid "Value of PERCENT must be between 1 and 100." -msgstr "" - -#: src/language/data-io/get-data.c:445 -msgid "" -"In compatible syntax mode, the QUALIFIER string must contain exactly one " -"character." -msgstr "" - -#: src/language/data-io/get-data.c:460 -msgid "expecting VARIABLES" -msgstr "" - -#: src/language/data-io/get-data.c:482 -#: src/language/data-io/placement-parser.c:378 -#, c-format -msgid "" -"The record number specified, %ld, is at or before the previous record, %d. " -"Data fields must be listed in order of increasing record number." -msgstr "" - -#: src/language/data-io/get-data.c:491 -#, c-format -msgid "" -"The record number specified, %ld, exceeds the number of records per case " -"specified on FIXCASE, %d." -msgstr "" - #: src/language/data-io/get.c:99 msgid "expecting COMM or TAPE" msgstr "" @@ -1573,6 +1512,67 @@ msgid "" "variable in earlier file (%s)." msgstr "" +#: src/language/data-io/get-data.c:62 +#, c-format +msgid "Unsupported TYPE %s" +msgstr "" + +#: src/language/data-io/get-data.c:258 +#, c-format +msgid "" +"%s is allowed only with %s arrangement, but %s arrangement was stated or " +"implied earlier in this command." +msgstr "" + +#: src/language/data-io/get-data.c:313 +msgid "expecting FIXED or DELIMITED" +msgstr "" + +#: src/language/data-io/get-data.c:326 +msgid "Value of FIRSTCASE must be 1 or greater." +msgstr "" + +#: src/language/data-io/get-data.c:351 +msgid "expecting LINE or VARIABLES" +msgstr "" + +#: src/language/data-io/get-data.c:364 +msgid "Value of FIXCASE must be at least 1." +msgstr "" + +#: src/language/data-io/get-data.c:384 +msgid "Value of FIRST must be at least 1." +msgstr "" + +#: src/language/data-io/get-data.c:396 +msgid "Value of PERCENT must be between 1 and 100." +msgstr "" + +#: src/language/data-io/get-data.c:445 +msgid "" +"In compatible syntax mode, the QUALIFIER string must contain exactly one " +"character." +msgstr "" + +#: src/language/data-io/get-data.c:460 +msgid "expecting VARIABLES" +msgstr "" + +#: src/language/data-io/get-data.c:482 +#: src/language/data-io/placement-parser.c:378 +#, c-format +msgid "" +"The record number specified, %ld, is at or before the previous record, %d. " +"Data fields must be listed in order of increasing record number." +msgstr "" + +#: src/language/data-io/get-data.c:491 +#, c-format +msgid "" +"The record number specified, %ld, exceeds the number of records per case " +"specified on FIXCASE, %d." +msgstr "" + #: src/language/data-io/inpt-pgm.c:130 msgid "Unexpected end-of-file within INPUT PROGRAM." msgstr "" @@ -1662,20 +1662,6 @@ msgstr "" msgid "The ending column for a field must be greater than the starting column." msgstr "" -#: src/language/data-io/print-space.c:73 src/language/lexer/lexer.c:476 -#: src/language/stats/autorecode.c:154 src/language/xforms/select-if.c:60 -msgid "expecting end of command" -msgstr "" - -#: src/language/data-io/print-space.c:116 -msgid "The expression on PRINT SPACE evaluated to the system-missing value." -msgstr "" - -#: src/language/data-io/print-space.c:119 -#, c-format -msgid "The expression on PRINT SPACE evaluated to %g." -msgstr "" - #: src/language/data-io/print.c:266 #, c-format msgid "Output calls for %d records but %zu specified on RECORDS subcommand." @@ -1695,6 +1681,20 @@ msgid_plural "Writing %d records." msgstr[0] "" msgstr[1] "" +#: src/language/data-io/print-space.c:73 src/language/lexer/lexer.c:476 +#: src/language/stats/autorecode.c:154 src/language/xforms/select-if.c:60 +msgid "expecting end of command" +msgstr "" + +#: src/language/data-io/print-space.c:116 +msgid "The expression on PRINT SPACE evaluated to the system-missing value." +msgstr "" + +#: src/language/data-io/print-space.c:119 +#, c-format +msgid "The expression on PRINT SPACE evaluated to %g." +msgstr "" + #: src/language/dictionary/apply-dictionary.c:75 #, c-format msgid "Variable %s is %s in target file, but %s in source file." @@ -1880,7 +1880,7 @@ msgstr "" #: src/language/dictionary/split-file.c:86 #: src/language/dictionary/sys-file-info.c:397 #: src/language/dictionary/sys-file-info.c:564 src/ui/gui/crosstabs.glade:275 -#: src/ui/gui/psppire-var-sheet.c:104 src/ui/gui/psppire.glade:2099 +#: src/ui/gui/psppire.glade:2099 src/ui/gui/psppire-var-sheet.c:104 msgid "Label" msgstr "" @@ -2615,38 +2615,38 @@ msgstr "" msgid "Duplicate variable name %s among target variables." msgstr "" -#: src/language/stats/binomial.c:133 +#: src/language/stats/binomial.c:132 #, c-format msgid "Variable %s is not dichotomous" msgstr "" -#: src/language/stats/binomial.c:178 +#: src/language/stats/binomial.c:177 msgid "Binomial Test" msgstr "" -#: src/language/stats/binomial.c:202 +#: src/language/stats/binomial.c:201 msgid "Group1" msgstr "" -#: src/language/stats/binomial.c:203 +#: src/language/stats/binomial.c:202 msgid "Group2" msgstr "" -#: src/language/stats/binomial.c:204 src/language/stats/chisquare.c:223 +#: src/language/stats/binomial.c:203 src/language/stats/chisquare.c:223 #: src/language/stats/chisquare.c:283 src/language/stats/crosstabs.q:862 #: src/language/stats/crosstabs.q:1062 src/language/stats/crosstabs.q:1785 #: src/language/stats/examine.q:918 src/language/stats/frequencies.q:1137 #: src/language/stats/oneway.q:306 src/language/stats/oneway.q:476 -#: src/language/stats/regression.q:312 src/ui/gui/crosstabs-dialog.c:59 +#: src/language/stats/regression.q:309 src/ui/gui/crosstabs-dialog.c:59 msgid "Total" msgstr "" -#: src/language/stats/binomial.c:236 src/language/stats/chisquare.c:246 +#: src/language/stats/binomial.c:235 src/language/stats/chisquare.c:246 #: src/language/stats/crosstabs.q:1180 src/language/stats/crosstabs.q:1221 msgid "Category" msgstr "" -#: src/language/stats/binomial.c:237 src/language/stats/crosstabs.q:872 +#: src/language/stats/binomial.c:236 src/language/stats/crosstabs.q:872 #: src/language/stats/examine.q:993 src/language/stats/frequencies.q:1405 #: src/language/stats/npar-summary.c:122 src/language/stats/oneway.q:391 #: src/language/stats/t-test.q:693 src/language/stats/t-test.q:716 @@ -2654,15 +2654,15 @@ msgstr "" msgid "N" msgstr "" -#: src/language/stats/binomial.c:238 +#: src/language/stats/binomial.c:237 msgid "Observed Prop." msgstr "" -#: src/language/stats/binomial.c:239 +#: src/language/stats/binomial.c:238 msgid "Test Prop." msgstr "" -#: src/language/stats/binomial.c:242 +#: src/language/stats/binomial.c:241 #, c-format msgid "Exact Sig. (%d-tailed)" msgstr "" @@ -2683,7 +2683,7 @@ msgid "Expected N" msgstr "" #: src/language/stats/chisquare.c:209 src/language/stats/chisquare.c:249 -#: src/language/stats/regression.q:311 src/ui/gui/crosstabs-dialog.c:61 +#: src/language/stats/regression.q:308 src/ui/gui/crosstabs-dialog.c:61 msgid "Residual" msgstr "" @@ -2701,7 +2701,7 @@ msgstr "" #: src/language/stats/chisquare.c:312 src/language/stats/crosstabs.q:1156 #: src/language/stats/oneway.q:279 src/language/stats/oneway.q:694 -#: src/language/stats/regression.q:305 src/language/stats/t-test.q:1001 +#: src/language/stats/regression.q:302 src/language/stats/t-test.q:1001 #: src/language/stats/t-test.q:1193 src/language/stats/t-test.q:1286 msgid "df" msgstr "" @@ -2854,8 +2854,8 @@ msgstr "" msgid "Directional measures." msgstr "" -#: src/language/stats/crosstabs.q:1223 src/ui/gui/psppire-var-sheet.c:101 -#: src/ui/gui/psppire.glade:2223 +#: src/language/stats/crosstabs.q:1223 src/ui/gui/psppire.glade:2223 +#: src/ui/gui/psppire-var-sheet.c:101 msgid "Type" msgstr "" @@ -3133,7 +3133,7 @@ msgid "Lowest" msgstr "" #: src/language/stats/examine.q:1443 src/language/stats/oneway.q:394 -#: src/language/stats/oneway.q:692 src/language/stats/regression.q:204 +#: src/language/stats/oneway.q:692 src/language/stats/regression.q:203 msgid "Std. Error" msgstr "" @@ -3366,15 +3366,11 @@ msgstr "" msgid "50 (Median)" msgstr "" -#: src/language/stats/glm.q:147 +#: src/language/stats/glm.q:148 msgid "Multivariate GLM not yet supported" msgstr "" -#: src/language/stats/glm.q:271 src/language/stats/regression.q:934 -msgid "Dependent variable must be numeric." -msgstr "" - -#: src/language/stats/glm.q:346 src/language/stats/regression.q:1030 +#: src/language/stats/glm.q:356 src/language/stats/regression.q:1026 msgid "No valid data found. This command was skipped." msgstr "" @@ -3386,22 +3382,6 @@ msgstr "" msgid "TABLES subcommand may not appear more than once." msgstr "" -#: src/language/stats/npar-summary.c:108 -msgid "Descriptive Statistics" -msgstr "" - -#: src/language/stats/npar-summary.c:145 -msgid "25th" -msgstr "" - -#: src/language/stats/npar-summary.c:148 -msgid "50th (Median)" -msgstr "" - -#: src/language/stats/npar-summary.c:151 -msgid "75th" -msgstr "" - #: src/language/stats/npar.q:98 msgid "NPAR subcommand not currently implemented." msgstr "" @@ -3426,6 +3406,22 @@ msgid "" "not match the number following (%zu)." msgstr "" +#: src/language/stats/npar-summary.c:108 +msgid "Descriptive Statistics" +msgstr "" + +#: src/language/stats/npar-summary.c:145 +msgid "25th" +msgstr "" + +#: src/language/stats/npar-summary.c:148 +msgid "50th (Median)" +msgstr "" + +#: src/language/stats/npar-summary.c:151 +msgid "75th" +msgstr "" + #: src/language/stats/oneway.q:169 msgid "Number of contrast coefficients must equal the number of groups" msgstr "" @@ -3440,21 +3436,21 @@ msgstr "" msgid "`%s' is not a variable name" msgstr "" -#: src/language/stats/oneway.q:278 src/language/stats/regression.q:304 +#: src/language/stats/oneway.q:278 src/language/stats/regression.q:301 msgid "Sum of Squares" msgstr "" -#: src/language/stats/oneway.q:280 src/language/stats/regression.q:306 +#: src/language/stats/oneway.q:280 src/language/stats/regression.q:303 msgid "Mean Square" msgstr "" -#: src/language/stats/oneway.q:281 src/language/stats/regression.q:307 +#: src/language/stats/oneway.q:281 src/language/stats/regression.q:304 #: src/language/stats/t-test.q:998 msgid "F" msgstr "" #: src/language/stats/oneway.q:282 src/language/stats/oneway.q:542 -#: src/language/stats/regression.q:207 src/language/stats/regression.q:308 +#: src/language/stats/regression.q:206 src/language/stats/regression.q:305 msgid "Significance" msgstr "" @@ -3466,7 +3462,7 @@ msgstr "" msgid "Within Groups" msgstr "" -#: src/language/stats/oneway.q:352 src/language/stats/regression.q:333 +#: src/language/stats/oneway.q:352 src/language/stats/regression.q:330 msgid "ANOVA" msgstr "" @@ -3502,7 +3498,7 @@ msgstr "" msgid "Value of Contrast" msgstr "" -#: src/language/stats/oneway.q:693 src/language/stats/regression.q:206 +#: src/language/stats/oneway.q:693 src/language/stats/regression.q:205 #: src/language/stats/t-test.q:1000 src/language/stats/t-test.q:1192 #: src/language/stats/t-test.q:1285 msgid "t" @@ -3594,45 +3590,49 @@ msgstr "" msgid "Model Summary" msgstr "" -#: src/language/stats/regression.q:203 +#: src/language/stats/regression.q:202 msgid "B" msgstr "" -#: src/language/stats/regression.q:205 +#: src/language/stats/regression.q:204 msgid "Beta" msgstr "" -#: src/language/stats/regression.q:208 +#: src/language/stats/regression.q:207 msgid "(Constant)" msgstr "" -#: src/language/stats/regression.q:274 +#: src/language/stats/regression.q:271 msgid "Coefficients" msgstr "" -#: src/language/stats/regression.q:310 +#: src/language/stats/regression.q:307 msgid "Regression" msgstr "" -#: src/language/stats/regression.q:392 +#: src/language/stats/regression.q:389 msgid "Model" msgstr "" -#: src/language/stats/regression.q:393 +#: src/language/stats/regression.q:390 msgid "Covariances" msgstr "" -#: src/language/stats/regression.q:408 +#: src/language/stats/regression.q:405 msgid "Coefficient Correlations" msgstr "" -#: src/language/stats/regression.q:810 +#: src/language/stats/regression.q:807 msgid "" "The dependent variable is equal to the independent variable.The least " "squares line is therefore Y=X.Standard errors and related statistics may be " "meaningless." msgstr "" +#: src/language/stats/regression.q:931 +msgid "Dependent variable must be numeric." +msgstr "" + #: src/language/stats/sort-cases.c:64 msgid "Buffer limit must be at least 2." msgstr "" @@ -5578,6 +5578,14 @@ msgstr "" msgid "Paste" msgstr "" +#: src/ui/gui/psppire.c:194 +msgid "_Reset" +msgstr "" + +#: src/ui/gui/psppire.c:195 +msgid "_Select" +msgstr "" + #: src/ui/gui/psppire-data-editor.c:604 msgid "Data View" msgstr "" @@ -5595,52 +5603,6 @@ msgstr "" msgid "%ld" msgstr "" -#: src/ui/gui/psppire-var-sheet.c:100 -msgid "Name" -msgstr "" - -#: src/ui/gui/psppire-var-sheet.c:102 src/ui/gui/psppire.glade:2187 -msgid "Width" -msgstr "" - -#: src/ui/gui/psppire-var-sheet.c:103 -msgid "Decimals" -msgstr "" - -#: src/ui/gui/psppire-var-sheet.c:105 -msgid "Values" -msgstr "" - -#: src/ui/gui/psppire-var-sheet.c:108 -msgid "Align" -msgstr "" - -#: src/ui/gui/psppire-var-sheet.c:109 -msgid "Measure" -msgstr "" - -#: src/ui/gui/psppire-var-store.c:601 -msgid "Scientific" -msgstr "" - -#: src/ui/gui/psppire-var-store.c:604 -msgid "Custom" -msgstr "" - -#: src/ui/gui/psppire-var-store.c:675 src/ui/gui/psppire-var-store.c:685 -#: src/ui/gui/psppire-var-store.c:695 -#, c-format -msgid "%d" -msgstr "" - -#: src/ui/gui/psppire.c:194 -msgid "_Reset" -msgstr "" - -#: src/ui/gui/psppire.c:195 -msgid "_Select" -msgstr "" - #: src/ui/gui/psppire.glade:11 msgid "" "This is beta status software. Please report bugs to bug-gnu-pspp@gnu.org" @@ -5826,6 +5788,10 @@ msgstr "" msgid "Use expression as label" msgstr "" +#: src/ui/gui/psppire.glade:2187 src/ui/gui/psppire-var-sheet.c:102 +msgid "Width" +msgstr "" + #: src/ui/gui/psppire.glade:2274 msgid "Goto Case Number:" msgstr "" @@ -5858,6 +5824,40 @@ msgstr "" msgid "Search backward" msgstr "" +#: src/ui/gui/psppire-var-sheet.c:100 +msgid "Name" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:103 +msgid "Decimals" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:105 +msgid "Values" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:108 +msgid "Align" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:109 +msgid "Measure" +msgstr "" + +#: src/ui/gui/psppire-var-store.c:601 +msgid "Scientific" +msgstr "" + +#: src/ui/gui/psppire-var-store.c:604 +msgid "Custom" +msgstr "" + +#: src/ui/gui/psppire-var-store.c:675 src/ui/gui/psppire-var-store.c:685 +#: src/ui/gui/psppire-var-store.c:695 +#, c-format +msgid "%d" +msgstr "" + #: src/ui/gui/rank.glade:111 msgid "By:" msgstr "" @@ -6146,56 +6146,6 @@ msgstr "" msgid "To End" msgstr "" -#: src/ui/gui/t-test-options.c:60 -#, c-format -msgid "Confidence Interval: %2d %%" -msgstr "" - -#: src/ui/gui/t-test-paired-samples.c:228 -msgid "Var 1" -msgstr "" - -#: src/ui/gui/t-test-paired-samples.c:229 -msgid "Var 2" -msgstr "" - -#: src/ui/gui/t-test.glade:56 src/ui/gui/t-test.glade:165 -msgid "Define Groups" -msgstr "" - -#: src/ui/gui/t-test.glade:123 src/ui/gui/t-test.glade:549 -#: src/ui/gui/t-test.glade:761 -msgid "Test Variable(s):" -msgstr "" - -#: src/ui/gui/t-test.glade:258 -msgid "Group_2 value:" -msgstr "" - -#: src/ui/gui/t-test.glade:271 -msgid "Group_1 value:" -msgstr "" - -#: src/ui/gui/t-test.glade:320 -msgid "_Cut point:" -msgstr "" - -#: src/ui/gui/t-test.glade:349 -msgid "_Use specified values:" -msgstr "" - -#: src/ui/gui/t-test.glade:431 -msgid "Exclude cases _analysis by analysis" -msgstr "" - -#: src/ui/gui/t-test.glade:442 -msgid "Exclude cases _listwise" -msgstr "" - -#: src/ui/gui/t-test.glade:594 -msgid "Test Value: " -msgstr "" - #: src/ui/gui/text-data-import-dialog.c:70 msgid "" "The text import assistant has not been compiled into this build of PSPPIRE, " @@ -6415,6 +6365,56 @@ msgstr "" msgid "Data Preview" msgstr "" +#: src/ui/gui/t-test.glade:56 src/ui/gui/t-test.glade:165 +msgid "Define Groups" +msgstr "" + +#: src/ui/gui/t-test.glade:123 src/ui/gui/t-test.glade:549 +#: src/ui/gui/t-test.glade:761 +msgid "Test Variable(s):" +msgstr "" + +#: src/ui/gui/t-test.glade:258 +msgid "Group_2 value:" +msgstr "" + +#: src/ui/gui/t-test.glade:271 +msgid "Group_1 value:" +msgstr "" + +#: src/ui/gui/t-test.glade:320 +msgid "_Cut point:" +msgstr "" + +#: src/ui/gui/t-test.glade:349 +msgid "_Use specified values:" +msgstr "" + +#: src/ui/gui/t-test.glade:431 +msgid "Exclude cases _analysis by analysis" +msgstr "" + +#: src/ui/gui/t-test.glade:442 +msgid "Exclude cases _listwise" +msgstr "" + +#: src/ui/gui/t-test.glade:594 +msgid "Test Value: " +msgstr "" + +#: src/ui/gui/t-test-options.c:60 +#, c-format +msgid "Confidence Interval: %2d %%" +msgstr "" + +#: src/ui/gui/t-test-paired-samples.c:228 +msgid "Var 1" +msgstr "" + +#: src/ui/gui/t-test-paired-samples.c:229 +msgid "Var 2" +msgstr "" + #: src/ui/gui/variable-info-dialog.c:89 #, c-format msgid "Label: %s\n" diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 2c777358..1b242dd5 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,8 @@ +2008-07-26 John Darrington + + * case-ordering.c case-ordering.h: Removed the value_cnt + associated with the ordering structure. + 2008-07-16 Jason Stover * category.c (cat_get_category_count): New function. diff --git a/src/data/case-ordering.c b/src/data/case-ordering.c index 7b3948c4..c4a716e0 100644 --- a/src/data/case-ordering.c +++ b/src/data/case-ordering.c @@ -37,8 +37,6 @@ struct sort_key /* A set of criteria for ordering cases. */ struct case_ordering { - size_t value_cnt; /* Number of `union value's per case. */ - /* Sort keys. */ struct sort_key *keys; size_t key_cnt; @@ -49,10 +47,9 @@ struct case_ordering contains no variables, so that all cases will compare as equal. */ struct case_ordering * -case_ordering_create (const struct dictionary *dict) +case_ordering_create (void) { struct case_ordering *co = xmalloc (sizeof *co); - co->value_cnt = dict_get_next_value_idx (dict); co->keys = NULL; co->key_cnt = 0; return co; @@ -63,7 +60,6 @@ struct case_ordering * case_ordering_clone (const struct case_ordering *orig) { struct case_ordering *co = xmalloc (sizeof *co); - co->value_cnt = orig->value_cnt; co->keys = xmemdup (orig->keys, orig->key_cnt * sizeof *orig->keys); co->key_cnt = orig->key_cnt; return co; @@ -80,15 +76,6 @@ case_ordering_destroy (struct case_ordering *co) } } -/* Returns the number of `union value's in the cases that case - ordering CO compares (taken from the dictionary used to - construct it). */ -size_t -case_ordering_get_value_cnt (const struct case_ordering *co) -{ - return co->value_cnt; -} - /* Compares cases A and B given case ordering CO and returns a strcmp()-type result. */ int diff --git a/src/data/case-ordering.h b/src/data/case-ordering.h index 026cd899..f49f2651 100644 --- a/src/data/case-ordering.h +++ b/src/data/case-ordering.h @@ -32,7 +32,7 @@ enum sort_direction }; /* Creation and destruction. */ -struct case_ordering *case_ordering_create (const struct dictionary *); +struct case_ordering *case_ordering_create (void); struct case_ordering *case_ordering_clone (const struct case_ordering *); void case_ordering_destroy (struct case_ordering *); diff --git a/src/language/stats/rank.q b/src/language/stats/rank.q index 5bc88c4a..cb639490 100644 --- a/src/language/stats/rank.q +++ b/src/language/stats/rank.q @@ -261,7 +261,7 @@ rank_cmd (struct dataset *ds, const struct case_ordering *sc, /* Sort this split group by the BY variables as primary keys and the rank variable as secondary key. */ - ordering = case_ordering_create (d); + ordering = case_ordering_create (); for (j = 0; j < n_group_vars; j++) case_ordering_add_var (ordering, group_vars[j], SRT_ASCEND); case_ordering_add_var (ordering, @@ -778,7 +778,7 @@ cmd_rank (struct lexer *lexer, struct dataset *ds) /* Put the active file back in its original order. Delete our sort key, which we don't need anymore. */ { - struct case_ordering *ordering = case_ordering_create (dataset_dict (ds)); + struct case_ordering *ordering = case_ordering_create (); struct casereader *sorted; case_ordering_add_var (ordering, order, SRT_ASCEND); /* FIXME: loses error conditions. */ diff --git a/src/language/stats/sort-criteria.c b/src/language/stats/sort-criteria.c index c84f71d5..fd8c7c53 100644 --- a/src/language/stats/sort-criteria.c +++ b/src/language/stats/sort-criteria.c @@ -39,7 +39,7 @@ struct case_ordering * parse_case_ordering (struct lexer *lexer, const struct dictionary *dict, bool *saw_direction) { - struct case_ordering *ordering = case_ordering_create (dict); + struct case_ordering *ordering = case_ordering_create (); const struct variable **vars = NULL; size_t var_cnt = 0; diff --git a/src/math/ChangeLog b/src/math/ChangeLog index 124abbf5..b3c9386d 100644 --- a/src/math/ChangeLog +++ b/src/math/ChangeLog @@ -1,3 +1,10 @@ +2008-07-24 John Darrington + + * merge.c merge.h sort.c sort.h: Removed the value_cnt associated + with case ordering. This ensures that the casereader returned by + sort_execute now has the same dimensions as the casereader passed + in. + 2008-07-17 Jason H Stover * covariance-matrix.c (covariance_update_categorical_numeric): diff --git a/src/math/merge.c b/src/math/merge.c index d56a78c3..4fc7c8dc 100644 --- a/src/math/merge.c +++ b/src/math/merge.c @@ -44,16 +44,18 @@ struct merge struct case_ordering *ordering; struct merge_input inputs[MAX_MERGE_ORDER]; size_t input_cnt; + size_t value_cnt; }; static void do_merge (struct merge *m); struct merge * -merge_create (const struct case_ordering *ordering) +merge_create (const struct case_ordering *ordering, size_t value_cnt) { struct merge *m = xmalloc (sizeof *m); m->ordering = case_ordering_clone (ordering); m->input_cnt = 0; + m->value_cnt = value_cnt; return m; } @@ -95,8 +97,7 @@ merge_make_reader (struct merge *m) } else if (m->input_cnt == 0) { - size_t value_cnt = case_ordering_get_value_cnt (m->ordering); - struct casewriter *writer = mem_writer_create (value_cnt); + struct casewriter *writer = mem_writer_create (m->value_cnt); r = casewriter_make_reader (writer); } else @@ -129,7 +130,7 @@ do_merge (struct merge *m) assert (m->input_cnt > 1); - w = tmpfile_writer_create (case_ordering_get_value_cnt (m->ordering)); + w = tmpfile_writer_create (m->value_cnt); for (i = 0; i < m->input_cnt; i++) taint_propagate (casereader_get_taint (m->inputs[i].reader), casewriter_get_taint (w)); diff --git a/src/math/merge.h b/src/math/merge.h index c9c9c486..18322e84 100644 --- a/src/math/merge.h +++ b/src/math/merge.h @@ -18,11 +18,12 @@ #define MATH_MERGE_H 1 #include +#include struct case_ordering; struct casereader; -struct merge *merge_create (const struct case_ordering *); +struct merge *merge_create (const struct case_ordering *, size_t); void merge_destroy (struct merge *); void merge_append (struct merge *, struct casereader *); struct casereader *merge_make_reader (struct merge *); diff --git a/src/math/sort.c b/src/math/sort.c index e03ef574..10b8a12c 100644 --- a/src/math/sort.c +++ b/src/math/sort.c @@ -41,6 +41,7 @@ int max_buffers = INT_MAX; struct sort_writer { + size_t value_cnt; struct case_ordering *ordering; struct merge *merge; struct pqueue *pqueue; @@ -52,7 +53,7 @@ struct sort_writer static struct casewriter_class sort_casewriter_class; -static struct pqueue *pqueue_create (const struct case_ordering *); +static struct pqueue *pqueue_create (const struct case_ordering *, size_t); static void pqueue_destroy (struct pqueue *); static bool pqueue_is_full (const struct pqueue *); static bool pqueue_is_empty (const struct pqueue *); @@ -62,15 +63,15 @@ static void pqueue_pop (struct pqueue *, struct ccase *, casenumber *); static void output_record (struct sort_writer *); struct casewriter * -sort_create_writer (struct case_ordering *ordering) +sort_create_writer (struct case_ordering *ordering, size_t value_cnt) { - size_t value_cnt = case_ordering_get_value_cnt (ordering); struct sort_writer *sort; sort = xmalloc (sizeof *sort); + sort->value_cnt = value_cnt; sort->ordering = case_ordering_clone (ordering); - sort->merge = merge_create (ordering); - sort->pqueue = pqueue_create (ordering); + sort->merge = merge_create (ordering, value_cnt); + sort->pqueue = pqueue_create (ordering, value_cnt); sort->run = NULL; sort->run_id = 0; case_nullify (&sort->run_end); @@ -118,8 +119,7 @@ sort_casewriter_convert_to_reader (struct casewriter *writer, void *sort_) if (sort->run == NULL && sort->run_id == 0) { /* In-core sort. */ - sort->run = mem_writer_create (case_ordering_get_value_cnt ( - sort->ordering)); + sort->run = mem_writer_create (casewriter_get_value_cnt (writer)); sort->run_id = 1; } while (!pqueue_is_empty (sort->pqueue)) @@ -151,8 +151,7 @@ output_record (struct sort_writer *sort) } if (sort->run == NULL) { - sort->run = tmpfile_writer_create (case_ordering_get_value_cnt ( - sort->ordering)); + sort->run = tmpfile_writer_create (sort->value_cnt); sort->run_id = min_run_id; } @@ -176,7 +175,8 @@ static struct casewriter_class sort_casewriter_class = struct casereader * sort_execute (struct casereader *input, struct case_ordering *ordering) { - struct casewriter *output = sort_create_writer (ordering); + struct casewriter *output = + sort_create_writer (ordering, casereader_get_value_cnt (input)); casereader_transfer (input, output); return casewriter_make_reader (output); } @@ -201,14 +201,14 @@ static int compare_pqueue_records_minheap (const void *a, const void *b, const void *pq_); static struct pqueue * -pqueue_create (const struct case_ordering *ordering) +pqueue_create (const struct case_ordering *ordering, size_t value_cnt) { struct pqueue *pq; pq = xmalloc (sizeof *pq); pq->ordering = case_ordering_clone (ordering); pq->record_cap - = settings_get_workspace_cases (case_ordering_get_value_cnt (ordering)); + = settings_get_workspace_cases (value_cnt); if (pq->record_cap > max_buffers) pq->record_cap = max_buffers; else if (pq->record_cap < min_buffers) diff --git a/src/math/sort.h b/src/math/sort.h index 7f7b2f8f..ea2c16b2 100644 --- a/src/math/sort.h +++ b/src/math/sort.h @@ -25,7 +25,7 @@ struct case_ordering; extern int min_buffers ; extern int max_buffers ; -struct casewriter *sort_create_writer (struct case_ordering *); +struct casewriter *sort_create_writer (struct case_ordering *, size_t value_cnt); struct casereader *sort_execute (struct casereader *, struct case_ordering *); #endif /* math/sort.h */