|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Exhaustive tests for al-matrix.H (sparse matrix with generic domains) More...
#include <gtest/gtest.h>#include <cmath>#include <memory>#include <sstream>#include <string>#include <type_traits>#include <vector>#include <al-domain.H>#include <al-vector.H>#include <al-matrix.H>Go to the source code of this file.
Functions | |
| TEST (MatrixConstruction, EmptyMatrixHasZeroEntries) | |
| TEST (MatrixConstruction, InitializerListConstructor) | |
| TEST (MatrixConstruction, InitializerListWithZerosNotStored) | |
| TEST (MatrixConstruction, InitializerListRowMismatchThrows) | |
| TEST (MatrixConstruction, InitializerListColMismatchThrows) | |
| TEST (MatrixEntries, SetAndGetEntry) | |
| TEST (MatrixEntries, SetEntryToZeroRemovesIt) | |
| TEST (MatrixEntries, SetEntryWithinEpsilonIsZero) | |
| TEST (MatrixEntries, OverwriteEntry) | |
| TEST (MatrixEpsilon, GetAndSetEpsilon) | |
| TEST (MatrixEpsilon, NegativeEpsilonThrows) | |
| TEST (MatrixTranspose, TransposeSwapsRowsAndCols) | |
| TEST (MatrixTranspose, DoubleTransposeIsIdentity) | |
| TEST (MatrixExtraction, GetRowAsList) | |
| TEST (MatrixExtraction, GetColAsList) | |
| TEST (MatrixExtraction, GetRowVector) | |
| TEST (MatrixExtraction, GetColVector) | |
| TEST (MatrixExtraction, InvalidRowThrows) | |
| TEST (MatrixExtraction, InvalidColThrows) | |
| TEST (MatrixVectorMult, MatrixTimesVector) | |
| TEST (MatrixVectorMult, VectorTimesMatrix) | |
| TEST (MatrixVectorMult, SparseMultiplication) | |
| TEST (MatrixVectorMult, DotProductMethod) | |
| TEST (MatrixVectorMult, DomainMismatchThrows) | |
| TEST (MatrixAddition, AddTwoMatrices) | |
| TEST (MatrixAddition, AddInPlace) | |
| TEST (MatrixAddition, AddSparseMatrices) | |
| TEST (MatrixScalar, MultiplyByScalar) | |
| TEST (MatrixScalar, ScalarTimesMatrix) | |
| TEST (MatrixIdentity, CreateIdentity) | |
| TEST (MatrixIdentity, IdentityTimesVectorIsVector) | |
| TEST (MatrixEquality, EqualMatrices) | |
| TEST (MatrixEquality, UnequalMatrices) | |
| TEST (MatrixEquality, EqualWithinEpsilon) | |
| TEST (MatrixFactory, CreateByRows) | |
| TEST (MatrixFactory, CreateByColumns) | |
| TEST (MatrixConversion, ToRowList) | |
| TEST (MatrixConversion, ToColList) | |
| TEST (MatrixSetVector, SetVectorAsRow) | |
| TEST (MatrixSetVector, SetVectorAsCol) | |
| TEST (MatrixOuterProduct, BasicOuterProduct) | |
| TEST (MatrixGenericDomain, StringDomainMatrix) | |
| TEST (MatrixGenericDomain, StringDomainTranspose) | |
| TEST (MatrixString, ToStrDoesNotCrash) | |
| TEST (MatrixDomain, GetRowAndColDomain) | |
| TEST (MatrixDomain, RowAndColDomainList) | |
| TEST (MatrixSubtraction, SubtractTwoMatrices) | |
| TEST (MatrixSubtraction, SubtractInPlace) | |
| TEST (MatrixSubtraction, SubtractSparseMatrices) | |
| TEST (MatrixSubtraction, SubtractFromItself) | |
| TEST (MatrixSubtraction, DomainMismatchThrows) | |
| TEST (MatrixCopyMove, CopyConstructor) | |
| TEST (MatrixCopyMove, CopyAssignment) | |
| TEST (MatrixCopyMove, SelfAssignment) | |
| TEST (MatrixCopyMove, MoveConstructor) | |
| TEST (MatrixCopyMove, MoveAssignment) | |
| TEST (MatrixCopyMove, CopyPreservesEpsilon) | |
| TEST (MatrixSharedPtr, ConstructWithSharedPtrDomains) | |
| TEST (MatrixSharedPtr, DomainOutlivesLocalScope) | |
| TEST (MatrixSharedPtr, CopiedMatrixSharesDomain) | |
| TEST (MatrixSharedPtr, VectorWithSharedPtrDomain) | |
| TEST (MatrixSharedPtr, MatrixVectorMultWithSharedDomains) | |
| TEST (MatrixMultDomainIdentity, SameDomainWorks) | |
| TEST (MatrixMultDomainIdentity, DifferentDomainsThrows) | |
| TEST (MatrixMultDomainIdentity, ChainedMultiplicationWithSharedDomain) | |
| TEST (MatrixTranspose, OfRowsAndColumnsOfDifferentTypes) | |
| TEST (MatrixMult, WithAnotherTypeOfColumns) | |
| TEST (MatrixMult, OfFloats) | |
| TEST (MatrixToStr, LabelsInTheOrderOfTheKeys) | |
| TEST (MatrixDomains, ResultsOutliveAMatrixThatOwnsItsDomains) | |
| TEST (MatrixDomains, KeepsTemporaryDomains) | |
| TEST (MatrixDomains, NeedsDomains) | |
| TEST (MatrixConstruction, ListOfListsRowLengthMismatchThrows) | |
| TEST (MatrixConstruction, ByRowsOrColumnsNeedsAVectorPerElement) | |
Exhaustive tests for al-matrix.H (sparse matrix with generic domains)
Tests cover:
Definition in file al_matrix_test.cc.
| TEST | ( | MatrixAddition | , |
| AddInPlace | |||
| ) |
Definition at line 526 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixAddition | , |
| AddSparseMatrices | |||
| ) |
Definition at line 548 of file al_matrix_test.cc.
References Aleph::Domain, and Aleph::sum().
| TEST | ( | MatrixAddition | , |
| AddTwoMatrices | |||
| ) |
Definition at line 504 of file al_matrix_test.cc.
References Aleph::Domain, and Aleph::sum().
| TEST | ( | MatrixConstruction | , |
| ByRowsOrColumnsNeedsAVectorPerElement | |||
| ) |
Definition at line 1563 of file al_matrix_test.cc.
References Aleph::DynList< T >::append(), cols, m, and rows.
| TEST | ( | MatrixConstruction | , |
| EmptyMatrixHasZeroEntries | |||
| ) |
Definition at line 103 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, r, and rows.
| TEST | ( | MatrixConstruction | , |
| InitializerListColMismatchThrows | |||
| ) |
Definition at line 164 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixConstruction | , |
| InitializerListConstructor | |||
| ) |
Definition at line 116 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixConstruction | , |
| InitializerListRowMismatchThrows | |||
| ) |
Definition at line 151 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixConstruction | , |
| InitializerListWithZerosNotStored | |||
| ) |
Definition at line 134 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixConstruction | , |
| ListOfListsRowLengthMismatchThrows | |||
| ) |
Definition at line 1541 of file al_matrix_test.cc.
References Aleph::DynList< T >::append(), cols, and rows.
| TEST | ( | MatrixConversion | , |
| ToColList | |||
| ) |
Definition at line 783 of file al_matrix_test.cc.
References cols, Aleph::Domain, FunctionalMethods< Container, T >::for_each(), and m.
| TEST | ( | MatrixConversion | , |
| ToRowList | |||
| ) |
Definition at line 762 of file al_matrix_test.cc.
References Aleph::Domain, FunctionalMethods< Container, T >::for_each(), m, and rows.
| TEST | ( | MatrixCopyMove | , |
| CopyAssignment | |||
| ) |
Definition at line 1112 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixCopyMove | , |
| CopyConstructor | |||
| ) |
Definition at line 1092 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixCopyMove | , |
| CopyPreservesEpsilon | |||
| ) |
Definition at line 1184 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixCopyMove | , |
| MoveAssignment | |||
| ) |
Definition at line 1166 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixCopyMove | , |
| MoveConstructor | |||
| ) |
Definition at line 1149 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixCopyMove | , |
| SelfAssignment | |||
| ) |
Definition at line 1132 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixDomain | , |
| GetRowAndColDomain | |||
| ) |
Definition at line 955 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixDomain | , |
| RowAndColDomainList | |||
| ) |
Definition at line 966 of file al_matrix_test.cc.
References cols, Aleph::Domain, FunctionalMethods< Container, T >::for_each(), m, and rows.
| TEST | ( | MatrixDomains | , |
| KeepsTemporaryDomains | |||
| ) |
Definition at line 1497 of file al_matrix_test.cc.
References Aleph::DynList< T >::append(), cols, m, rows, and OhashCommon< HashTbl, Key >::size().
| TEST | ( | MatrixDomains | , |
| NeedsDomains | |||
| ) |
Definition at line 1529 of file al_matrix_test.cc.
| TEST | ( | MatrixDomains | , |
| ResultsOutliveAMatrixThatOwnsItsDomains | |||
| ) |
Definition at line 1460 of file al_matrix_test.cc.
References cols, m, Aleph::outer_product(), r, and rows.
| TEST | ( | MatrixEntries | , |
| OverwriteEntry | |||
| ) |
Definition at line 219 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixEntries | , |
| SetAndGetEntry | |||
| ) |
Definition at line 182 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixEntries | , |
| SetEntryToZeroRemovesIt | |||
| ) |
Definition at line 196 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixEntries | , |
| SetEntryWithinEpsilonIsZero | |||
| ) |
Definition at line 209 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixEpsilon | , |
| GetAndSetEpsilon | |||
| ) |
Definition at line 234 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixEpsilon | , |
| NegativeEpsilonThrows | |||
| ) |
Definition at line 246 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixEquality | , |
| EqualMatrices | |||
| ) |
Definition at line 644 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixEquality | , |
| EqualWithinEpsilon | |||
| ) |
Definition at line 680 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixEquality | , |
| UnequalMatrices | |||
| ) |
Definition at line 662 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixExtraction | , |
| GetColAsList | |||
| ) |
Definition at line 319 of file al_matrix_test.cc.
References cols, Aleph::Domain, FunctionalMethods< Container, T >::for_each(), m, and rows.
| TEST | ( | MatrixExtraction | , |
| GetColVector | |||
| ) |
Definition at line 355 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixExtraction | , |
| GetRowAsList | |||
| ) |
Definition at line 299 of file al_matrix_test.cc.
References cols, Aleph::Domain, FunctionalMethods< Container, T >::for_each(), m, and rows.
| TEST | ( | MatrixExtraction | , |
| GetRowVector | |||
| ) |
Definition at line 338 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixExtraction | , |
| InvalidColThrows | |||
| ) |
Definition at line 381 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixExtraction | , |
| InvalidRowThrows | |||
| ) |
Definition at line 371 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixFactory | , |
| CreateByColumns | |||
| ) |
Definition at line 726 of file al_matrix_test.cc.
References Aleph::DynList< T >::append(), cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixFactory | , |
| CreateByRows | |||
| ) |
Definition at line 697 of file al_matrix_test.cc.
References Aleph::DynList< T >::append(), cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixGenericDomain | , |
| StringDomainMatrix | |||
| ) |
Definition at line 886 of file al_matrix_test.cc.
| TEST | ( | MatrixGenericDomain | , |
| StringDomainTranspose | |||
| ) |
Definition at line 910 of file al_matrix_test.cc.
| TEST | ( | MatrixIdentity | , |
| CreateIdentity | |||
| ) |
Definition at line 610 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixIdentity | , |
| IdentityTimesVectorIsVector | |||
| ) |
Definition at line 622 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixMult | , |
| OfFloats | |||
| ) |
Definition at line 1417 of file al_matrix_test.cc.
References Aleph::Matrix< Trow, Tcol, NumType >::set_entry().
| TEST | ( | MatrixMult | , |
| WithAnotherTypeOfColumns | |||
| ) |
Definition at line 1389 of file al_matrix_test.cc.
| TEST | ( | MatrixMultDomainIdentity | , |
| ChainedMultiplicationWithSharedDomain | |||
| ) |
Definition at line 1313 of file al_matrix_test.cc.
| TEST | ( | MatrixMultDomainIdentity | , |
| DifferentDomainsThrows | |||
| ) |
Definition at line 1300 of file al_matrix_test.cc.
| TEST | ( | MatrixMultDomainIdentity | , |
| SameDomainWorks | |||
| ) |
Definition at line 1283 of file al_matrix_test.cc.
| TEST | ( | MatrixOuterProduct | , |
| BasicOuterProduct | |||
| ) |
Definition at line 854 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixScalar | , |
| MultiplyByScalar | |||
| ) |
Definition at line 572 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixScalar | , |
| ScalarTimesMatrix | |||
| ) |
Definition at line 589 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixSetVector | , |
| SetVectorAsCol | |||
| ) |
Definition at line 829 of file al_matrix_test.cc.
References col, Aleph::Domain, and m.
| TEST | ( | MatrixSetVector | , |
| SetVectorAsRow | |||
| ) |
Definition at line 808 of file al_matrix_test.cc.
References Aleph::Domain, m, and row.
| TEST | ( | MatrixSharedPtr | , |
| ConstructWithSharedPtrDomains | |||
| ) |
Definition at line 1201 of file al_matrix_test.cc.
| TEST | ( | MatrixSharedPtr | , |
| CopiedMatrixSharesDomain | |||
| ) |
Definition at line 1231 of file al_matrix_test.cc.
| TEST | ( | MatrixSharedPtr | , |
| DomainOutlivesLocalScope | |||
| ) |
Definition at line 1219 of file al_matrix_test.cc.
References m, and OhashCommon< HashTbl, Key >::size().
| TEST | ( | MatrixSharedPtr | , |
| MatrixVectorMultWithSharedDomains | |||
| ) |
Definition at line 1259 of file al_matrix_test.cc.
References m.
| TEST | ( | MatrixSharedPtr | , |
| VectorWithSharedPtrDomain | |||
| ) |
Definition at line 1244 of file al_matrix_test.cc.
| TEST | ( | MatrixString | , |
| ToStrDoesNotCrash | |||
| ) |
Definition at line 938 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixSubtraction | , |
| DomainMismatchThrows | |||
| ) |
Definition at line 1076 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixSubtraction | , |
| SubtractFromItself | |||
| ) |
Definition at line 1059 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixSubtraction | , |
| SubtractInPlace | |||
| ) |
Definition at line 1017 of file al_matrix_test.cc.
References Aleph::Domain.
| TEST | ( | MatrixSubtraction | , |
| SubtractSparseMatrices | |||
| ) |
Definition at line 1039 of file al_matrix_test.cc.
References Aleph::diff(), and Aleph::Domain.
| TEST | ( | MatrixSubtraction | , |
| SubtractTwoMatrices | |||
| ) |
Definition at line 995 of file al_matrix_test.cc.
References Aleph::diff(), and Aleph::Domain.
| TEST | ( | MatrixToStr | , |
| LabelsInTheOrderOfTheKeys | |||
| ) |
Definition at line 1436 of file al_matrix_test.cc.
References m.
| TEST | ( | MatrixTranspose | , |
| DoubleTransposeIsIdentity | |||
| ) |
Definition at line 280 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixTranspose | , |
| OfRowsAndColumnsOfDifferentTypes | |||
| ) |
Definition at line 1369 of file al_matrix_test.cc.
References cols, Aleph::Matrix< Trow, Tcol, NumType >::get_col_domain_ptr(), Aleph::Matrix< Trow, Tcol, NumType >::get_entry(), Aleph::Matrix< Trow, Tcol, NumType >::get_row_domain_ptr(), m, and rows.
| TEST | ( | MatrixTranspose | , |
| TransposeSwapsRowsAndCols | |||
| ) |
Definition at line 259 of file al_matrix_test.cc.
References cols, Aleph::Domain, m, and rows.
| TEST | ( | MatrixVectorMult | , |
| DomainMismatchThrows | |||
| ) |
Definition at line 489 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixVectorMult | , |
| DotProductMethod | |||
| ) |
Definition at line 469 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixVectorMult | , |
| MatrixTimesVector | |||
| ) |
Definition at line 395 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixVectorMult | , |
| SparseMultiplication | |||
| ) |
Definition at line 447 of file al_matrix_test.cc.
References Aleph::Domain, and m.
| TEST | ( | MatrixVectorMult | , |
| VectorTimesMatrix | |||
| ) |
Definition at line 421 of file al_matrix_test.cc.
References Aleph::Domain, and m.