|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Tests for Knapsack.H. More...
#include <gtest/gtest.h>#include <algorithm>#include <cstdint>#include <limits>#include <random>#include <Knapsack.H>Go to the source code of this file.
Typedefs | |
| using | Item = Knapsack_Item< int, int > |
Functions | |
| TEST (Knapsack01, EmptyItems) | |
| TEST (Knapsack01, ZeroCapacity) | |
| TEST (Knapsack01, ClassicExample) | |
| TEST (Knapsack01, AllFit) | |
| TEST (Knapsack01, ValueOnly) | |
| TEST (Knapsack01, NegativeCapacity) | |
| TEST (Knapsack01, ZeroWeightItemsAtZeroCapacity) | |
| TEST (Knapsack, NegativeWeightRejected) | |
| TEST (KnapsackUnbounded, Classic) | |
| TEST (KnapsackUnbounded, ZeroWeightPositiveValueRejected) | |
| TEST (KnapsackUnbounded, Empty) | |
| TEST (KnapsackBounded, Classic) | |
| TEST (KnapsackBounded, SizeMismatch) | |
| TEST (Knapsack01, RandomVsBruteForce) | |
| TEST (KnapsackUnbounded, RandomVsBruteForce) | |
| TEST (KnapsackBounded, RandomVsBruteForce) | |
Tests for Knapsack.H.
Definition in file knapsack_test.cc.
| using Item = Knapsack_Item<int, int> |
Definition at line 48 of file knapsack_test.cc.
| TEST | ( | Knapsack | , |
| NegativeWeightRejected | |||
| ) |
Definition at line 217 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_01(), Aleph::knapsack_01_value(), Aleph::knapsack_bounded(), and Aleph::knapsack_unbounded().
| TEST | ( | Knapsack01 | , |
| AllFit | |||
| ) |
Definition at line 186 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_01(), and r.
| TEST | ( | Knapsack01 | , |
| ClassicExample | |||
| ) |
Definition at line 164 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), k, Aleph::knapsack_01(), and r.
| TEST | ( | Knapsack01 | , |
| EmptyItems | |||
| ) |
Definition at line 149 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_01(), and r.
| TEST | ( | Knapsack01 | , |
| NegativeCapacity | |||
| ) |
Definition at line 200 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_01(), and Aleph::knapsack_01_value().
| TEST | ( | Knapsack01 | , |
| RandomVsBruteForce | |||
| ) |
Definition at line 295 of file knapsack_test.cc.
References Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_01(), Aleph::knapsack_01_value(), r, Aleph::Array< T >::reserve(), rng, and w.
| TEST | ( | Knapsack01 | , |
| ValueOnly | |||
| ) |
Definition at line 194 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::knapsack_01_value().
| TEST | ( | Knapsack01 | , |
| ZeroCapacity | |||
| ) |
Definition at line 157 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_01(), and r.
| TEST | ( | Knapsack01 | , |
| ZeroWeightItemsAtZeroCapacity | |||
| ) |
Definition at line 207 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_01(), Aleph::knapsack_01_value(), and r.
| TEST | ( | KnapsackBounded | , |
| Classic | |||
| ) |
Definition at line 258 of file knapsack_test.cc.
References Aleph::Array< T >::create(), Aleph::divide_and_conquer_partition_dp(), k, Aleph::knapsack_bounded(), r, and Aleph::Array< T >::size().
| TEST | ( | KnapsackBounded | , |
| RandomVsBruteForce | |||
| ) |
Definition at line 348 of file knapsack_test.cc.
References Aleph::Array< T >::append(), Aleph::Array< T >::create(), Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_bounded(), r, Aleph::Array< T >::reserve(), rng, and w.
| TEST | ( | KnapsackBounded | , |
| SizeMismatch | |||
| ) |
Definition at line 288 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::knapsack_bounded().
| TEST | ( | KnapsackUnbounded | , |
| Classic | |||
| ) |
Definition at line 228 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), k, Aleph::knapsack_unbounded(), and r.
| TEST | ( | KnapsackUnbounded | , |
| Empty | |||
| ) |
Definition at line 251 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_unbounded(), and r.
| TEST | ( | KnapsackUnbounded | , |
| RandomVsBruteForce | |||
| ) |
Definition at line 323 of file knapsack_test.cc.
References Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::knapsack_unbounded(), r, Aleph::Array< T >::reserve(), rng, and w.
| TEST | ( | KnapsackUnbounded | , |
| ZeroWeightPositiveValueRejected | |||
| ) |
Definition at line 245 of file knapsack_test.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::knapsack_unbounded().