From 5ba11bc90223b55eecd5da4cfbe86c8fc40637a5 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 16 Dec 2015 19:13:14 +0000 Subject: [PATCH] Add additional parameter validation. --- src/mlpack/methods/sparse_coding/sparse_coding_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mlpack/methods/sparse_coding/sparse_coding_main.cpp b/src/mlpack/methods/sparse_coding/sparse_coding_main.cpp index 72bc2f5e9d..4f2324f97b 100644 --- a/src/mlpack/methods/sparse_coding/sparse_coding_main.cpp +++ b/src/mlpack/methods/sparse_coding/sparse_coding_main.cpp @@ -112,6 +112,10 @@ int main(int argc, char* argv[]) << "--output_model_file (-M) are specified; no output will be saved." << endl; + if (CLI::HasParam("codes_file") && !CLI::HasParam("test_file")) + Log::Fatal << "--codes_file (-c) is specified, but no test matrix (" + << "specified with --test_file or -T) is given to encode!" << endl; + if (!CLI::HasParam("training_file")) { if (CLI::HasParam("atoms"))