Skylark (Sketching Library)  0.1
/var/lib/jenkins/jobs/Skylark/workspace/sketch/hash_transform.hpp
Go to the documentation of this file.
00001 #ifndef SKYLARK_HASH_TRANSFORM_HPP
00002 #define SKYLARK_HASH_TRANSFORM_HPP
00003 
00004 #ifndef SKYLARK_SKETCH_HPP
00005 #error "Include top-level sketch.hpp instead of including individuals headers"
00006 #else
00007     #include "transforms.hpp"
00008     #include "hash_transform_data.hpp"
00009     #include "sketch_transform_data.hpp"
00010     #include "sketch_transform.hpp"
00011 #endif
00012 
00013 #include "../utility/distributions.hpp"
00014 
00015 namespace skylark { namespace sketch {
00016 
00017 template < typename InputMatrixType,
00018            typename OutputMatrixType,
00019            template <typename> class IdxDistributionType,
00020            template <typename> class ValueDistribution
00021         >
00022 struct hash_transform_t :
00023         public hash_transform_data_t<IdxDistributionType,
00024                                      ValueDistribution> {
00025     // To be specialized and derived. Just some guards here.
00026     typedef InputMatrixType matrix_type;
00027     typedef OutputMatrixType output_matrix_type;
00028     typedef hash_transform_data_t<IdxDistributionType, ValueDistribution>
00029     data_type;
00030 
00031     hash_transform_t(int N, int S, base::context_t& context)
00032         : data_type(N, S, context) {
00033         SKYLARK_THROW_EXCEPTION (
00034           base::sketch_exception()
00035               << base::error_msg(
00036                  "This combination has not yet been implemented for HashTransform"));
00037     }
00038 
00039     hash_transform_t(const data_type& other_data)
00040         : data_type(other_data) {
00041         SKYLARK_THROW_EXCEPTION (
00042           base::sketch_exception()
00043               << base::error_msg(
00044                  "This combination has not yet been implemented for HashTransform"));
00045     }
00046 
00047     hash_transform_t(const boost::property_tree::ptree &pt)
00048         : data_type(pt) {
00049         SKYLARK_THROW_EXCEPTION (
00050           base::sketch_exception()
00051               << base::error_msg(
00052                  "This combination has not yet been implemented for HashTransform"));
00053     }
00054 
00055     void apply (const matrix_type& A,
00056                 output_matrix_type& sketch_of_A,
00057                 columnwise_tag dimension) const {
00058         SKYLARK_THROW_EXCEPTION (
00059           base::sketch_exception()
00060               << base::error_msg(
00061                  "This combination has not yet been implemented for HashTransform"));
00062     }
00063 
00064     void apply (const matrix_type& A,
00065                 output_matrix_type& sketch_of_A,
00066                 rowwise_tag dimension) const {
00067         SKYLARK_THROW_EXCEPTION (
00068           base::sketch_exception()
00069               << base::error_msg(
00070                  "This combination has not yet been implemented for HashTransform"));
00071     }
00072 };
00073 
00074 } } 
00076 #if SKYLARK_HAVE_ELEMENTAL
00077 #include "hash_transform_Elemental.hpp"
00078 #endif
00079 
00080 #if SKYLARK_HAVE_COMBBLAS
00081 #include "hash_transform_CombBLAS.hpp"
00082 #endif
00083 
00084 #if SKYLARK_HAVE_ELEMENTAL and SKYLARK_HAVE_COMBBLAS
00085 #include "hash_transform_Mixed.hpp"
00086 #endif
00087 
00088 #include "hash_transform_local_sparse.hpp"
00089 
00090 #endif // SKYLARK_HASH_TRANSFORM_HPP