~mbogomilov/maus/devel3

« back to all changes in this revision

Viewing changes to tests/cpp_unit/Optics/CovarianceMatrixTest.cc

  • Committer: Durga Rajaram
  • Date: 2014-01-14 04:39:44 UTC
  • mfrom: (663.38.24 merge)
  • mto: (698.1.1 release)
  • mto: This revision was merged to the branch mainline in revision 693.
  • Revision ID: durga@fnal.gov-20140114043944-qf0i8nksnwu74cll
candidate 0.7.6 - trunk r1026

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
  try {
285
285
    const CovarianceMatrix rows_too_small_covariances(rows_too_small);
286
286
    testpass = false;
287
 
  } catch (Squeal squeal) {}
 
287
  } catch (MAUS::Exception exc) {}
288
288
  ASSERT_TRUE(testpass);
289
289
 
290
290
  const Matrix<double> columns_too_small(4, 6, 1.);
292
292
  try {
293
293
    const CovarianceMatrix columns_too_small_covariances(columns_too_small);
294
294
    testpass = false;
295
 
  } catch (Squeal squeal) {}
 
295
  } catch (MAUS::Exception exc) {}
296
296
  ASSERT_TRUE(testpass);
297
297
 
298
298
  // SymmetricMatrix copies
305
305
  try {
306
306
    const CovarianceMatrix too_small_covariances(too_small);
307
307
    testpass = false;
308
 
  } catch (Squeal squeal) {}
 
308
  } catch (MAUS::Exception exc) {}
309
309
  ASSERT_TRUE(testpass);
310
310
 
311
311
  // HepSymMatrix copy
318
318
  try {
319
319
    const CovarianceMatrix too_small_hep(hep_too_small);
320
320
    testpass = false;
321
 
  } catch (Squeal squeal) {}
 
321
  } catch (MAUS::Exception exc) {}
 
322
  ASSERT_TRUE(testpass);
 
323
 
 
324
  // TMatrixDSym copy
 
325
  const TMatrixDSym root_sym_matrix(6, non_positive_definite_data_);
 
326
  const CovarianceMatrix root_covariances(root_sym_matrix);
 
327
  ASSERT_EQ(root_covariances, non_positive_definite_matrix_);
 
328
 
 
329
  TMatrixDSym root_too_small(4);
 
330
  Double_t seed = 2.;
 
331
  root_too_small.RandomizePD(-2, 2, seed);
 
332
  testpass = true;
 
333
  try {
 
334
    const CovarianceMatrix too_small_covariances(root_too_small);
 
335
    testpass = false;
 
336
  } catch (MAUS::Exception exc) {}
322
337
  ASSERT_TRUE(testpass);
323
338
}
324
339